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


Java PullRefreshLayout.setOnRefreshListener方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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.setOnRefreshListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。