源码简介:优秀计步器源码,记录每天的跑步里程。
源码效果:
源码片段:
- package com.zdp.family.pedometer;
- import java.util.ArrayList;
- import com.zdp.family.pedometer.R;
- import com.zdp.family.pedometer.adapter.ZdpLongAdapter;
- import com.zdp.family.pedometer.app.ZdpAplication;
- import com.zdp.family.pedometer.app.ZdpPubDefine;
- import com.zdp.family.pedometer.data.ZdpLongTitleInfo;
- import com.zdp.family.pedometer.thread.MessageObj;
- import com.zdp.family.pedometer.view.ZdpProgressDialog;
- import com.zdp.family.pedometer.view.ZdpPullToRefreshListView.OnRefreshListener;
- import android.content.Intent;
- import android.os.Bundle;
- import android.os.Handler;
- import android.os.Message;
- import android.support.v4.app.Fragment;
- import android.support.v4.view.ViewPager.OnPageChangeListener;
- import android.view.LayoutInflater;
- import android.view.MotionEvent;
- import android.view.View;
- import android.view.ViewGroup;
- import android.view.View.OnClickListener;
- import android.view.View.OnTouchListener;
- import android.widget.AdapterView;
- import android.widget.Button;
- import android.widget.ImageView;
- import android.widget.ListView;
- import android.widget.TextView;
- import android.widget.AdapterView.OnItemClickListener;
- public class ZdpFragmentMain extends ZdpBaseFragment
- {
- private ListView mListView;
- private ZdpLongAdapter mAdapter;
- private ZdpProgressDialog mProgressDialog;
- private Handler mCookHandler = new Handler()
- {
- @Override
- public void handleMessage(Message msg)
- {
- super.handleMessage(msg);
- if(getActivity().isFinishing())
- return ;
- switch (msg.what)
- {
- case ZdpPubDefine.CMD_LONG_TITLE:
- if(mProgressDialog.isShowing())
- mProgressDialog.dismiss();
- break;
- default:
- break;
- }
- }
- };
- private OnItemClickListener mOnItemClickListener = new OnItemClickListener()
- {
- @Override
- public void onItemClick(AdapterView<!--?--> arg0, View view, int position,long id)
- {
- }
- };
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- }
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState)
- {
- View v = inflater.inflate(R.layout.main_main_fragment, container, false);
- return v;
- }
- @Override
- public void OnRefreshData()
- {
- super.OnRefreshData();
- }
- public void switchIndex(String url)
- {
- mProgressDialog.show();
- sendCookMessage(url);
- }
- private void sendCookMessage(String url)
- {
- // Message msg = new Message();
- // msg.what = ZdpPubDefine.CMD_LONG_TITLE;
- // msg.obj = new MessageObj(mCookHandler, url);
- // ZdpAplication.getInstance().getHttpsHandler().sendMessage(msg);
- }
- @Override
- public void onDestroy()
- {
- super.onDestroy();
- }
- @Override
- public void onDestroyView()
- {
- super.onDestroyView();
- }
- }