开启相亲模式的房间房间榜增加月榜
This commit is contained in:
@@ -1468,11 +1468,8 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
if (getChildFragmentManager().findFragmentByTag("dialog_fragment_room_rank") != null) {
|
||||
return;
|
||||
}
|
||||
if (roomOwnner != null) {
|
||||
RoomRankDialogFragment roomRankDialogFragment = RoomRankDialogFragment.newInstance(roomOwnner.getUid());
|
||||
roomRankDialogFragment.show(getChildFragmentManager(), "dialog_fragment_room_rank");
|
||||
}
|
||||
|
||||
RoomRankDialogFragment roomRankDialogFragment = RoomRankDialogFragment.newInstance();
|
||||
roomRankDialogFragment.show(getChildFragmentManager(), "dialog_fragment_room_rank");
|
||||
break;
|
||||
case R.id.iv_treasure_box:
|
||||
case R.id.iv_treasure_box_cp:
|
||||
|
@@ -8,6 +8,7 @@ import com.yizhuan.erban.avroom.widget.RankNavigatorAdapter;
|
||||
import com.yizhuan.erban.base.BaseBindingFragment;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomContributeDataInfo;
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes;
|
||||
import com.yizhuan.erban.databinding.FragmentRoomCharmListBinding;
|
||||
@@ -27,18 +28,15 @@ public class RoomCharmListFragment extends BaseBindingFragment<FragmentRoomCharm
|
||||
ArrayList<Fragment> fragments = new ArrayList<>(2);
|
||||
fragments.add(RoomCharmRankingListFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING));
|
||||
fragments.add(RoomCharmRankingListFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_WEEK_RANKING));
|
||||
// fragments.add(RoomCharmRankingListFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_TOTAL_RANKING));
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
fragments.add(RoomCharmRankingListFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_MONTH_RANKING));
|
||||
}
|
||||
mBinding.vpCharmRankings.setAdapter(new RoomContributeListAdapter(getChildFragmentManager(), fragments));
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getActivity());
|
||||
commonNavigator.setAdjustMode(true);
|
||||
commonNavigator.setAdjustMode(false);
|
||||
|
||||
RankNavigatorAdapter indicator = new RankNavigatorAdapter();
|
||||
indicator.setOnItemSelectListener(new RankNavigatorAdapter.OnItemSelectListener() {
|
||||
@Override
|
||||
public void onItemSelect(int position) {
|
||||
mBinding.vpCharmRankings.setCurrentItem(position);
|
||||
}
|
||||
});
|
||||
indicator.setOnItemSelectListener(position -> mBinding.vpCharmRankings.setCurrentItem(position));
|
||||
commonNavigator.setAdapter(indicator);
|
||||
mBinding.viewIndicator.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(mBinding.viewIndicator, mBinding.vpCharmRankings);
|
||||
|
@@ -10,6 +10,7 @@ import com.yizhuan.erban.base.BaseMvpFragment;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomContributeDataInfo;
|
||||
import com.yizhuan.xchat_android_library.base.IMvpBaseView;
|
||||
|
||||
@@ -39,19 +40,14 @@ public class RoomContributeListFragment extends BaseMvpFragment implements IMvpB
|
||||
ArrayList<Fragment> fragments = new ArrayList<>(2);
|
||||
fragments.add(RoomContributeFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING));
|
||||
fragments.add(RoomContributeFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_WEEK_RANKING));
|
||||
// fragments.add(RoomContributeFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_TOTAL_RANKING));
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
fragments.add(RoomContributeFragment.newInstance(RoomContributeDataInfo.TYPE_ROOM_MONTH_RANKING));
|
||||
}
|
||||
viewPager.setAdapter(new RoomContributeListAdapter(getChildFragmentManager(), fragments));
|
||||
|
||||
CommonNavigator commonNavigator = new CommonNavigator(getActivity());
|
||||
commonNavigator.setAdjustMode(true);
|
||||
|
||||
commonNavigator.setAdjustMode(false);
|
||||
RankNavigatorAdapter indicator = new RankNavigatorAdapter();
|
||||
indicator.setOnItemSelectListener(new RankNavigatorAdapter.OnItemSelectListener() {
|
||||
@Override
|
||||
public void onItemSelect(int position) {
|
||||
viewPager.setCurrentItem(position);
|
||||
}
|
||||
});
|
||||
indicator.setOnItemSelectListener(position -> viewPager.setCurrentItem(position));
|
||||
commonNavigator.setAdapter(indicator);
|
||||
viewIndicator.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(viewIndicator, viewPager);
|
||||
|
@@ -25,24 +25,14 @@ public class RoomRankDialogFragment extends AppCompatDialogFragment implements I
|
||||
|
||||
private ViewPager mViewPager;
|
||||
|
||||
private long roomOwnerUid;// 房主Uid
|
||||
|
||||
public static RoomRankDialogFragment newInstance(long roomOwnerUid) {
|
||||
public static RoomRankDialogFragment newInstance() {
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("room_owner_uid", roomOwnerUid);
|
||||
RoomRankDialogFragment fragment = new RoomRankDialogFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (getArguments() != null) {
|
||||
roomOwnerUid = getArguments().getLong("room_owner_uid");
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
@@ -80,17 +70,10 @@ public class RoomRankDialogFragment extends AppCompatDialogFragment implements I
|
||||
if (getChildFragmentManager().getFragments() != null && getChildFragmentManager().getFragments().size() != 0) {
|
||||
fragmentList = getChildFragmentManager().getFragments();
|
||||
} else {
|
||||
//隐藏半小时榜
|
||||
// RoomRankHalfHourFragment halfHourFragment = RoomRankHalfHourFragment.newInstance(roomOwnerUid);
|
||||
// halfHourFragment.setDismissListener(this);
|
||||
// halfHourFragment.setChangePageListener(this);
|
||||
// fragmentList.add(halfHourFragment);
|
||||
|
||||
RoomRankListFragment roomInsideFragment = RoomRankListFragment.newInstance();
|
||||
roomInsideFragment.setDismissListener(this);
|
||||
roomInsideFragment.setChangePageListener(this);
|
||||
fragmentList.add(roomInsideFragment);
|
||||
|
||||
}
|
||||
mViewPager.setAdapter(new RoomRankFragmentPageAdapter(getChildFragmentManager(), fragmentList));
|
||||
mViewPager.setOffscreenPageLimit(fragmentList.size());
|
||||
|
@@ -1,359 +0,0 @@
|
||||
package com.yizhuan.erban.avroom.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.netease.nim.uikit.common.util.sys.NetworkUtil;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.UIHelper;
|
||||
import com.yizhuan.erban.avroom.adapter.RoomRankHalfHourListAdapter;
|
||||
import com.yizhuan.erban.avroom.presenter.RoomRankHalfHourPresenter;
|
||||
import com.yizhuan.erban.base.BaseMvpFragment;
|
||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomRankHalfHourMeInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomRankHalfHourRankInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomRankMultiItem;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
@CreatePresenter(RoomRankHalfHourPresenter.class)
|
||||
public class RoomRankHalfHourFragment extends BaseMvpFragment<IRoomRankHalfHourView, RoomRankHalfHourPresenter>
|
||||
implements IRoomRankHalfHourView, View.OnClickListener {
|
||||
|
||||
@BindView(R.id.tv_room_rank_half_hour_tab)
|
||||
TextView mHalfHourTab;
|
||||
@BindView(R.id.tv_room_rank_in_room_tab)
|
||||
TextView mInsideRoomTab;
|
||||
|
||||
@BindView(R.id.layout_room_rank_mine_info)
|
||||
LinearLayout mMineInfoLayout;
|
||||
@BindView(R.id.tv_room_rank_mine_ranking)
|
||||
TextView mMineRanking;
|
||||
@BindView(R.id.iv_number)
|
||||
ImageView ivNumber;
|
||||
@BindView(R.id.iv_room_rank_mine_avatar)
|
||||
CircleImageView mMineAvatar;
|
||||
|
||||
@BindView(R.id.tv_room_rank_mine_title)
|
||||
TextView mMineTitle;
|
||||
@BindView(R.id.tv_room_id)
|
||||
TextView tvRoomId;
|
||||
|
||||
@BindView(R.id.ll_number_one)
|
||||
LinearLayout llNumberOne;
|
||||
|
||||
@BindView(R.id.ll_to_last)
|
||||
LinearLayout llToLast;
|
||||
@BindView(R.id.tv_to_last)
|
||||
TextView tvToLast;
|
||||
@BindView(R.id.tv_label_to)
|
||||
TextView tvLabelTo;
|
||||
|
||||
@BindView(R.id.layout_room_rank_top_2)
|
||||
RelativeLayout mTop2Layout;
|
||||
@BindView(R.id.iv_room_rank_top_2_avatar_default)
|
||||
ImageView mTop2AvatarDF;// 无数据时才显示
|
||||
@BindView(R.id.iv_room_rank_top_2_avatar)
|
||||
CircleImageView mTop2Avatar;// 有数据时才显示
|
||||
@BindView(R.id.tv_number_two_id)
|
||||
TextView mTop2Id;
|
||||
@BindView(R.id.tv_two_to_last)
|
||||
TextView mTop2Value;
|
||||
@BindView(R.id.tv_label_number_two)
|
||||
TextView mTop2Name;
|
||||
|
||||
@BindView(R.id.layout_room_rank_top_1)
|
||||
RelativeLayout mTop1Layout;
|
||||
@BindView(R.id.iv_room_rank_top_1_avatar_default)
|
||||
ImageView mTop1AvatarDF;// 无数据时才显示
|
||||
@BindView(R.id.iv_room_rank_top_1_avatar)
|
||||
CircleImageView mTop1Avatar;// 有数据时才显示
|
||||
@BindView(R.id.tv_rank_half_one)
|
||||
TextView tvRankHalfOne;
|
||||
@BindView(R.id.tv_label_number_one)
|
||||
TextView mTop1Name;
|
||||
@BindView(R.id.tv_number_one_id)
|
||||
TextView mTop1Id;
|
||||
|
||||
@BindView(R.id.layout_room_rank_top_3)
|
||||
RelativeLayout mTop3Layout;
|
||||
@BindView(R.id.iv_room_rank_top_3_avatar_default)
|
||||
ImageView mTop3AvatarDF;// 无数据时才显示
|
||||
@BindView(R.id.iv_room_rank_top_3_avatar)
|
||||
CircleImageView mTop3Avatar;// 有数据时才显示
|
||||
@BindView(R.id.tv_number_three_id)
|
||||
TextView mTop3Id;
|
||||
@BindView(R.id.tv_three_to_last)
|
||||
TextView mTop3Value;
|
||||
@BindView(R.id.tv_label_number_three)
|
||||
TextView mTop3Name;
|
||||
|
||||
@BindView(R.id.recycler_room_rank_list)
|
||||
RecyclerView mRoomRankRecycler;
|
||||
@BindView(R.id.refresh_layout)
|
||||
SmartRefreshLayout mRefreshLayout;
|
||||
@BindView(R.id.nsv_rank_half)
|
||||
NestedScrollView nestedScrollView;
|
||||
|
||||
private RoomRankHalfHourListAdapter mAdapter;
|
||||
|
||||
private IRoomRankDialogDismissListener dismissListener;
|
||||
private IRoomRankDialogChangePageListener changePageListener;
|
||||
|
||||
private long roomOwnerUid;// 房主Uid
|
||||
|
||||
public static RoomRankHalfHourFragment newInstance(long roomOwnerUid) {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("room_owner_uid", roomOwnerUid);
|
||||
RoomRankHalfHourFragment fragment = new RoomRankHalfHourFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (getArguments() != null) {
|
||||
roomOwnerUid = getArguments().getLong("room_owner_uid");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return R.layout.fragment_room_rank_half_hour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
ButterKnife.bind(this, mView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
mHalfHourTab.setOnClickListener(this);
|
||||
mInsideRoomTab.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
// 列表
|
||||
mAdapter = new RoomRankHalfHourListAdapter(mContext);
|
||||
mRoomRankRecycler.setAdapter(mAdapter);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(mContext);
|
||||
layoutManager.setSmoothScrollbarEnabled(true);
|
||||
mRoomRankRecycler.setLayoutManager(layoutManager);
|
||||
mRoomRankRecycler.setHasFixedSize(true);
|
||||
mRoomRankRecycler.setNestedScrollingEnabled(false);
|
||||
mAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
RoomRankMultiItem roomRankMultiItem = mAdapter.getItem(position);
|
||||
if (roomRankMultiItem == null)
|
||||
return;
|
||||
|
||||
if (roomRankMultiItem.getItemType() == RoomRankMultiItem.TYPE_LINEAR) {
|
||||
RoomRankHalfHourRankInfo item = (RoomRankHalfHourRankInfo) roomRankMultiItem.getData();
|
||||
if (item != null && item.getUid() != 0) {
|
||||
goToUserInfoPage(item.getUid());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
// 加载数据
|
||||
mRefreshLayout.setEnableRefresh(true);
|
||||
mRefreshLayout.setOnRefreshListener(refreshlayout -> loadData());
|
||||
|
||||
mRefreshLayout.autoRefresh(100);
|
||||
mRefreshLayout.setEnableLoadmore(false);
|
||||
}
|
||||
|
||||
private void loadData() {
|
||||
if (!NetworkUtil.isNetAvailable(mContext)) {
|
||||
showNetworkErr();
|
||||
mRefreshLayout.finishRefresh();
|
||||
return;
|
||||
}
|
||||
showLoading();
|
||||
getMvpPresenter().getRankListInfo();
|
||||
}
|
||||
|
||||
private void goToUserInfoPage(long userId) {
|
||||
if (dismissListener != null) {
|
||||
dismissListener.onDismiss();
|
||||
}
|
||||
UIHelper.showUserInfoAct(mContext, userId);// 个人中心
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMeInfo(RoomRankHalfHourMeInfo info) {
|
||||
mRefreshLayout.finishRefresh();
|
||||
if (info == null) {
|
||||
mMineRanking.setVisibility(View.GONE);
|
||||
ivNumber.setVisibility(View.GONE);
|
||||
llNumberOne.setVisibility(View.GONE);
|
||||
llToLast.setVisibility(View.GONE);
|
||||
mMineTitle.setText("");
|
||||
tvRoomId.setText("");
|
||||
return;
|
||||
}
|
||||
mMineInfoLayout.setOnClickListener(view -> goToUserInfoPage(roomOwnerUid));
|
||||
// 头像
|
||||
ImageLoadUtils.loadAvatar(mContext, info.getAvatar(), mMineAvatar, true);
|
||||
// title
|
||||
mMineTitle.setText(info.getRoomTitle());
|
||||
tvRoomId.setText("ID:" + info.getErbanNo());
|
||||
tvToLast.setText(RoomRankDialogUtils.getRoomRankValueText(info.getTotalNum()));
|
||||
// value
|
||||
// 展示方式不同:排名 + 值
|
||||
if (info.getSeqNo() == 0) {// 未上榜
|
||||
llNumberOne.setVisibility(View.GONE);
|
||||
mMineRanking.setVisibility(View.VISIBLE);
|
||||
llToLast.setVisibility(View.VISIBLE);
|
||||
tvLabelTo.setText("");
|
||||
ivNumber.setVisibility(View.GONE);
|
||||
} else {
|
||||
int seqNo = info.getSeqNo();
|
||||
boolean isOne = seqNo == 1;
|
||||
llNumberOne.setVisibility(isOne ? View.VISIBLE : View.GONE);
|
||||
|
||||
if (seqNo >= 2 && seqNo <= 10)
|
||||
tvLabelTo.setText("距离上一名");
|
||||
else if (seqNo > 10 && seqNo <= 20)
|
||||
tvLabelTo.setText("距离上榜");
|
||||
else if (seqNo > 20)
|
||||
tvLabelTo.setText("");
|
||||
|
||||
llToLast.setVisibility(isOne ? View.GONE : View.VISIBLE);
|
||||
|
||||
int drawable = RoomRankDialogUtils.getNumberImage(seqNo);
|
||||
if (drawable != 0) {
|
||||
ivNumber.setVisibility(View.VISIBLE);
|
||||
mMineRanking.setVisibility(View.GONE);
|
||||
ivNumber.setImageResource(drawable);
|
||||
} else {
|
||||
ivNumber.setVisibility(View.GONE);
|
||||
mMineRanking.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showTop3Info(List<RoomRankHalfHourRankInfo> dataInfoList) {
|
||||
if (dataInfoList == null) {
|
||||
dataInfoList = new ArrayList<>();
|
||||
}
|
||||
for (int i = 0; i < dataInfoList.size(); i++) {
|
||||
RoomRankHalfHourRankInfo rankInfo = dataInfoList.get(i);
|
||||
if (rankInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (i == 0) {
|
||||
ImageLoadUtils.loadAvatar(mContext, rankInfo.getAvatar(), mTop1Avatar, true);// 头像
|
||||
mTop1Id.setText("ID:" + rankInfo.getErbanNo());
|
||||
mTop1Name.setText(rankInfo.getRoomTitle());
|
||||
mTop1AvatarDF.setImageResource(R.drawable.icon_consume_first);
|
||||
tvRankHalfOne.setVisibility(View.VISIBLE);
|
||||
mTop1Layout.setOnClickListener(view -> goToUserInfoPage(rankInfo.getUid()));
|
||||
}
|
||||
if (i == 1) {
|
||||
ImageLoadUtils.loadAvatar(mContext, rankInfo.getAvatar(), mTop2Avatar, true);// 头像
|
||||
mTop2Id.setText("ID:" + rankInfo.getErbanNo());
|
||||
mTop2Value.setText("距前一名 " + RoomRankDialogUtils.getRoomRankValueText(rankInfo.getTotalNum()));// 经验值
|
||||
mTop2Name.setText(rankInfo.getRoomTitle());
|
||||
mTop2AvatarDF.setImageResource(R.drawable.icon_consume_second);
|
||||
mTop2Layout.setOnClickListener(view -> goToUserInfoPage(rankInfo.getUid()));
|
||||
}
|
||||
if (i == 2) {
|
||||
ImageLoadUtils.loadAvatar(mContext, rankInfo.getAvatar(), mTop3Avatar, true);// 头像
|
||||
mTop3Id.setText("ID:" + rankInfo.getErbanNo());
|
||||
mTop3Value.setText("距前一名 " + RoomRankDialogUtils.getRoomRankValueText(rankInfo.getTotalNum()));// 经验值
|
||||
mTop3Name.setText(rankInfo.getRoomTitle());
|
||||
mTop3AvatarDF.setImageResource(R.drawable.icon_consume_third);
|
||||
mTop3Layout.setOnClickListener(view -> goToUserInfoPage(rankInfo.getUid()));
|
||||
}
|
||||
}
|
||||
switch (dataInfoList.size()) {
|
||||
case 0:
|
||||
mTop1AvatarDF.setImageResource(R.drawable.icon_consume_first_empty);
|
||||
mTop1Avatar.setVisibility(View.GONE);
|
||||
tvRankHalfOne.setVisibility(View.GONE);
|
||||
mTop1Id.setText("");
|
||||
|
||||
case 1:
|
||||
mTop2AvatarDF.setImageResource(R.drawable.icon_consume_second_empty);
|
||||
mTop2Avatar.setVisibility(View.GONE);
|
||||
mTop2Id.setText("");
|
||||
mTop2Value.setText("");
|
||||
|
||||
case 2:
|
||||
mTop3AvatarDF.setImageResource(R.drawable.icon_consume_third_empty);
|
||||
mTop3Avatar.setVisibility(View.GONE);
|
||||
mTop3Id.setText("");
|
||||
mTop3Value.setText("");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showRankListInfo(List<RoomRankMultiItem> dataList) {
|
||||
if (dataList == null) {
|
||||
dataList = new ArrayList<>();
|
||||
}
|
||||
mAdapter.replaceData(dataList);
|
||||
if (dataList.size() > 0) {
|
||||
mRoomRankRecycler.setVisibility(View.VISIBLE);
|
||||
nestedScrollView.scrollTo(0, 0);
|
||||
} else {
|
||||
mRoomRankRecycler.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadDataFailure() {
|
||||
mRefreshLayout.finishRefresh();
|
||||
showMeInfo(null/*, 0, ""*/);
|
||||
showTop3Info(null);
|
||||
showRankListInfo(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R.id.tv_room_rank_half_hour_tab) {// 半小时榜
|
||||
goToChangePage(0);
|
||||
} else if (id == R.id.tv_room_rank_in_room_tab) {// 房内榜
|
||||
goToChangePage(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改最外层Dialog的显示页面
|
||||
*/
|
||||
private void goToChangePage(int pos) {
|
||||
if (changePageListener != null) {
|
||||
changePageListener.onChangePage(pos);
|
||||
}
|
||||
}
|
||||
|
||||
public void setDismissListener(IRoomRankDialogDismissListener dismissListener) {
|
||||
this.dismissListener = dismissListener;
|
||||
}
|
||||
|
||||
public void setChangePageListener(IRoomRankDialogChangePageListener changePageListener) {
|
||||
this.changePageListener = changePageListener;
|
||||
}
|
||||
}
|
@@ -2,7 +2,9 @@ package com.yizhuan.erban.avroom.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
@@ -13,6 +15,7 @@ import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.C
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -29,7 +32,9 @@ public class RankNavigatorAdapter extends CommonNavigatorAdapter {
|
||||
public RankNavigatorAdapter() {
|
||||
mTitleList.add("日榜");
|
||||
mTitleList.add("周榜");
|
||||
// mTitleList.add("总榜");
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
mTitleList.add("月榜");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -16,7 +16,7 @@
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/view_indicator"
|
||||
android:background="@color/transparent"
|
||||
android:layout_width="100dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
@@ -12,7 +12,7 @@
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/view_indicator"
|
||||
android:background="@color/transparent"
|
||||
android:layout_width="100dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
@@ -1,405 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_room_rank"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_room_rank_top_purple_1"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingRight="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_rank_half_hour_tab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableBottom="@drawable/shape_room_rank_tab_tag_selected"
|
||||
android:drawablePadding="6dp"
|
||||
android:text="@string/room_rank_half_hour"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_rank_in_room_tab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="26dp"
|
||||
android:drawableBottom="@drawable/shape_room_rank_tab_tag_normal"
|
||||
android:drawablePadding="6dp"
|
||||
android:text="@string/room_rank_in_room"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_room_rank_mine_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="21dp"
|
||||
android:background="@drawable/shape_room_rank_room_owner_info"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="36dp"
|
||||
android:layout_marginEnd="9dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_rank_mine_ranking"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_ADADAD"
|
||||
android:textSize="12dp"
|
||||
android:text="未上榜"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
tools:src="@drawable/ic_rank_1"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_room_rank_mine_avatar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
tools:src="@mipmap/app_logo"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_rank_mine_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxEms="9"
|
||||
android:maxLines="1"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14dp"
|
||||
tools:text="谁的房间谁的房间谁的房间谁的房间谁的房间谁的房间" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="12dp"
|
||||
tools:text="ID:123456"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_number_one"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="12dp"
|
||||
android:text="当前"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FF5353"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textSize="16sp"
|
||||
android:text="NO.1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_to_last"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="right"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_to_last"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FF5353"
|
||||
android:textSize="16sp"
|
||||
tools:text="NO.1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_label_to"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="12dp"
|
||||
tools:text="距离"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/nsv_rank_half"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="192dp"
|
||||
android:background="@drawable/bg_room_rank_top_purple_2"
|
||||
android:orientation="vertical"
|
||||
app:layout_scrollFlags="scroll">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="111"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_room_rank_top_2"
|
||||
android:layout_width="100dp"
|
||||
android:layout_marginTop="36dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_room_rank_top_2_avatar"
|
||||
android:layout_width="59dp"
|
||||
android:layout_height="59dp"
|
||||
android:layout_marginTop="17dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
tools:src="@mipmap/app_logo"
|
||||
android:visibility="visible"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_room_rank_top_2_avatar_default"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_centerHorizontal="true"
|
||||
tools:src="@drawable/icon_consume_second_empty"
|
||||
android:layout_width="71dp"
|
||||
android:layout_height="83dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_label_number_two"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@id/iv_room_rank_top_2_avatar_default"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14dp"
|
||||
android:ellipsize="end"
|
||||
android:maxEms="4"
|
||||
android:maxLines="1"
|
||||
android:layout_marginTop="11dp"
|
||||
tools:text="昵昵称昵称称昵称"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_number_two_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@id/tv_label_number_two"
|
||||
android:textColor="@color/color_66FFFFFF"
|
||||
android:textSize="10dp"
|
||||
tools:text="ID:1234"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_two_to_last"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@id/tv_number_two_id"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp"
|
||||
tools:text="ID:1234"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_room_rank_top_1"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerHorizontal="true" >
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_room_rank_top_1_avatar"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="73dp"
|
||||
tools:src="@mipmap/app_logo"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_19"
|
||||
android:visibility="visible"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_room_rank_top_1_avatar_default"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_centerHorizontal="true"
|
||||
tools:src="@drawable/icon_consume_first_empty"
|
||||
android:layout_width="87dp"
|
||||
android:layout_height="99dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_label_number_one"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@id/iv_room_rank_top_1_avatar_default"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:ellipsize="end"
|
||||
android:maxEms="4"
|
||||
android:maxLines="1"
|
||||
tools:text="昵昵称昵称昵称称"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_number_one_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@id/tv_label_number_one"
|
||||
android:textColor="@color/color_66FFFFFF"
|
||||
android:textSize="10dp"
|
||||
tools:text="ID:1234"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_rank_half_one"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@id/tv_number_one_id"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp"
|
||||
android:text="NO.1"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_room_rank_top_3"
|
||||
android:layout_marginTop="36dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_room_rank_top_3_avatar"
|
||||
android:layout_width="59dp"
|
||||
android:layout_height="59dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
tools:src="@mipmap/app_logo"
|
||||
android:visibility="visible"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_room_rank_top_3_avatar_default"
|
||||
android:scaleType="fitCenter"
|
||||
tools:src="@drawable/icon_consume_third_empty"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="71dp"
|
||||
android:layout_height="83dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_label_number_three"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@id/iv_room_rank_top_3_avatar_default"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:ellipsize="end"
|
||||
android:maxEms="4"
|
||||
android:maxLines="1"
|
||||
tools:text="第三名"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_number_three_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@id/tv_label_number_three"
|
||||
android:textColor="@color/color_66FFFFFF"
|
||||
android:textSize="10dp"
|
||||
tools:text="ID:1234"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_three_to_last"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_below="@id/tv_number_three_id"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp"
|
||||
tools:text="ID:1234"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:id="@+id/recycler_room_rank_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
@@ -13,6 +13,7 @@ public class RoomContributeDataInfo implements Parcelable {
|
||||
|
||||
public static final String TYPE_ROOM_TOTAL_RANKING = "total";
|
||||
public static final String TYPE_ROOM_WEEK_RANKING = "week";
|
||||
public static final String TYPE_ROOM_MONTH_RANKING = "month";
|
||||
public static final String TYPE_ROOM_DAY_RANKING = "day";
|
||||
|
||||
private RoomContributeRoomInfo room;
|
||||
|
Reference in New Issue
Block a user