榜单点击头像跳转个人主页
This commit is contained in:
@@ -35,7 +35,7 @@ public class RadishRankingFragment extends BaseMvpFragment<IRadishRankingView, R
|
||||
|
||||
public static RadishRankingFragment newInstance(int datetype) {
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("datetype",datetype);
|
||||
args.putInt("datetype", datetype);
|
||||
RadishRankingFragment fragment = new RadishRankingFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
@@ -65,7 +65,7 @@ public class RadishRankingFragment extends BaseMvpFragment<IRadishRankingView, R
|
||||
public void onSetListener() {
|
||||
swipeRefresh.setOnRefreshListener(() -> {
|
||||
mAdapter.setEnableLoadMore(true);
|
||||
loadData(true,datetype);
|
||||
loadData(true, datetype);
|
||||
});
|
||||
|
||||
|
||||
@@ -74,15 +74,15 @@ public class RadishRankingFragment extends BaseMvpFragment<IRadishRankingView, R
|
||||
@Override
|
||||
public void initiate() {
|
||||
initRecyclerView();
|
||||
loadData(true,datetype);
|
||||
loadData(true, datetype);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 刷新数据
|
||||
*/
|
||||
private void loadData(boolean isRefresh,int datetype) {
|
||||
getMvpPresenter().loadData(isRefresh,datetype);
|
||||
private void loadData(boolean isRefresh, int datetype) {
|
||||
getMvpPresenter().loadData(isRefresh, datetype);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,7 +130,7 @@ public class RadishRankingFragment extends BaseMvpFragment<IRadishRankingView, R
|
||||
|
||||
@Override
|
||||
public void getBoxRankingLoadMoreSuccess(BoxRankingInfo rankingInfo) {
|
||||
if (ListUtils.isListEmpty(rankingInfo.getRankVos())){
|
||||
if (ListUtils.isListEmpty(rankingInfo.getRankVos())) {
|
||||
mAdapter.loadMoreEnd();
|
||||
return;
|
||||
}
|
||||
@@ -150,12 +150,12 @@ public class RadishRankingFragment extends BaseMvpFragment<IRadishRankingView, R
|
||||
@Override
|
||||
public void onReloadData() {
|
||||
super.onReloadData();
|
||||
loadData(true,datetype);
|
||||
loadData(true, datetype);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreRequested() {
|
||||
loadData(false,datetype);
|
||||
loadData(false, datetype);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -166,6 +166,6 @@ public class RadishRankingFragment extends BaseMvpFragment<IRadishRankingView, R
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onRefreshRanking(RefreshBoxRankingEvent event) {
|
||||
loadData(true,datetype);
|
||||
loadData(true, datetype);
|
||||
}
|
||||
}
|
||||
|
@@ -56,5 +56,6 @@ public class BoxRankingListAdapter extends BaseQuickAdapter<BoxRankingInfo.RankV
|
||||
tvPosition.setText(baseViewHolder.getLayoutPosition() + 1 + "");
|
||||
break;
|
||||
}
|
||||
baseViewHolder.addOnClickListener(R.id.iv_avatar);
|
||||
}
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ import com.yizhuan.erban.base.BaseMvpFragment;
|
||||
import com.yizhuan.erban.treasure_box.adapter.BoxRankingListAdapter;
|
||||
import com.yizhuan.erban.treasure_box.module.IBoxRankingView;
|
||||
import com.yizhuan.erban.treasure_box.presenter.BoxRankingPresenter;
|
||||
import com.yizhuan.erban.ui.user.UserInfoActivity;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.HorizontalDecoration;
|
||||
import com.yizhuan.xchat_android_core.room.treasure_box.bean.BoxRankingInfo;
|
||||
@@ -39,7 +40,7 @@ public class BoxRankingFragment extends BaseMvpFragment<IBoxRankingView, BoxRank
|
||||
|
||||
public static BoxRankingFragment newInstance(int datetype) {
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("datetype",datetype);
|
||||
args.putInt("datetype", datetype);
|
||||
BoxRankingFragment fragment = new BoxRankingFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
@@ -69,7 +70,7 @@ public class BoxRankingFragment extends BaseMvpFragment<IBoxRankingView, BoxRank
|
||||
public void onSetListener() {
|
||||
swipeRefresh.setOnRefreshListener(() -> {
|
||||
mAdapter.setEnableLoadMore(true);
|
||||
loadData(true,datetype);
|
||||
loadData(true, datetype);
|
||||
});
|
||||
|
||||
|
||||
@@ -78,15 +79,15 @@ public class BoxRankingFragment extends BaseMvpFragment<IBoxRankingView, BoxRank
|
||||
@Override
|
||||
public void initiate() {
|
||||
initRecyclerView();
|
||||
loadData(true,datetype);
|
||||
loadData(true, datetype);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 刷新数据
|
||||
*/
|
||||
private void loadData(boolean isRefresh,int datetype) {
|
||||
getMvpPresenter().loadData(isRefresh,datetype);
|
||||
private void loadData(boolean isRefresh, int datetype) {
|
||||
getMvpPresenter().loadData(isRefresh, datetype);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -100,6 +101,7 @@ public class BoxRankingFragment extends BaseMvpFragment<IBoxRankingView, BoxRank
|
||||
recyclerView.addItemDecoration(new HorizontalDecoration(UIUtil.dip2px(mContext, 8), false, false));
|
||||
mAdapter = new BoxRankingListAdapter(mContext);
|
||||
mAdapter.setOnLoadMoreListener(this, recyclerView);
|
||||
mAdapter.setOnItemChildClickListener((adapter, view, position) -> UserInfoActivity.Companion.start(mContext, mAdapter.getData().get(position).getUid()));
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
||||
recyclerView.setLayoutManager(linearLayoutManager);
|
||||
recyclerView.setAdapter(mAdapter);
|
||||
@@ -135,7 +137,7 @@ public class BoxRankingFragment extends BaseMvpFragment<IBoxRankingView, BoxRank
|
||||
|
||||
@Override
|
||||
public void getBoxRankingLoadMoreSuccess(BoxRankingInfo rankingInfo) {
|
||||
if (ListUtils.isListEmpty(rankingInfo.getRankVos())){
|
||||
if (ListUtils.isListEmpty(rankingInfo.getRankVos())) {
|
||||
mAdapter.loadMoreEnd();
|
||||
return;
|
||||
}
|
||||
@@ -155,12 +157,12 @@ public class BoxRankingFragment extends BaseMvpFragment<IBoxRankingView, BoxRank
|
||||
@Override
|
||||
public void onReloadData() {
|
||||
super.onReloadData();
|
||||
loadData(true,datetype);
|
||||
loadData(true, datetype);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreRequested() {
|
||||
loadData(false,datetype);
|
||||
loadData(false, datetype);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -171,6 +173,6 @@ public class BoxRankingFragment extends BaseMvpFragment<IBoxRankingView, BoxRank
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onRefreshRanking(RefreshBoxRankingEvent event) {
|
||||
loadData(true,datetype);
|
||||
loadData(true, datetype);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user