示例#1
0
  private void initEvent() {
    adapter.setOnItemClickListener(
        new RecycleAdapterEx.OnItemClickListener() {
          @Override
          public void OnItemClick(View view, int position) {
            mIntent = new Intent(getActivity().getApplicationContext(), CenterActivity.class);
            Bundle bundle = new Bundle();
            bundle.putSerializable(KEY, adapter.getSerializableLightPic(position));
            mIntent.putExtras(bundle);
            mIntent.putExtra("URL", true);
            getActivity().startActivity(mIntent);
          }

          @Override
          public void OnItemLongClick(View view, int position) {}
        });

    mSwipeRefreshLayout.setOnRefreshListener(
        new SwipeRefreshLayout.OnRefreshListener() {
          @Override
          public void onRefresh() {
            adapter.notifyDataSetChanged();
            mSwipeRefreshLayout.setRefreshing(false);
          }
        });
  }
示例#2
0
 @Override
 public void handleMessage(Message msg) {
   if (msg.what == 0x127) {
     //                mSwipeRefreshLayout.setRefreshing(false);    //设置进度条旋转
     adapter.notifyDataSetChanged();
     mProgressBar.setVisibility(View.INVISIBLE);
   }
   if (msg.what == 0x000) {
     showToast("获取数据失败");
     mProgressBar.setVisibility(View.INVISIBLE);
   }
 }