@Override public void onRefreshEnd() { onRefreshEndNoOP(); if (mAdapter.getCount() == 0) { mBaseView.showEmptyView(); } else { mBaseView.hideEmptyView(); } }
/** * 初始化刷新相关的view跟事件</br> * * @param rootView */ protected void initRefreshView(View rootView) { int refreshResId = ResFinder.getId("umeng_comm_topic_refersh"); mRefreshLvLayout = (RefreshLvLayout) rootView.findViewById(refreshResId); // 推荐用户页面无加载更多跟下拉刷新 if (fromRecommedTopic) { mRefreshLvLayout.setOnRefreshListener( new OnRefreshListener() { @Override public void onRefresh() { mPresenter.loadDataFromServer(); } }); mRefreshLvLayout.setOnLoadListener( new OnLoadListener() { @Override public void onLoad() { mPresenter.loadMoreData(); } }); } int listViewResId = ResFinder.getId("umeng_comm_topic_listview"); mTopicListView = mRefreshLvLayout.findRefreshViewById(listViewResId); initAdapter(); if (!mSaveButtonVisiable) { // 目前推荐话题不需要刷新跟加载更多,因此暂时设置不可用 // mRefreshLvLayout.setEnabled(false); } else { mRefreshLvLayout.setDefaultFooterView(); } mBaseView = (BaseView) rootView.findViewById(ResFinder.getId("umeng_comm_baseview")); mBaseView.setEmptyViewText(ResFinder.getString("umeng_comm_no_recommend_topic")); }
@Override public void onRefreshEndNoOP() { mRefreshLvLayout.setRefreshing(false); mRefreshLvLayout.setLoading(false); mBaseView.hideEmptyView(); }