当前位置: 首页>>代码示例>>Java>>正文


Java PullRefreshLayout类代码示例

本文整理汇总了Java中com.baoyz.widget.PullRefreshLayout的典型用法代码示例。如果您正苦于以下问题:Java PullRefreshLayout类的具体用法?Java PullRefreshLayout怎么用?Java PullRefreshLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PullRefreshLayout类属于com.baoyz.widget包,在下文中一共展示了PullRefreshLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onOptionsItemSelected

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();

    switch (id){
        case R.id.action_material:
            layout.setRefreshStyle(PullRefreshLayout.STYLE_MATERIAL);
            return true;
        case R.id.action_circles:
            layout.setRefreshStyle(PullRefreshLayout.STYLE_CIRCLES);
            return true;
        case R.id.action_water_drop:
            layout.setRefreshStyle(PullRefreshLayout.STYLE_WATER_DROP);
            return true;
        case R.id.action_ring:
            layout.setRefreshStyle(PullRefreshLayout.STYLE_RING);
            return true;
        case R.id.action_smartisan:
            layout.setRefreshStyle(PullRefreshLayout.STYLE_SMARTISAN);
            return true;
    }

    return super.onOptionsItemSelected(item);
}
 
开发者ID:baoyongzhang,项目名称:android-PullRefreshLayout,代码行数:25,代码来源:ListViewActivity.java

示例2: initView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
public void initView() {
    mRootView=View.inflate(mActivity, R.layout.pager_base,null);
    mListView = (PullUpListView) mRootView.findViewById(R.id.list_viewpager_home);
    mRefresh = (PullRefreshLayout)mRootView.findViewById(R.id.swipeRefreshLayout);
    mRefresh.setRefreshStyle(PullRefreshLayout.STYLE_MATERIAL);
    mNullHint = (TextView) mRootView.findViewById(R.id.tv_null_base);
    mLoading = (ProgressBar) mRootView.findViewById(R.id.loading_pager);
    container = (CoordinatorLayout) mActivity.findViewById(R.id.coorl_home);
    mCurrentPage=0;
    isLoadingMore=false;
    query = new BmobQuery<Debate>();
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:13,代码来源:BasePager.java

示例3: initListener

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
protected void initListener(){
    mListView.setOnRefreshListener(new PullUpListView.OnRefreshListener() {
        @Override
        public void onLoadMore() {
            Log.d("BB","加载更多-BasePager");
            isLoadingMore=true;
            mCurrentPage++;
            refreshData();
        }
    });
    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Intent intent = new Intent(mActivity, DebateActivity.class);
            Debate debate = (Debate) mListView.getAdapter().getItem(position);
            //将该条目的Debate对象传递给显示页面
            Log.d("BB","加载更多-BasePager");
            intent.putExtra("debate",debate);
            mActivity.startActivity(intent);
        }
    });
    mRefresh.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            mNullHint.setVisibility(View.GONE);
            new Thread(){
                @Override
                public void run() {
                    SystemClock.sleep(1000);
                    refreshData();
                }
            }.start();
        }
    });
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:36,代码来源:BasePager.java

示例4: onCreateView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.home_fragment, container, false);
    ButterKnife.bind(this, root);

    RecyclerView.Adapter mAdapter = new RecyclerAdapter(getActivity());
    ObserverManager.getInstance().setAdapter(mAdapter);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(root.getContext()));
    mRecyclerView.setAdapter(mAdapter);

    pullRefreshLayout.setRefreshStyle(PullRefreshLayout.STYLE_MATERIAL);


    pullRefreshLayout.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    NetWorkManager.getInstance().refreshAllData(mRecyclerView);
                    Snackbar.make(mRecyclerView, "正在刷新...", Snackbar.LENGTH_SHORT).show();
                    pullRefreshLayout.setRefreshing(false);

                }
            });
        }
    });

    return root;
}
 
开发者ID:Novemser,项目名称:iTongJi-App,代码行数:32,代码来源:HomePageCards.java

示例5: initChatMsgListView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
private void initChatMsgListView() {
     m_lnkChatMsg = new LinkedList<ChatMsg>();
     m_chatMsgAdapter = new ChatMsgAdapter(this, m_nGroupCode, m_lnkChatMsg);
     m_lvMsg.setAdapter(m_chatMsgAdapter);

//     m_lvMsg.getLoadingLayoutProxy().setPullLabel("");
//     m_lvMsg.getLoadingLayoutProxy().setReleaseLabel("");
//     m_lvMsg.getLoadingLayoutProxy().setRefreshingLabel("");
//     m_lvMsg.getLoadingLayoutProxy().setLastUpdatedLabel("");
//     m_lvMsg.getLoadingLayoutProxy().setQQMode(1);

    // m_lvMsg.setOnRefreshListener(this);
     swipeRefreshLayout_chat.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
         @Override
         public void onRefresh() {
             new ReadMsgLogTask().execute();
             swipeRefreshLayout_chat.postDelayed(new Runnable() {
                 @Override
                 public void run() {
                     swipeRefreshLayout_chat.setRefreshing(false);
                     //refresh();
                     m_chatMsgAdapter.notifyDataSetChanged();
                 }
             }, 1000);
         }
     });

     List<Object> arrMsgLog = readMsgLog();
     updateChatMsgListView(arrMsgLog);
 }
 
开发者ID:wang4yu6peng13,项目名称:MaterialQQLite,代码行数:31,代码来源:ChatActivity.java

示例6: onCreateView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.fragment_contacts,null);
	mListView = (ExpandableListView)
			view.findViewById(R.id.expandableListView);
       m_headerBar = (LinearLayout)inflater.inflate(
       		R.layout.buddy_list_header, null);
	//mListView.getRefreshableView().addHeaderView(m_headerBar);
       mListView.addHeaderView(m_headerBar);

       swipeRefreshLayout_freind= (PullRefreshLayout) view.findViewById(R.id.swipeRefreshLayout_friend);
       return view;
}
 
开发者ID:wang4yu6peng13,项目名称:MaterialQQLite,代码行数:15,代码来源:ContactsFragment.java

示例7: onCreateView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_group,
            null);
    m_lvGroupList =( ListView)view.findViewById(R.id.group_lvGList);
    swipeRefreshLayout_group= (PullRefreshLayout) view.findViewById(R.id.swipeRefreshLayout_group);
//    m_headerBar = (LinearLayout)inflater.inflate(R.layout.buddy_list_header, null);
//    mListView.getRefreshableView().addHeaderView(m_headerBar);
    return view;
}
 
开发者ID:wang4yu6peng13,项目名称:MaterialQQLite,代码行数:12,代码来源:GroupFragment.java

示例8: initView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
private void initView() {
       m_QQClient = AppData.getAppData().getQQClient();
       m_QQClient.setCallBackHandler(m_Handler);
       m_groupList = m_QQClient.getGroupList();
	
//	m_txtBack = (TextView)findViewById(R.id.group_txtBack);
//	m_btnAdd = (ImageButton)findViewById(R.id.group_btnAdd);
//	m_lvGroupList = (PullToRefreshListView)findViewById(R.id.group_lvGList);
	
//	m_searchBar = (LinearLayout)((LayoutInflater)getSystemService(
   //            Context.LAYOUT_INFLATER_SERVICE)).inflate(
   //            R.layout.searchbar, null);
	//ListView actualListView = m_lvGroupList.getRefreshableView();
//	actualListView.addHeaderView(m_searchBar);

	swipeRefreshLayout_group.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
           @Override
           public void onRefresh() {
               new GetDataTask().execute();
               swipeRefreshLayout_group.postDelayed(new Runnable() {
                   @Override
                   public void run() {
                       swipeRefreshLayout_group.setRefreshing(false);
                       //refresh();
                       m_glistAdapter.notifyDataSetChanged();
                   }
               }, 1000);
           }
       });

//	m_lvGroupList.getLoadingLayoutProxy().setPullLabel("下拉刷新");
//	m_lvGroupList.getLoadingLayoutProxy().setReleaseLabel("释放立即刷新");
//	m_lvGroupList.getLoadingLayoutProxy().setRefreshingLabel("正在刷新...");
//	m_lvGroupList.getLoadingLayoutProxy().setLastUpdatedLabel("");
	
	m_glistAdapter = new GroupListAdapter(getActivity(), m_groupList);
	m_lvGroupList.setAdapter(m_glistAdapter);
	m_lvGroupList.setOnItemClickListener(this);
}
 
开发者ID:wang4yu6peng13,项目名称:MaterialQQLite,代码行数:40,代码来源:GroupFragment.java

示例9: onCreateView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_stations_list, container, false);

    tab = getArguments().getString(Utils.ARGS_PAGE_TITLE);
    stations = new ArrayList<>();

    RecyclerView list = (RecyclerView) v.findViewById(R.id.list);
    list.setLayoutManager(new LinearLayoutManager(getActivity()));
    list.setItemAnimator(new DefaultItemAnimator());
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
    String distanceUnit = prefs.getString("pref_distance_units", "km");
    adapter = new StationRowAdapter(stations, distanceUnit);
    list.setAdapter(adapter);

    refresh = (PullRefreshLayout) v.findViewById(R.id.refresh);
    refresh.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            new GetStationList().execute();
        }
    });

    refresh.setRefreshing(true);
    new GetStationList().execute();

    return v;
}
 
开发者ID:Train-Track,项目名称:Train-Track-Android,代码行数:29,代码来源:StationsListFragment.java

示例10: onCreateView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_station_board, container, false);
    StationActivity activity = ((StationActivity) getActivity());
    final Station station = activity.getStation();
    StationBoard board = activity.getArrivalsBoard();

    services = new ArrayList<>();
    nrccMessage = (TextView) v.findViewById(R.id.nrcc_messages);

    RecyclerView list = (RecyclerView) v.findViewById(R.id.list);
    list.setLayoutManager(new LinearLayoutManager(getContext()));
    list.setItemAnimator(new DefaultItemAnimator());
    adapter = new ServiceArrivalRowAdapter(services, station);
    list.setAdapter(adapter);

    refresh = (PullRefreshLayout) v.findViewById(R.id.refresh);
    refresh.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            new GetArrivalsBoardRequest().execute(station.getUuid());
        }
    });

    if (board == null) {
        refresh.setRefreshing(true);
        new GetArrivalsBoardRequest().execute(station.getUuid());
    } else {
        updateBoard(board);
    }

    return v;
}
 
开发者ID:Train-Track,项目名称:Train-Track-Android,代码行数:34,代码来源:StationArrivalsFragment.java

示例11: onCreateView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_station_board, container, false);
    StationActivity activity = ((StationActivity) getActivity());
    final Station station = activity.getStation();
    StationBoard board = activity.getDeparturesBoard();

    services = new ArrayList<>();
    nrccMessage = (TextView) v.findViewById(R.id.nrcc_messages);

    RecyclerView list = (RecyclerView) v.findViewById(R.id.list);
    list.setLayoutManager(new LinearLayoutManager(getContext()));
    list.setItemAnimator(new DefaultItemAnimator());
    adapter = new ServiceDepartureRowAdapter(services, station);
    list.setAdapter(adapter);

    refresh = (PullRefreshLayout) v.findViewById(R.id.refresh);
    refresh.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            new GetDepartureBoardRequest().execute(station.getUuid());
        }
    });

    if (board == null) {
        refresh.setRefreshing(true);
        new GetDepartureBoardRequest().execute(station.getUuid());
    } else {
        updateBoard(board);
    }

    return v;
}
 
开发者ID:Train-Track,项目名称:Train-Track-Android,代码行数:34,代码来源:StationDeparturesFragment.java

示例12: onCreateView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_station_board, container, false);
    StationActivity activity = ((StationActivity) getActivity());
    final Station station = activity.getStation();
    StationBoard board = activity.getUndergroundBoard();

    services = new ArrayList<>();
    nrccMessage = (TextView) v.findViewById(R.id.nrcc_messages);

    RecyclerView list = (RecyclerView) v.findViewById(R.id.list);
    list.setLayoutManager(new LinearLayoutManager(getActivity()));
    list.setItemAnimator(new DefaultItemAnimator());
    adapter = new ServiceUndergroundRowAdapter(services);
    list.setAdapter(adapter);

    refresh = (PullRefreshLayout) v.findViewById(R.id.refresh);
    refresh.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            new GetUndergroundBoardRequest().execute(station.getUuid());
        }
    });

    if (board == null) {
        refresh.setRefreshing(true);
        new GetUndergroundBoardRequest().execute(station.getUuid());
    } else {
        updateBoard(board);
    }

    return v;
}
 
开发者ID:Train-Track,项目名称:Train-Track-Android,代码行数:34,代码来源:StationUndergroundFragment.java

示例13: initView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
@SuppressLint("NewApi")
    private void initView() {
    //    m_txtName = (TextView)findViewById(R.id.chat_txtName);
        m_lvMsg = (ListView)findViewById(R.id.chat_lvMsg);
        swipeRefreshLayout_chat= (PullRefreshLayout) findViewById(R.id.swipeRefreshLayout_chat);
        m_btnFace = (ImageButton)findViewById(R.id.chat_btnFace);
    //    m_btnMore = (ImageButton)findViewById(R.id.chat_btnMore);
        m_edtMsg = (EditText) findViewById(R.id.chat_edtMsg);
        m_btnSend = (Button) findViewById(R.id.chat_btnSend);
        m_faceBar = findViewById(R.id.chat_facebar);
        m_vpFace = (ViewPager)findViewById(R.id.chat_vpFace);
        m_dotBar = (LinearLayout) findViewById(R.id.chat_dotbar);



        m_btnFace.setOnClickListener(this);
        m_edtMsg.setOnClickListener(this);
        m_btnSend.setOnClickListener(this);

        if (m_nType != IS_GROUP)
          //  m_txtName.setText(m_strBuddyName);
            m_txtName=m_strBuddyName;
        else
         //   m_txtName.setText(m_strGroupName);
        m_txtName=m_strGroupName;

        initChatMsgListView();	// 初始化聊天消息列表框
        initFaceBar();			// 初始化表情栏

        m_nCurFacePage = 0;
        m_vpFace.setCurrentItem(1);

        toolbar = (Toolbar) findViewById(R.id.toolbar_chat);
        toolbar.setNavigationIcon(R.drawable.qqicon);
        toolbar.setTitle(m_txtName);

        setSupportActionBar(toolbar);
        toolbar.setNavigationOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        chat_inputbar= (LinearLayout) findViewById(R.id.chat_inputbar);

        toolbar.setBackgroundColor(color_theme);
        chat_inputbar.setBackgroundColor(color_theme);

        // 去除 ListView 上下边界蓝色或黄色阴影
//		ListView actualListView = m_lvMsg.getRefreshableView();
//		if (Integer.parseInt(Build.VERSION.SDK) >= 9) {
//			actualListView.setOverScrollMode(View.OVER_SCROLL_NEVER);
//        }
    }
 
开发者ID:wang4yu6peng13,项目名称:MaterialQQLite,代码行数:56,代码来源:ChatActivity.java

示例14: initView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
private void initView() {
       m_QQClient = AppData.getAppData().getQQClient();
       m_buddyList = m_QQClient.getBuddyList();

//	m_btnBuddyTeam = (Button)getActivity().findViewById(R.id.contacts_btnBuddyTeam);
//	m_btnAllBuddy = (Button)getActivity().findViewById(R.id.contacts_btnAllBuddy);
	mListView = (ExpandableListView)getActivity().findViewById(R.id.expandableListView);
//	m_btnGroup = (ImageButton)getActivity().findViewById(R.id.contacts_btnGroup);
       swipeRefreshLayout_freind= (PullRefreshLayout) getActivity().findViewById(R.id.swipeRefreshLayout_friend);
//	m_btnBuddyTeam.setOnClickListener(this);
//	m_btnAllBuddy.setOnClickListener(this);
//	m_btnGroup.setOnClickListener(this);

       //ExpandableListView actualListView = mListView.getRefreshableView();
       mListView.setGroupIndicator(null);
       m_blistAdapter = new BuddyListAdapter(getActivity(), m_buddyList);
       mListView.setAdapter(m_blistAdapter);
       mListView.setDescendantFocusability(
       		ExpandableListView.FOCUS_AFTER_DESCENDANTS);
       mListView.setOnChildClickListener(this);
       
   //    mListView.getLoadingLayoutProxy().setPullLabel("下拉刷新");
   //    mListView.getLoadingLayoutProxy().setReleaseLabel("释放立即刷新");
   //    mListView.getLoadingLayoutProxy().setRefreshingLabel("正在刷新...");
   //    mListView.getLoadingLayoutProxy().setLastUpdatedLabel("");

       swipeRefreshLayout_freind.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
           @Override
           public void onRefresh() {
               new GetDataTask().execute();
               swipeRefreshLayout_freind.postDelayed(new Runnable() {
                   @Override
                   public void run() {
                       swipeRefreshLayout_freind.setRefreshing(false);
                       refresh();
                       // m_glistAdapter.notifyDataSetChanged();
                   }
               }, 1000);
           }
       });
}
 
开发者ID:wang4yu6peng13,项目名称:MaterialQQLite,代码行数:42,代码来源:ContactsFragment.java

示例15: initView

import com.baoyz.widget.PullRefreshLayout; //导入依赖的package包/类
private void initView() {
		m_QQClient = AppData.getAppData().getQQClient();
		m_msgList = m_QQClient.getMessageList();
		
	//	m_imgLight = (CheckBox)getActivity().findViewById(R.id.msg_imgLight);
	//	m_lvMsg = (PullToRefreshListView)getActivity().findViewById(R.id.msg_lvMsg);
        m_lvMsg = (ListView)getActivity().findViewById(R.id.msg_lvMsg);
        layout=(PullRefreshLayout) getActivity().findViewById(R.id.swipeRefreshLayout_msg);

	//	m_imgLight.setOnClickListener(this);
		
		layout.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {
				new GetDataTask().execute();
                layout.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        layout.setRefreshing(false);
                       refresh();
                    }
                }, 1000);
			}
		});


	//	m_lvMsg.getLoadingLayoutProxy().setPullLabel("下拉刷新");
	//	m_lvMsg.getLoadingLayoutProxy().setReleaseLabel("释放立即刷新");
	//	m_lvMsg.getLoadingLayoutProxy().setRefreshingLabel("正在刷新...");
	//	m_lvMsg.getLoadingLayoutProxy().setLastUpdatedLabel("");
		
//		m_searchBar = (LinearLayout)((LayoutInflater)getActivity().getSystemService(
//                Context.LAYOUT_INFLATER_SERVICE)).inflate(
//                R.layout.searchbar, null);
		//ListView actualListView = m_lvMsg.getRefreshableView();
//		actualListView.addHeaderView(m_searchBar);
		//m_lvMsg.getLoadingLayoutProxy().setLoadingDrawable(R.drawable.progressbar_anim);
		
//		ListView actualListView = m_lvMsg.getRefreshableView();
		
		m_faceList = AppData.getAppData().getFaceList();

		m_msgAdapter = new MsgAdapter(getActivity(), m_msgList, m_faceList);
		m_msgAdapter.setOnRightItemClickListener(new MsgAdapter.onRightItemClickListener() {
            @Override
            public void onRightItemClick(View v, int position) {
            	Toast.makeText(getActivity(), "删除第  " + (position+1)+" 对话记录",
            			Toast.LENGTH_SHORT).show();
            }
        });
        
		m_lvMsg.setAdapter(m_msgAdapter);
        m_lvMsg.setOnItemClickListener(this);
        
		MessageLogger msgLogger = m_QQClient.getMsgLogger();
		if (!msgLogger.isOpen()) {
			String strPath = m_QQClient.getMsgLogFullName(0);
			msgLogger.open(strPath);
		}
        refresh();
	}
 
开发者ID:wang4yu6peng13,项目名称:MaterialQQLite,代码行数:62,代码来源:MsgFragment.java


注:本文中的com.baoyz.widget.PullRefreshLayout类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。