Пример #1
0
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   switch (msg.what) {
     case 0:
       if (mSwipeLayout.isRefreshing()) {
         mSwipeLayout.setRefreshing(false);
       }
       break;
   }
 }
Пример #2
0
 private void updateUI(View view) {
   recyclerView = (RecyclerView) view.findViewById(R.id.rv_augur);
   recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));
   // 子布局装饰
   recyclerView.addItemDecoration(
       new DividerItemDecoration(getContext(), LinearLayoutManager.VERTICAL));
   mAdapter = new AugurAdapter(mycontext, this);
   mAdapter.setMdatas(datas);
   recyclerView.setAdapter(mAdapter);
   // 滑动加载更多的layout
   mSwipeLayout = (VerticalSwipeRefreshLayout) view.findViewById(R.id.swipe_container);
   mSwipeLayout.setColorSchemeResources(
       android.R.color.holo_blue_bright,
       android.R.color.holo_blue_bright,
       android.R.color.holo_blue_bright,
       android.R.color.holo_blue_bright);
   // 需要实现方法
   mSwipeLayout.setOnRefreshListener(this);
   onRefresh();
 }
Пример #3
0
 public void setSwipeToRefreshEnabled(boolean enabled) {
   mSwipeLayout.setEnabled(enabled);
 }