package com.miloisbadboy; import android.app.Activity; import android.os.Bundle; import android.widget.GridView; import com.miloisbadboy.view.PullToRefreshView; import com.miloisbadboy.view.PullToRefreshView.OnFooterRefreshListener; import com.miloisbadboy.view.PullToRefreshView.OnHeaderRefreshListener; public class TestGridView extends Activity implements OnHeaderRefreshListener,OnFooterRefreshListener{ PullToRefreshView mPullToRefreshView; GridView mGridView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.test_gridview); mPullToRefreshView = (PullToRefreshView)findViewById(R.id.main_pull_refresh_view); mGridView = (GridView)findViewById(R.id.gridview); mGridView.setAdapter(new DataAdapter(this)); mPullToRefreshView.setOnHeaderRefreshListener(this); mPullToRefreshView.setOnFooterRefreshListener(this); } @Override public void onFooterRefresh(PullToRefreshView view) { mPullToRefreshView.postDelayed(new Runnable() { @Override public void run() { mPullToRefreshView.onFooterRefreshComplete(); } }, 1000); } @Override public void onHeaderRefresh(PullToRefreshView view) { mPullToRefreshView.postDelayed(new Runnable() { @Override public void run() { // 设置更新时间 //mPullToRefreshView.onHeaderRefreshComplete("最近更新:01-23 12:01"); mPullToRefreshView.onHeaderRefreshComplete(); } },1000); } }
最近下载更多