组队开黑和热门房间增加banner
This commit is contained in:
@@ -224,7 +224,7 @@ public class MyDecorationActivity extends BaseBindingActivity<ActivityMyDecorati
|
|||||||
});
|
});
|
||||||
|
|
||||||
BannerAdapter bannerAdapter = new BannerAdapter(bannerList, context);
|
BannerAdapter bannerAdapter = new BannerAdapter(bannerList, context);
|
||||||
bannerAdapter.setRoundingRadius(ScreenUtil.dip2px(12));
|
bannerAdapter.setRoundingRadius(ScreenUtil.dip2px(8));
|
||||||
mBinding.rollView.setAdapter(bannerAdapter);
|
mBinding.rollView.setAdapter(bannerAdapter);
|
||||||
mBinding.rollView.setPlayDelay(3000);
|
mBinding.rollView.setPlayDelay(3000);
|
||||||
//设置透明度
|
//设置透明度
|
||||||
|
@@ -4,33 +4,36 @@ import androidx.lifecycle.LiveData
|
|||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import com.yizhuan.erban.base.BaseViewModel
|
import com.yizhuan.erban.base.BaseViewModel
|
||||||
import com.yizhuan.xchat_android_core.bean.response.ListResult
|
import com.yizhuan.xchat_android_core.bean.response.ListResult
|
||||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
import com.yizhuan.xchat_android_core.home.bean.*
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeConcernsInfo
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeTagInfo
|
|
||||||
import com.yizhuan.xchat_android_core.home.model.HomeModel
|
import com.yizhuan.xchat_android_core.home.model.HomeModel
|
||||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.async
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
|
|
||||||
class HomeViewModel : BaseViewModel() {
|
class HomeViewModel : BaseViewModel() {
|
||||||
|
|
||||||
private val _bannerLiveData = MutableLiveData<List<BannerInfo>>()
|
private val _bannerLiveData = MutableLiveData<List<BannerInfo>>()
|
||||||
val bannerLiveData: LiveData<List<BannerInfo>> = _bannerLiveData
|
val bannerLiveData: LiveData<List<BannerInfo>> = _bannerLiveData
|
||||||
|
|
||||||
private val _hotRoomLiveData = MutableLiveData<ListResult<HomeRoom>>()
|
private val _hotRoomLiveData = MutableLiveData<ListResult<HomeRoomInfo>>()
|
||||||
val hotRoomLiveData: LiveData<ListResult<HomeRoom>> = _hotRoomLiveData
|
val hotRoomLiveData: LiveData<ListResult<HomeRoomInfo>> = _hotRoomLiveData
|
||||||
|
|
||||||
private val _concernsLiveData = MutableLiveData<List<HomeConcernsInfo>>()
|
private val _concernsLiveData = MutableLiveData<List<HomeConcernsInfo>>()
|
||||||
val concernsLiveData: LiveData<List<HomeConcernsInfo>> = _concernsLiveData
|
val concernsLiveData: LiveData<List<HomeConcernsInfo>> = _concernsLiveData
|
||||||
|
|
||||||
private val _collectLiveData = MutableLiveData<ListResult<HomeRoom>>()
|
private val _collectLiveData = MutableLiveData<ListResult<CollectionRoomInfo.FansRoomListBean>>()
|
||||||
val collectLiveData: LiveData<ListResult<HomeRoom>> = _collectLiveData
|
val collectLiveData: LiveData<ListResult<CollectionRoomInfo.FansRoomListBean>> = _collectLiveData
|
||||||
|
|
||||||
|
|
||||||
private val _tagLiveData = MutableLiveData<List<HomeTagInfo>>()
|
private val _tagLiveData = MutableLiveData<List<HomeTagInfo>>()
|
||||||
val tagLiveData: LiveData<List<HomeTagInfo>> = _tagLiveData
|
val tagLiveData: LiveData<List<HomeTagInfo>> = _tagLiveData
|
||||||
|
|
||||||
private val _commonRoomLiveData = MutableLiveData<ListResult<HomeRoom>>()
|
private val _commonRoomLiveData = MutableLiveData<ListResult<HomeRoomInfo>>()
|
||||||
val commonRoomLiveData: LiveData<ListResult<HomeRoom>> = _commonRoomLiveData
|
val commonRoomLiveData: LiveData<ListResult<HomeRoomInfo>> = _commonRoomLiveData
|
||||||
|
|
||||||
|
private val _emptyLiveData = MutableLiveData<Boolean>()
|
||||||
|
val emptyLiveData: LiveData<Boolean> = _emptyLiveData
|
||||||
|
|
||||||
fun getBannerInfo() {
|
fun getBannerInfo() {
|
||||||
safeLaunch {
|
safeLaunch {
|
||||||
@@ -50,39 +53,48 @@ class HomeViewModel : BaseViewModel() {
|
|||||||
_hotRoomLiveData.value = ListResult.failed(pageNum)
|
_hotRoomLiveData.value = ListResult.failed(pageNum)
|
||||||
},
|
},
|
||||||
block = {
|
block = {
|
||||||
val result = HomeModel.getHotRoom(pageNum, pageSize)
|
val result = HomeModel.getHotRoom()
|
||||||
_hotRoomLiveData.value = ListResult.success(result, pageNum)
|
_hotRoomLiveData.value = ListResult.success(result, pageNum)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getCommonRoom(tabId: Int,pageNum: Int, pageSize: Int) {
|
fun getCommonRoom(tabId: Int, pageNum: Int, pageSize: Int) {
|
||||||
safeLaunch(
|
safeLaunch(
|
||||||
onError = {
|
onError = {
|
||||||
_commonRoomLiveData.value = ListResult.failed(pageNum)
|
_commonRoomLiveData.value = ListResult.failed(pageNum)
|
||||||
},
|
},
|
||||||
block = {
|
block = {
|
||||||
val result = HomeModel.getCommonRoom(tabId,pageNum, pageSize)
|
val result = HomeModel.getCommonRoom(tabId, pageNum, pageSize)
|
||||||
_commonRoomLiveData.value = ListResult.success(result, pageNum)
|
_commonRoomLiveData.value = ListResult.success(result, pageNum)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getConcernsRoom() {
|
|
||||||
safeLaunch {
|
|
||||||
_concernsLiveData.value = HomeModel.getConcernsRoom()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
fun getCollectRoom(pageNum: Int, pageSize: Int) {
|
fun getCollectRoom(pageNum: Int, pageSize: Int) {
|
||||||
safeLaunch(
|
safeLaunch(
|
||||||
onError = {
|
onError = {
|
||||||
_collectLiveData.value = ListResult.failed(pageNum)
|
_collectLiveData.value = ListResult.failed(pageNum)
|
||||||
|
_emptyLiveData.value = true
|
||||||
},
|
},
|
||||||
block = {
|
block = {
|
||||||
val result = HomeModel.getCollectRoom(pageNum,pageSize)
|
if (pageNum == 1) {
|
||||||
_collectLiveData.value = ListResult.success(result, pageNum)
|
val concernsRooms = async(Dispatchers.IO) {
|
||||||
|
HomeModel.getConcernsRoom()
|
||||||
|
}
|
||||||
|
val collectRooms = async(Dispatchers.IO) {
|
||||||
|
HomeModel.getCollectRoom(pageNum, pageSize)
|
||||||
|
}
|
||||||
|
_concernsLiveData.value = concernsRooms.await()
|
||||||
|
_collectLiveData.value = ListResult.success(collectRooms.await()?.fansRoomList, pageNum)
|
||||||
|
_emptyLiveData.value = concernsRooms.await().isNullOrEmpty() &&
|
||||||
|
collectRooms.await()?.fansRoomList.isNullOrEmpty()
|
||||||
|
} else {
|
||||||
|
val result = HomeModel.getCollectRoom(pageNum, pageSize)
|
||||||
|
_collectLiveData.value = ListResult.success(result?.fansRoomList, pageNum)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@@ -56,12 +56,11 @@ public class BannerAdapter extends StaticPagerAdapter {
|
|||||||
BannerInfo bannerInfo = bannerInfoList.get(position);
|
BannerInfo bannerInfo = bannerInfoList.get(position);
|
||||||
ImageView imgBanner = (ImageView) mInflater.inflate(R.layout.banner_page_item, container, false);
|
ImageView imgBanner = (ImageView) mInflater.inflate(R.layout.banner_page_item, container, false);
|
||||||
if (bannerInfo == null) return imgBanner;
|
if (bannerInfo == null) return imgBanner;
|
||||||
if (roundingRadius == -1) {
|
ImageLoadUtils.loadRectImage(context,
|
||||||
ImageLoadUtils.loadGameBannerRoundBackground(context, bannerInfo.getBannerPic(), imgBanner);
|
bannerInfo.getBannerPic(),
|
||||||
} else {
|
imgBanner,
|
||||||
ImageLoadUtils.loadBannerRoundBackground(context, bannerInfo.getBannerPic(), imgBanner, roundingRadius);
|
R.drawable.default_banner,
|
||||||
}
|
roundingRadius);
|
||||||
imgBanner.setScaleType(ImageView.ScaleType.FIT_XY);
|
|
||||||
imgBanner.setOnClickListener(v -> {
|
imgBanner.setOnClickListener(v -> {
|
||||||
CommonJumpHelper.bannerJump(context, bannerInfo);
|
CommonJumpHelper.bannerJump(context, bannerInfo);
|
||||||
if (mOnItemClickListener != null) {
|
if (mOnItemClickListener != null) {
|
||||||
|
@@ -1,79 +0,0 @@
|
|||||||
package com.yizhuan.erban.home.adapter;
|
|
||||||
|
|
||||||
|
|
||||||
import android.widget.ImageView;
|
|
||||||
|
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
||||||
import com.chad.library.adapter.base.BaseViewHolder;
|
|
||||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
|
||||||
import com.yizhuan.erban.R;
|
|
||||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
|
||||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2;
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomePlayInfo;
|
|
||||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
|
||||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
|
||||||
import com.yizhuan.xchat_android_core.utils.TextUtils;
|
|
||||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* create by lvzebiao @2019/11/13
|
|
||||||
*/
|
|
||||||
public class HomeAddFriendsAdapter extends BaseQuickAdapter<HomePlayInfo, BaseViewHolder> {
|
|
||||||
|
|
||||||
|
|
||||||
public HomeAddFriendsAdapter() {
|
|
||||||
super(R.layout.item_home_add_friends);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void convert(@NotNull BaseViewHolder helper, HomePlayInfo item) {
|
|
||||||
if (item == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//tag
|
|
||||||
helper.setVisible(R.id.iv_tag, !TextUtils.isEmptyText(item.getTagPict()));
|
|
||||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_tag), item.getTagPict());
|
|
||||||
|
|
||||||
helper.setText(R.id.tv_online_num, item.getOnlineNum() + "")
|
|
||||||
.setText(R.id.tv_title, item.getTitle().replaceAll("\n", ""));
|
|
||||||
|
|
||||||
if (!ListUtils.isListEmpty(item.getMicUsers()) && item.getMicUsers().size() < 5) {
|
|
||||||
for (int i = 0; i < 5 - item.getMicUserCount(); i++) {
|
|
||||||
HomePlayInfo.MicUsersBean micUsersBean = new HomePlayInfo.MicUsersBean();
|
|
||||||
micUsersBean.setAvatar("");
|
|
||||||
item.getMicUsers().add(micUsersBean);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
loadAvatar(helper.getView(R.id.iv_room_avatar), item.getAvatar());
|
|
||||||
|
|
||||||
CircleImageView userOne = helper.getView(R.id.iv_mic_user_one);
|
|
||||||
CircleImageView userTwo = helper.getView(R.id.iv_mic_user_two);
|
|
||||||
CircleImageView userThree = helper.getView(R.id.iv_mic_user_three);
|
|
||||||
CircleImageView userFour = helper.getView(R.id.iv_mic_user_four);
|
|
||||||
CircleImageView userFive = helper.getView(R.id.iv_mic_user_five);
|
|
||||||
|
|
||||||
loadAvatar(userOne, item.getMicUsers().get(0).getAvatar());
|
|
||||||
loadAvatar(userTwo, item.getMicUsers().get(1).getAvatar());
|
|
||||||
loadAvatar(userThree, item.getMicUsers().get(2).getAvatar());
|
|
||||||
loadAvatar(userFour, item.getMicUsers().get(3).getAvatar());
|
|
||||||
loadAvatar(userFive, item.getMicUsers().get(4).getAvatar());
|
|
||||||
helper.getView(R.id.root_view).setOnClickListener(v -> {
|
|
||||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HOME_INTO_JYKL_ROOM_CLICK, "点击交友扩列项进入房间");
|
|
||||||
AVRoomActivity.startForFromType(mContext, item.getUid(), AVRoomActivity.FROM_TYPE_RECOMMEND);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadAvatar(ImageView imageView, String url) {
|
|
||||||
GlideApp.with(mContext)
|
|
||||||
.load(url)
|
|
||||||
.placeholder(R.drawable.ic_home_play_empty)
|
|
||||||
.error(R.drawable.ic_home_play_empty)
|
|
||||||
.into(imageView);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,126 +0,0 @@
|
|||||||
package com.yizhuan.erban.home.adapter;
|
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
||||||
import com.chad.library.adapter.base.BaseViewHolder;
|
|
||||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
|
||||||
import com.yizhuan.erban.R;
|
|
||||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
|
||||||
import com.yizhuan.erban.community.dynamic.view.DynamicDetailActivity;
|
|
||||||
import com.yizhuan.erban.community.widget.DynamicNickDetailWidget;
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeDynamicInfo;
|
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2;
|
|
||||||
import com.yizhuan.xchat_android_core.community.dynamic.DynamicModel;
|
|
||||||
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver;
|
|
||||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
|
||||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* create by lvzebiao @2019/11/13
|
|
||||||
*/
|
|
||||||
public class HomeDynamicAdapter extends BaseQuickAdapter<HomeDynamicInfo, BaseViewHolder> {
|
|
||||||
|
|
||||||
|
|
||||||
private Context context;
|
|
||||||
public HomeDynamicAdapter(Context context) {
|
|
||||||
super(R.layout.item_home_dynamic);
|
|
||||||
this.context = context;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void convert(BaseViewHolder helper, HomeDynamicInfo item) {
|
|
||||||
if (item == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//头像
|
|
||||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_avatar), item.getAvatar());
|
|
||||||
helper.setText(R.id.expandable_text,item.getContent());
|
|
||||||
helper.setText(R.id.tv_like,item.getLikeCount()+"");
|
|
||||||
helper.setVisible(R.id.iv_in_room, item.getInRoomUid() != null);
|
|
||||||
//设置用户信息
|
|
||||||
DynamicNickDetailWidget widget = helper.getView(R.id.widget_nick_detail);
|
|
||||||
widget.setData(item);
|
|
||||||
//点赞
|
|
||||||
setLikeCount(helper, item.getLikeCount(), item.isLiked(), false);
|
|
||||||
LinearLayout llLike = helper.getView(R.id.ll_like);
|
|
||||||
llLike.setEnabled(true);
|
|
||||||
llLike.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
llLike.setEnabled(false);
|
|
||||||
int status = item.isLiked() ? 0 : 1;
|
|
||||||
DynamicModel.get().like(item.getWorldId(), item.getDynamicId(), item.getUid(), status, 4)
|
|
||||||
.compose(RxHelper.bindContext(context))
|
|
||||||
.subscribe(new DontWarnObserver<String>() {
|
|
||||||
@Override
|
|
||||||
public void accept(String s, String error) {
|
|
||||||
super.accept(s, error);
|
|
||||||
llLike.setEnabled(true);
|
|
||||||
if (error != null) {
|
|
||||||
SingleToastUtil.showToast(error);
|
|
||||||
} else {
|
|
||||||
LogUtil.print("调用点赞接口完成...");
|
|
||||||
if (status == 1) {
|
|
||||||
item.setLikeCount(item.getLikeCount() + 1);
|
|
||||||
} else {
|
|
||||||
item.setLikeCount(item.getLikeCount() - 1);
|
|
||||||
}
|
|
||||||
item.setLiked(status == 1);
|
|
||||||
setLikeCount(helper, item.getLikeCount(), item.isLiked(), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
View.OnClickListener toDetailListener = v ->
|
|
||||||
DynamicDetailActivity.start(context, item.getDynamicId(), item.getWorldId(),
|
|
||||||
helper.getAdapterPosition(), false, 6);
|
|
||||||
|
|
||||||
//跳转去详情
|
|
||||||
helper.itemView.setOnClickListener(toDetailListener);
|
|
||||||
|
|
||||||
ImageView ivInRoom = helper.getView(R.id.iv_in_room);
|
|
||||||
|
|
||||||
View.OnClickListener toRoomListener = v ->
|
|
||||||
AVRoomActivity.start(mContext,item.getInRoomUid());
|
|
||||||
ivInRoom.setOnClickListener(toRoomListener);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setLikeCount(BaseViewHolder helper, int likeCount, boolean isLike, boolean isAnim) {
|
|
||||||
TextView tvLike = helper.getView(R.id.tv_like);
|
|
||||||
String likeCountStr;
|
|
||||||
if (likeCount < 0) {
|
|
||||||
likeCountStr = "0";
|
|
||||||
} else if (likeCount >= 1000) {
|
|
||||||
likeCountStr = "999+";
|
|
||||||
} else {
|
|
||||||
likeCountStr = String.valueOf(likeCount);
|
|
||||||
}
|
|
||||||
tvLike.setText(likeCountStr);
|
|
||||||
|
|
||||||
ImageView ivLikeAnim = helper.getView(R.id.iv_like_pic);
|
|
||||||
if (isLike) {
|
|
||||||
// if (isAnim) {
|
|
||||||
// AnimationDrawable drawable = (AnimationDrawable) context.getResources()
|
|
||||||
// .getDrawable(R.drawable.anim_list_dy_like);
|
|
||||||
// ivLikeAnim.setImageDrawable(drawable);
|
|
||||||
// drawable.stop();
|
|
||||||
// drawable.start();
|
|
||||||
// } else {
|
|
||||||
ivLikeAnim.setImageResource(R.drawable.icon_dy_list_like);
|
|
||||||
// }
|
|
||||||
} else {
|
|
||||||
ivLikeAnim.setImageResource(R.drawable.icon_dy_list_like_false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -2,35 +2,48 @@ package com.yizhuan.erban.home.adapter
|
|||||||
|
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.core.view.isGone
|
import androidx.core.view.isGone
|
||||||
|
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
import com.chad.library.adapter.base.BaseViewHolder
|
import com.chad.library.adapter.base.BaseViewHolder
|
||||||
import com.yizhuan.erban.R
|
import com.yizhuan.erban.R
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomePlayInfo
|
import com.yizhuan.erban.home.helper.BannerHelper
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||||
import com.yizhuan.erban.ui.utils.load
|
import com.yizhuan.erban.ui.utils.load
|
||||||
|
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create by lvzebiao @2019/11/13
|
* create by lvzebiao @2019/11/13
|
||||||
*/
|
*/
|
||||||
class HomePlayAdapter : BaseQuickAdapter<HomePlayInfo, BaseViewHolder>(R.layout.item_home_play) {
|
class HomePlayAdapter : BaseMultiItemQuickAdapter<HomeRoomInfo, BaseViewHolder>(null) {
|
||||||
override fun convert(helper: BaseViewHolder, item: HomePlayInfo) {
|
|
||||||
helper.setText(R.id.tv_room_title, item.title)
|
init {
|
||||||
helper.setVisible(R.id.iv_room_tag, !TextUtils.isEmptyText(item.tagPict))
|
addItemType(HomeRoomInfo.TYPE_ROOM, R.layout.item_room_hot)
|
||||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_room_tag), item.tagPict)
|
addItemType(HomeRoomInfo.TYPE_BANNER, R.layout.item_room_banner)
|
||||||
ImageLoadUtilsV2.loadAvatar(helper.getView(R.id.iv_room_image), item.avatar)
|
}
|
||||||
helper.setText(R.id.tv_online_number, "${item.onlineNum}")
|
|
||||||
val avatars: Array<ImageView> = arrayOf(
|
override fun convert(helper: BaseViewHolder, item: HomeRoomInfo) {
|
||||||
helper.getView(R.id.iv_avatar_0),
|
if (item.itemType == HomeRoomInfo.TYPE_ROOM) {
|
||||||
helper.getView(R.id.iv_avatar_1),
|
helper.setText(R.id.tv_room_title, item.title)
|
||||||
helper.getView(R.id.iv_avatar_2),
|
helper.setVisible(R.id.iv_room_tag, !TextUtils.isEmptyText(item.tagPict))
|
||||||
helper.getView(R.id.iv_avatar_3),
|
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_room_tag), item.tagPict)
|
||||||
helper.getView(R.id.iv_avatar_4)
|
ImageLoadUtilsV2.loadAvatar(helper.getView(R.id.iv_room_image), item.avatar)
|
||||||
)
|
helper.setText(R.id.tv_online_number, "${item.onlineNum}")
|
||||||
for (i in avatars.indices) {
|
val avatars: Array<ImageView> = arrayOf(
|
||||||
val avatarUrl = item.micUsers?.getOrNull(i)?.avatar
|
helper.getView(R.id.iv_avatar_0),
|
||||||
avatars[i].isGone = avatarUrl.isNullOrBlank()
|
helper.getView(R.id.iv_avatar_1),
|
||||||
avatars[i].load(avatarUrl)
|
helper.getView(R.id.iv_avatar_2),
|
||||||
|
helper.getView(R.id.iv_avatar_3),
|
||||||
|
helper.getView(R.id.iv_avatar_4)
|
||||||
|
)
|
||||||
|
for (i in avatars.indices) {
|
||||||
|
val avatarUrl = item.micUsers?.getOrNull(i)?.avatar
|
||||||
|
avatars[i].isGone = avatarUrl.isNullOrBlank()
|
||||||
|
avatars[i].load(avatarUrl)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
BannerHelper.setBanner(helper.getView(R.id.roll_view), item.bannerVoList)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -8,14 +8,14 @@ import com.yizhuan.erban.R
|
|||||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||||
import com.yizhuan.erban.ui.utils.load
|
import com.yizhuan.erban.ui.utils.load
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom
|
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||||
|
|
||||||
|
|
||||||
class RoomCommonAdapter : BaseQuickAdapter<HomeRoom, BaseViewHolder>(R.layout.item_room_common) {
|
class RoomCommonAdapter : BaseQuickAdapter<HomeRoomInfo, BaseViewHolder>(R.layout.item_room_common) {
|
||||||
|
|
||||||
|
|
||||||
override fun convert(helper: BaseViewHolder, item: HomeRoom) {
|
override fun convert(helper: BaseViewHolder, item: HomeRoomInfo) {
|
||||||
helper.apply {
|
helper.apply {
|
||||||
getView<ImageView>(R.id.iv_room_image).load(item.avatar)
|
getView<ImageView>(R.id.iv_room_image).load(item.avatar)
|
||||||
setText(R.id.tv_online_number, "${item.onlineNum}")
|
setText(R.id.tv_online_number, "${item.onlineNum}")
|
||||||
|
@@ -7,19 +7,18 @@ import com.yizhuan.erban.R
|
|||||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||||
import com.yizhuan.erban.ui.utils.load
|
import com.yizhuan.erban.ui.utils.load
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom
|
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||||
|
|
||||||
|
|
||||||
class RoomGameAdapter : BaseQuickAdapter<HomeRoom, BaseViewHolder>(R.layout.item_room_common) {
|
class RoomGameAdapter : BaseQuickAdapter<HomeRoomInfo, BaseViewHolder>(R.layout.item_room_game) {
|
||||||
|
|
||||||
|
|
||||||
override fun convert(helper: BaseViewHolder, item: HomeRoom) {
|
override fun convert(helper: BaseViewHolder, item: HomeRoomInfo) {
|
||||||
helper.apply {
|
helper.apply {
|
||||||
getView<ImageView>(R.id.iv_room_image).load(item.avatar)
|
getView<ImageView>(R.id.iv_room_image).load(item.avatar)
|
||||||
setText(R.id.tv_online_number, "${item.onlineNum}人热聊中")
|
setText(R.id.tv_online_number, "${item.onlineNum}人热聊中")
|
||||||
setText(R.id.tv_room_title, item.title)
|
setText(R.id.tv_room_title, item.title)
|
||||||
setText(R.id.tv_room_tag, item.roomTag)
|
|
||||||
itemView.setOnClickListener {
|
itemView.setOnClickListener {
|
||||||
AVRoomActivity.start(mContext, item.uid)
|
AVRoomActivity.start(mContext, item.uid)
|
||||||
}
|
}
|
||||||
|
@@ -2,46 +2,55 @@ package com.yizhuan.erban.home.adapter
|
|||||||
|
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.core.view.isGone
|
import androidx.core.view.isGone
|
||||||
import androidx.core.view.isVisible
|
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
|
||||||
import com.chad.library.adapter.base.BaseViewHolder
|
import com.chad.library.adapter.base.BaseViewHolder
|
||||||
import com.yizhuan.erban.R
|
import com.yizhuan.erban.R
|
||||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
||||||
|
import com.yizhuan.erban.home.helper.BannerHelper
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||||
import com.yizhuan.erban.ui.utils.load
|
import com.yizhuan.erban.ui.utils.load
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom
|
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||||
|
|
||||||
|
|
||||||
class RoomHotAdapter : BaseQuickAdapter<HomeRoom, BaseViewHolder>(R.layout.item_room_hot) {
|
class RoomHotAdapter : BaseMultiItemQuickAdapter<HomeRoomInfo, BaseViewHolder>(null) {
|
||||||
|
|
||||||
|
init {
|
||||||
|
addItemType(HomeRoomInfo.TYPE_ROOM, R.layout.item_room_hot)
|
||||||
|
addItemType(HomeRoomInfo.TYPE_BANNER, R.layout.item_room_banner)
|
||||||
|
}
|
||||||
|
|
||||||
override fun convert(helper: BaseViewHolder, item: HomeRoom) {
|
override fun convert(helper: BaseViewHolder, item: HomeRoomInfo) {
|
||||||
helper.apply {
|
if (item.itemType == HomeRoomInfo.TYPE_ROOM) {
|
||||||
getView<ImageView>(R.id.iv_room_image).load(item.avatar)
|
helper.apply {
|
||||||
setText(R.id.tv_online_number, "${item.onlineNum}")
|
getView<ImageView>(R.id.iv_room_image).load(item.avatar)
|
||||||
setText(R.id.tv_room_title, item.title)
|
setText(R.id.tv_online_number, "${item.onlineNum}")
|
||||||
itemView.setOnClickListener {
|
setText(R.id.tv_room_title, item.title)
|
||||||
AVRoomActivity.start(mContext, item.uid)
|
itemView.setOnClickListener {
|
||||||
|
AVRoomActivity.start(mContext, item.uid)
|
||||||
|
}
|
||||||
|
setText(R.id.tv_id, "ID:${item.erbanNo}")
|
||||||
}
|
}
|
||||||
setText(R.id.tv_id, "ID:${item.erbanNo}")
|
|
||||||
|
helper.setVisible(R.id.iv_room_tag, !TextUtils.isEmptyText(item.tagPict))
|
||||||
|
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_room_tag), item.tagPict)
|
||||||
|
helper.setVisible(R.id.tv_in_pk, item.isCrossPking)
|
||||||
|
val avatars: Array<ImageView> = arrayOf(
|
||||||
|
helper.getView(R.id.iv_avatar_0),
|
||||||
|
helper.getView(R.id.iv_avatar_1),
|
||||||
|
helper.getView(R.id.iv_avatar_2),
|
||||||
|
helper.getView(R.id.iv_avatar_3),
|
||||||
|
helper.getView(R.id.iv_avatar_4)
|
||||||
|
)
|
||||||
|
for (i in avatars.indices) {
|
||||||
|
val avatarUrl = item.micUsers?.getOrNull(i)?.avatar
|
||||||
|
avatars[i].isGone = avatarUrl.isNullOrBlank()
|
||||||
|
avatars[i].load(avatarUrl)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
BannerHelper.setBanner(helper.getView(R.id.roll_view),item.bannerVoList)
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.setVisible(R.id.iv_room_tag, !TextUtils.isEmptyText(item.tagPict))
|
|
||||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_room_tag), item.tagPict)
|
|
||||||
helper.setVisible(R.id.tv_in_pk, item.isCrossPking)
|
|
||||||
val avatars: Array<ImageView> = arrayOf(
|
|
||||||
helper.getView(R.id.iv_avatar_0),
|
|
||||||
helper.getView(R.id.iv_avatar_1),
|
|
||||||
helper.getView(R.id.iv_avatar_2),
|
|
||||||
helper.getView(R.id.iv_avatar_3),
|
|
||||||
helper.getView(R.id.iv_avatar_4)
|
|
||||||
)
|
|
||||||
for (i in avatars.indices) {
|
|
||||||
val avatarUrl = item.micUsers?.getOrNull(i)?.avatar
|
|
||||||
avatars[i].isGone = avatarUrl.isNullOrBlank()
|
|
||||||
avatars[i].load(avatarUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,20 +8,20 @@ import com.yizhuan.erban.R
|
|||||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||||
import com.yizhuan.erban.ui.utils.load
|
import com.yizhuan.erban.ui.utils.load
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom
|
import com.yizhuan.xchat_android_core.home.bean.CollectionRoomInfo
|
||||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||||
|
|
||||||
|
|
||||||
class RoomLikeAdapter : BaseQuickAdapter<HomeRoom, BaseViewHolder>(R.layout.item_room_like) {
|
class RoomLikeAdapter : BaseQuickAdapter<CollectionRoomInfo.FansRoomListBean, BaseViewHolder>(R.layout.item_room_like) {
|
||||||
|
|
||||||
|
|
||||||
override fun convert(helper: BaseViewHolder, item: HomeRoom) {
|
override fun convert(helper: BaseViewHolder, item: CollectionRoomInfo.FansRoomListBean) {
|
||||||
helper.apply {
|
helper.apply {
|
||||||
getView<ImageView>(R.id.iv_room_image).load(item.avatar)
|
getView<ImageView>(R.id.iv_room_image).load(item.roomAvatar)
|
||||||
setText(R.id.tv_online_number, "${item.onlineNum}")
|
setText(R.id.tv_online_number, "${item.roomOnlineNum}")
|
||||||
setText(R.id.tv_room_title, item.title)
|
setText(R.id.tv_room_title, item.roomName)
|
||||||
itemView.setOnClickListener {
|
itemView.setOnClickListener {
|
||||||
AVRoomActivity.start(mContext, item.uid)
|
AVRoomActivity.start(mContext, item.roomUid)
|
||||||
}
|
}
|
||||||
setText(R.id.tv_id, "ID:${item.erbanNo}")
|
setText(R.id.tv_id, "ID:${item.erbanNo}")
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,6 @@ package com.yizhuan.erban.home.fragment;
|
|||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
@@ -13,7 +12,7 @@ import com.yizhuan.erban.base.BaseFragment;
|
|||||||
import com.yizhuan.erban.common.EmptyViewHelper;
|
import com.yizhuan.erban.common.EmptyViewHelper;
|
||||||
import com.yizhuan.erban.home.adapter.HomePlayAdapter;
|
import com.yizhuan.erban.home.adapter.HomePlayAdapter;
|
||||||
import com.yizhuan.erban.ui.utils.RVDelegate;
|
import com.yizhuan.erban.ui.utils.RVDelegate;
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomePlayInfo;
|
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo;
|
||||||
import com.yizhuan.xchat_android_core.home.event.RefreshHomeDataEvent;
|
import com.yizhuan.xchat_android_core.home.event.RefreshHomeDataEvent;
|
||||||
import com.yizhuan.xchat_android_core.home.model.GameHomeModel;
|
import com.yizhuan.xchat_android_core.home.model.GameHomeModel;
|
||||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||||
@@ -32,7 +31,7 @@ public class HomePlayFragment extends BaseFragment {
|
|||||||
private RecyclerView recyclerView;
|
private RecyclerView recyclerView;
|
||||||
|
|
||||||
private HomePlayAdapter playAdapter;
|
private HomePlayAdapter playAdapter;
|
||||||
private RVDelegate<HomePlayInfo> rvDelegate;
|
private RVDelegate<HomeRoomInfo> rvDelegate;
|
||||||
|
|
||||||
public static HomePlayFragment newInstance() {
|
public static HomePlayFragment newInstance() {
|
||||||
HomePlayFragment fragment = new HomePlayFragment();
|
HomePlayFragment fragment = new HomePlayFragment();
|
||||||
@@ -52,15 +51,14 @@ public class HomePlayFragment extends BaseFragment {
|
|||||||
recyclerView = mView.findViewById(R.id.recycler_view);
|
recyclerView = mView.findViewById(R.id.recycler_view);
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
playAdapter = new HomePlayAdapter();
|
playAdapter = new HomePlayAdapter();
|
||||||
rvDelegate = new RVDelegate.Builder<HomePlayInfo>()
|
rvDelegate = new RVDelegate.Builder<HomeRoomInfo>()
|
||||||
.setAdapter(playAdapter)
|
.setAdapter(playAdapter)
|
||||||
.setLayoutManager(new LinearLayoutManager(mContext))
|
.setLayoutManager(new LinearLayoutManager(mContext))
|
||||||
.setRecyclerView(recyclerView)
|
.setRecyclerView(recyclerView)
|
||||||
.setEmptyView(EmptyViewHelper.createEmptyView(getContext(), "暂无数据"))
|
.setEmptyView(EmptyViewHelper.createEmptyView(getContext(), "暂无数据"))
|
||||||
.build();
|
.build();
|
||||||
loadData(true);
|
|
||||||
playAdapter.setOnItemClickListener((adapter, view, position) -> {
|
playAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||||
HomePlayInfo homePlayInfo = playAdapter.getItem(position);
|
HomeRoomInfo homePlayInfo = playAdapter.getItem(position);
|
||||||
if (homePlayInfo != null) {
|
if (homePlayInfo != null) {
|
||||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HOME_INTO_LTJY_ROOM_CLICK, "点击聊天交友项进入房间");
|
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HOME_INTO_LTJY_ROOM_CLICK, "点击聊天交友项进入房间");
|
||||||
AVRoomActivity.startForFromType(mContext, homePlayInfo.getUid(), AVRoomActivity.FROM_TYPE_RECOMMEND);
|
AVRoomActivity.startForFromType(mContext, homePlayInfo.getUid(), AVRoomActivity.FROM_TYPE_RECOMMEND);
|
||||||
@@ -69,6 +67,12 @@ public class HomePlayFragment extends BaseFragment {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
loadData(true);
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
private void loadData(boolean refresh) {
|
private void loadData(boolean refresh) {
|
||||||
GameHomeModel.get().getHomePlayV2()
|
GameHomeModel.get().getHomePlayV2()
|
||||||
|
@@ -1,46 +0,0 @@
|
|||||||
package com.yizhuan.erban.home.fragment;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
|
|
||||||
import com.yizhuan.erban.base.BaseFragment;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 在View初始化完毕后每次isVisibleToUser = true都会重新请求数据
|
|
||||||
*/
|
|
||||||
|
|
||||||
public abstract class LazyLoadFragment extends BaseFragment {
|
|
||||||
private boolean isViewCreated; // 界面是否已创建完成
|
|
||||||
private boolean isVisibleToUser; // 是否对用户可见
|
|
||||||
private boolean isDataLoaded; // 数据是否已请求
|
|
||||||
|
|
||||||
// 实现具体的数据请求逻辑
|
|
||||||
protected abstract void loadData();
|
|
||||||
|
|
||||||
//如果不需要每次刷新则重写此方法返回false
|
|
||||||
protected boolean hasNeedRefreshData() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
|
||||||
super.setUserVisibleHint(isVisibleToUser);
|
|
||||||
this.isVisibleToUser = isVisibleToUser;
|
|
||||||
tryLoadData();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
|
||||||
super.onActivityCreated(savedInstanceState);
|
|
||||||
isViewCreated = true;
|
|
||||||
if (!isDataLoaded) tryLoadData();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void tryLoadData() {
|
|
||||||
if (isViewCreated && isVisibleToUser && (!isDataLoaded || hasNeedRefreshData())) {
|
|
||||||
isDataLoaded = true;
|
|
||||||
loadData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -58,7 +58,6 @@ class PartyFragment : BaseFragment(), PartyMagicIndicatorAdapter.OnItemSelectLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun initiate() {
|
override fun initiate() {
|
||||||
homeViewModel.getTagInfo()
|
|
||||||
homeViewModel.tagLiveData.observe(this) {
|
homeViewModel.tagLiveData.observe(this) {
|
||||||
it?.let {
|
it?.let {
|
||||||
onGetHomeTagSuccess(it)
|
onGetHomeTagSuccess(it)
|
||||||
@@ -66,6 +65,11 @@ class PartyFragment : BaseFragment(), PartyMagicIndicatorAdapter.OnItemSelectLis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
homeViewModel.getTagInfo()
|
||||||
|
}
|
||||||
|
|
||||||
private fun onGetHomeTagSuccess(info: List<HomeTagInfo>) {
|
private fun onGetHomeTagSuccess(info: List<HomeTagInfo>) {
|
||||||
var changed = false
|
var changed = false
|
||||||
val oldTabInfoList: List<CharSequence> = ArrayList<CharSequence>(mTabInfoList)
|
val oldTabInfoList: List<CharSequence> = ArrayList<CharSequence>(mTabInfoList)
|
||||||
@@ -127,11 +131,6 @@ class PartyFragment : BaseFragment(), PartyMagicIndicatorAdapter.OnItemSelectLis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户信息更新
|
|
||||||
*
|
|
||||||
* @param event
|
|
||||||
*/
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
fun onRefreshHomeDataEvent(event: RefreshHomeDataEvent?) {
|
fun onRefreshHomeDataEvent(event: RefreshHomeDataEvent?) {
|
||||||
|
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
package com.yizhuan.erban.home.fragment
|
package com.yizhuan.erban.home.fragment
|
||||||
|
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.drawable.Drawable
|
|
||||||
import android.graphics.drawable.GradientDrawable
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
@@ -10,27 +8,20 @@ import android.widget.TextView
|
|||||||
import androidx.databinding.DataBindingUtil
|
import androidx.databinding.DataBindingUtil
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
|
||||||
import com.scwang.smartrefresh.layout.internal.ProgressDrawable
|
import com.scwang.smartrefresh.layout.internal.ProgressDrawable
|
||||||
import com.yizhuan.erban.R
|
import com.yizhuan.erban.R
|
||||||
import com.yizhuan.erban.avroom.adapter.RoomVPAdapter
|
import com.yizhuan.erban.avroom.adapter.RoomVPAdapter
|
||||||
import com.yizhuan.erban.base.BaseFragment
|
import com.yizhuan.erban.base.BaseFragment
|
||||||
import com.yizhuan.erban.databinding.FragmentRecommendBinding
|
import com.yizhuan.erban.databinding.FragmentRecommendBinding
|
||||||
import com.yizhuan.erban.home.HomeViewModel
|
import com.yizhuan.erban.home.HomeViewModel
|
||||||
import com.yizhuan.erban.home.adapter.BannerAdapter
|
|
||||||
import com.yizhuan.erban.home.adapter.MainMagicIndicatorAdapter
|
import com.yizhuan.erban.home.adapter.MainMagicIndicatorAdapter
|
||||||
|
import com.yizhuan.erban.home.helper.BannerHelper
|
||||||
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper
|
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper
|
||||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||||
import com.yizhuan.erban.ui.widget.rollviewpager.Util
|
|
||||||
import com.yizhuan.erban.ui.widget.rollviewpager.hintview.ColorPointHintView
|
|
||||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
|
||||||
import com.yizhuan.xchat_android_core.home.event.RefreshHomeDataEvent
|
import com.yizhuan.xchat_android_core.home.event.RefreshHomeDataEvent
|
||||||
|
import com.yizhuan.xchat_android_core.initial.InitialModel
|
||||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager
|
import com.yizhuan.xchat_android_core.statistic.StatisticManager
|
||||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol
|
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol
|
||||||
import com.yizhuan.xchat_android_core.user.event.LoadLoginUserInfoEvent
|
|
||||||
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent
|
|
||||||
import com.yizhuan.xchat_android_library.utils.ListUtils
|
|
||||||
import org.greenrobot.eventbus.EventBus
|
import org.greenrobot.eventbus.EventBus
|
||||||
import org.greenrobot.eventbus.Subscribe
|
import org.greenrobot.eventbus.Subscribe
|
||||||
import org.greenrobot.eventbus.ThreadMode
|
import org.greenrobot.eventbus.ThreadMode
|
||||||
@@ -43,8 +34,6 @@ class RecommendFragment : BaseFragment(), View.OnClickListener,
|
|||||||
MainMagicIndicatorAdapter.OnItemSelectListener {
|
MainMagicIndicatorAdapter.OnItemSelectListener {
|
||||||
private lateinit var mBinding: FragmentRecommendBinding
|
private lateinit var mBinding: FragmentRecommendBinding
|
||||||
private var mFragmentsBottom: MutableList<Fragment> = ArrayList()
|
private var mFragmentsBottom: MutableList<Fragment> = ArrayList()
|
||||||
private lateinit var bannerAdapter: BannerAdapter
|
|
||||||
private var isLoaded = false
|
|
||||||
|
|
||||||
private val homeViewModel: HomeViewModel by activityViewModels()
|
private val homeViewModel: HomeViewModel by activityViewModels()
|
||||||
|
|
||||||
@@ -86,9 +75,6 @@ class RecommendFragment : BaseFragment(), View.OnClickListener,
|
|||||||
override fun initiate() {
|
override fun initiate() {
|
||||||
initRefreshView()
|
initRefreshView()
|
||||||
initTitleTab()
|
initTitleTab()
|
||||||
if (AuthModel.get().currentUid != 0L) {
|
|
||||||
tryLoadData(false)
|
|
||||||
}
|
|
||||||
childFragmentManager
|
childFragmentManager
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.replace(R.id.fg_recommend_room, HomeTabHomeFragment.newInstance(0))
|
.replace(R.id.fg_recommend_room, HomeTabHomeFragment.newInstance(0))
|
||||||
@@ -96,14 +82,10 @@ class RecommendFragment : BaseFragment(), View.OnClickListener,
|
|||||||
|
|
||||||
homeViewModel.getBannerInfo()
|
homeViewModel.getBannerInfo()
|
||||||
homeViewModel.bannerLiveData.observe(this) {
|
homeViewModel.bannerLiveData.observe(this) {
|
||||||
setBanner(it)
|
BannerHelper.setBanner(mBinding.rollView, it)
|
||||||
}
|
}
|
||||||
}
|
mBinding.tvMore.setOnClickListener {
|
||||||
|
(parentFragment as HomeFragment).onItemSelect(1, null)
|
||||||
//尝试加载不需要登录就可以加载的数据
|
|
||||||
private fun tryLoadData(refresh: Boolean) {
|
|
||||||
if (!isLoaded || refresh) {
|
|
||||||
isLoaded = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,16 +104,23 @@ class RecommendFragment : BaseFragment(), View.OnClickListener,
|
|||||||
mBinding.refreshHeader.progressView.setImageDrawable(progressDrawable)
|
mBinding.refreshHeader.progressView.setImageDrawable(progressDrawable)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
fun onRefreshHomeDataEvent(event: RefreshHomeDataEvent?) {
|
||||||
|
homeViewModel.getBannerInfo()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化动态和聊天交友tab
|
* 初始化动态和聊天交友tab
|
||||||
*/
|
*/
|
||||||
private fun initTitleTab() {
|
private fun initTitleTab() {
|
||||||
val tagList: MutableList<String> = ArrayList()
|
val tagList = InitialModel.get().cacheInitInfo?.homeTabList.let {
|
||||||
tagList.add("组队开黑")
|
if (it?.size == 2) it else arrayListOf("组队开黑", "热门房间")
|
||||||
tagList.add("热门房间")
|
}
|
||||||
mFragmentsBottom.add(HomePlayFragment.newInstance())
|
mFragmentsBottom.add(HomePlayFragment.newInstance())
|
||||||
mFragmentsBottom.add(RoomHotFragment.newInstance())
|
mFragmentsBottom.add(RoomHotFragment.newInstance())
|
||||||
|
if (tagList[0] != "组队开黑") {
|
||||||
|
mFragmentsBottom.reverse()
|
||||||
|
}
|
||||||
val commonNavigator = CommonNavigator(context)
|
val commonNavigator = CommonNavigator(context)
|
||||||
commonNavigator.setTitleWrapContent(true)
|
commonNavigator.setTitleWrapContent(true)
|
||||||
val magicIndicatorAdapter = MainMagicIndicatorAdapter(context, tagList)
|
val magicIndicatorAdapter = MainMagicIndicatorAdapter(context, tagList)
|
||||||
@@ -146,82 +135,6 @@ class RecommendFragment : BaseFragment(), View.OnClickListener,
|
|||||||
ViewPagerHelper.bind(mBinding.magicIndicator, mBinding.viewPager)
|
ViewPagerHelper.bind(mBinding.magicIndicator, mBinding.viewPager)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户信息更新
|
|
||||||
*
|
|
||||||
* @param event
|
|
||||||
*/
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
||||||
fun loadLoginUserInfoEvent(event: LoginUserInfoUpdateEvent?) {
|
|
||||||
refreshData()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户信息更新
|
|
||||||
*
|
|
||||||
* @param event
|
|
||||||
*/
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
||||||
fun loadLoginUserInfoEvent(event: LoadLoginUserInfoEvent?) {
|
|
||||||
refreshData()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun refreshData() {
|
|
||||||
tryLoadData(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setBanner(bannerList: List<BannerInfo>) {
|
|
||||||
if (ListUtils.isListEmpty(bannerList)) {
|
|
||||||
mBinding.rollView.visibility = View.GONE
|
|
||||||
return
|
|
||||||
}
|
|
||||||
mBinding.rollView.visibility = View.VISIBLE
|
|
||||||
if (!this::bannerAdapter.isInitialized) {
|
|
||||||
mBinding.rollView.setHintView(object : ColorPointHintView(
|
|
||||||
mContext, Color.WHITE, mContext.resources.getColor(
|
|
||||||
R.color.color_66FFFFFF
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun makeFocusDrawable(): Drawable {
|
|
||||||
val dotFocus = GradientDrawable()
|
|
||||||
dotFocus.setColor(Color.WHITE)
|
|
||||||
dotFocus.cornerRadius = Util.dip2px(
|
|
||||||
context, 2f
|
|
||||||
).toFloat()
|
|
||||||
dotFocus.setSize(
|
|
||||||
Util.dip2px(context, 9f), Util.dip2px(
|
|
||||||
context, 4f
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return dotFocus
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun makeNormalDrawable(): Drawable {
|
|
||||||
val dotNormal = GradientDrawable()
|
|
||||||
dotNormal.setColor(mContext.resources.getColor(R.color.color_66FFFFFF))
|
|
||||||
dotNormal.cornerRadius = Util.dip2px(
|
|
||||||
context, 2f
|
|
||||||
).toFloat()
|
|
||||||
dotNormal.setSize(
|
|
||||||
Util.dip2px(context, 4f), Util.dip2px(
|
|
||||||
context, 4f
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return dotNormal
|
|
||||||
}
|
|
||||||
})
|
|
||||||
bannerAdapter = BannerAdapter(bannerList, mContext)
|
|
||||||
bannerAdapter.setRoundingRadius(ScreenUtil.dip2px(12f))
|
|
||||||
bannerAdapter.setHomeGame(true)
|
|
||||||
mBinding.rollView.setAdapter(bannerAdapter)
|
|
||||||
mBinding.rollView.setPlayDelay(3000)
|
|
||||||
//设置透明度
|
|
||||||
mBinding.rollView.setAnimationDurtion(500)
|
|
||||||
}
|
|
||||||
bannerAdapter.setBannerInfoList(bannerList)
|
|
||||||
bannerAdapter.notifyDataSetChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onItemSelect(position: Int, view: TextView?) {
|
override fun onItemSelect(position: Int, view: TextView?) {
|
||||||
if (mFragmentsBottom.isEmpty()) {
|
if (mFragmentsBottom.isEmpty()) {
|
||||||
return
|
return
|
||||||
|
@@ -11,8 +11,7 @@ import com.yizhuan.erban.databinding.FragmentRoomCommonBinding
|
|||||||
import com.yizhuan.erban.home.HomeViewModel
|
import com.yizhuan.erban.home.HomeViewModel
|
||||||
import com.yizhuan.erban.home.adapter.RoomCommonAdapter
|
import com.yizhuan.erban.home.adapter.RoomCommonAdapter
|
||||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom
|
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||||
|
|
||||||
|
|
||||||
class RoomCommonFragment : BaseViewBindingFragment<FragmentRoomCommonBinding>() {
|
class RoomCommonFragment : BaseViewBindingFragment<FragmentRoomCommonBinding>() {
|
||||||
|
|
||||||
@@ -31,12 +30,12 @@ class RoomCommonFragment : BaseViewBindingFragment<FragmentRoomCommonBinding>()
|
|||||||
private val pageSize = 20
|
private val pageSize = 20
|
||||||
|
|
||||||
private val mAdapter = RoomCommonAdapter()
|
private val mAdapter = RoomCommonAdapter()
|
||||||
private lateinit var rvDelegate: RVDelegate<HomeRoom>
|
private lateinit var rvDelegate: RVDelegate<HomeRoomInfo>
|
||||||
|
|
||||||
private val homeViewModel: HomeViewModel by viewModels()
|
private val homeViewModel: HomeViewModel by viewModels()
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
rvDelegate = RVDelegate.Builder<HomeRoom>()
|
rvDelegate = RVDelegate.Builder<HomeRoomInfo>()
|
||||||
.setAdapter(mAdapter)
|
.setAdapter(mAdapter)
|
||||||
.setLayoutManager(LinearLayoutManager(mContext))
|
.setLayoutManager(LinearLayoutManager(mContext))
|
||||||
.setPageSize(20)
|
.setPageSize(20)
|
||||||
@@ -56,6 +55,11 @@ class RoomCommonFragment : BaseViewBindingFragment<FragmentRoomCommonBinding>()
|
|||||||
homeViewModel.commonRoomLiveData.observe(this) {
|
homeViewModel.commonRoomLiveData.observe(this) {
|
||||||
rvDelegate.loadData(it)
|
rvDelegate.loadData(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
loadData(true)
|
loadData(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,9 +7,9 @@ import com.yizhuan.erban.base.BaseViewBindingFragment
|
|||||||
import com.yizhuan.erban.common.EmptyViewHelper
|
import com.yizhuan.erban.common.EmptyViewHelper
|
||||||
import com.yizhuan.erban.databinding.FragmentRoomGameBinding
|
import com.yizhuan.erban.databinding.FragmentRoomGameBinding
|
||||||
import com.yizhuan.erban.home.HomeViewModel
|
import com.yizhuan.erban.home.HomeViewModel
|
||||||
import com.yizhuan.erban.home.adapter.RoomHotAdapter
|
import com.yizhuan.erban.home.adapter.RoomGameAdapter
|
||||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom
|
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||||
|
|
||||||
|
|
||||||
class RoomGameFragment : BaseViewBindingFragment<FragmentRoomGameBinding>() {
|
class RoomGameFragment : BaseViewBindingFragment<FragmentRoomGameBinding>() {
|
||||||
@@ -23,14 +23,14 @@ class RoomGameFragment : BaseViewBindingFragment<FragmentRoomGameBinding>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val roomHotAdapter = RoomHotAdapter()
|
private val roomHotAdapter = RoomGameAdapter()
|
||||||
private var page = 1
|
private var page = 1
|
||||||
private lateinit var rvDelegate: RVDelegate<HomeRoom>
|
private lateinit var rvDelegate: RVDelegate<HomeRoomInfo>
|
||||||
private val pageSize = 20
|
private val pageSize = 20
|
||||||
private val homeViewModel: HomeViewModel by activityViewModels()
|
private val homeViewModel: HomeViewModel by activityViewModels()
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
rvDelegate = RVDelegate.Builder<HomeRoom>()
|
rvDelegate = RVDelegate.Builder<HomeRoomInfo>()
|
||||||
.setAdapter(roomHotAdapter)
|
.setAdapter(roomHotAdapter)
|
||||||
.setRecyclerView(binding.recyclerView)
|
.setRecyclerView(binding.recyclerView)
|
||||||
.setEmptyView(EmptyViewHelper.createEmptyView(context, "暂无房间"))
|
.setEmptyView(EmptyViewHelper.createEmptyView(context, "暂无房间"))
|
||||||
|
@@ -9,7 +9,7 @@ import com.yizhuan.erban.databinding.FragmentRoomHotBinding
|
|||||||
import com.yizhuan.erban.home.HomeViewModel
|
import com.yizhuan.erban.home.HomeViewModel
|
||||||
import com.yizhuan.erban.home.adapter.RoomHotAdapter
|
import com.yizhuan.erban.home.adapter.RoomHotAdapter
|
||||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom
|
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||||
|
|
||||||
|
|
||||||
class RoomHotFragment : BaseViewBindingFragment<FragmentRoomHotBinding>() {
|
class RoomHotFragment : BaseViewBindingFragment<FragmentRoomHotBinding>() {
|
||||||
@@ -25,12 +25,12 @@ class RoomHotFragment : BaseViewBindingFragment<FragmentRoomHotBinding>() {
|
|||||||
|
|
||||||
private val roomHotAdapter = RoomHotAdapter()
|
private val roomHotAdapter = RoomHotAdapter()
|
||||||
private var page = 1
|
private var page = 1
|
||||||
private lateinit var rvDelegate: RVDelegate<HomeRoom>
|
private lateinit var rvDelegate: RVDelegate<HomeRoomInfo>
|
||||||
private val pageSize = 20
|
private val pageSize = Int.MAX_VALUE
|
||||||
private val homeViewModel: HomeViewModel by activityViewModels()
|
private val homeViewModel: HomeViewModel by activityViewModels()
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
rvDelegate = RVDelegate.Builder<HomeRoom>()
|
rvDelegate = RVDelegate.Builder<HomeRoomInfo>()
|
||||||
.setAdapter(roomHotAdapter)
|
.setAdapter(roomHotAdapter)
|
||||||
.setRecyclerView(binding.recyclerView)
|
.setRecyclerView(binding.recyclerView)
|
||||||
.setEmptyView(EmptyViewHelper.createEmptyView(context, "暂无房间"))
|
.setEmptyView(EmptyViewHelper.createEmptyView(context, "暂无房间"))
|
||||||
@@ -42,6 +42,10 @@ class RoomHotFragment : BaseViewBindingFragment<FragmentRoomHotBinding>() {
|
|||||||
homeViewModel.hotRoomLiveData.observe(this) {
|
homeViewModel.hotRoomLiveData.observe(this) {
|
||||||
rvDelegate.loadData(it)
|
rvDelegate.loadData(it)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
loadData(true)
|
loadData(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
package com.yizhuan.erban.home.fragment
|
package com.yizhuan.erban.home.fragment
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import androidx.core.view.isGone
|
||||||
|
import androidx.core.view.isVisible
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.google.android.material.appbar.AppBarLayout
|
import com.google.android.material.appbar.AppBarLayout
|
||||||
@@ -9,11 +11,11 @@ import com.yizhuan.erban.common.EmptyViewHelper
|
|||||||
import com.yizhuan.erban.databinding.FragmentRoomLikeBinding
|
import com.yizhuan.erban.databinding.FragmentRoomLikeBinding
|
||||||
import com.yizhuan.erban.home.HomeViewModel
|
import com.yizhuan.erban.home.HomeViewModel
|
||||||
import com.yizhuan.erban.home.adapter.HomeConcernsAdapter
|
import com.yizhuan.erban.home.adapter.HomeConcernsAdapter
|
||||||
import com.yizhuan.erban.home.adapter.RoomCommonAdapter
|
|
||||||
import com.yizhuan.erban.home.adapter.RoomLikeAdapter
|
import com.yizhuan.erban.home.adapter.RoomLikeAdapter
|
||||||
|
import com.yizhuan.erban.ui.relation.AttentionListActivity
|
||||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||||
|
import com.yizhuan.xchat_android_core.home.bean.CollectionRoomInfo
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeConcernsInfo
|
import com.yizhuan.xchat_android_core.home.bean.HomeConcernsInfo
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom
|
|
||||||
|
|
||||||
|
|
||||||
class RoomLikeFragment : BaseViewBindingFragment<FragmentRoomLikeBinding>() {
|
class RoomLikeFragment : BaseViewBindingFragment<FragmentRoomLikeBinding>() {
|
||||||
@@ -31,7 +33,7 @@ class RoomLikeFragment : BaseViewBindingFragment<FragmentRoomLikeBinding>() {
|
|||||||
private lateinit var likeRvDelegate: RVDelegate<HomeConcernsInfo>
|
private lateinit var likeRvDelegate: RVDelegate<HomeConcernsInfo>
|
||||||
|
|
||||||
private val mAdapter = RoomLikeAdapter()
|
private val mAdapter = RoomLikeAdapter()
|
||||||
private lateinit var rvDelegate: RVDelegate<HomeRoom>
|
private lateinit var rvDelegate: RVDelegate<CollectionRoomInfo.FansRoomListBean>
|
||||||
private var pageNum = 1
|
private var pageNum = 1
|
||||||
private val pageSize = 20
|
private val pageSize = 20
|
||||||
private val homeViewModel: HomeViewModel by activityViewModels()
|
private val homeViewModel: HomeViewModel by activityViewModels()
|
||||||
@@ -42,24 +44,25 @@ class RoomLikeFragment : BaseViewBindingFragment<FragmentRoomLikeBinding>() {
|
|||||||
AppBarLayout.OnOffsetChangedListener { _, verticalOffset ->
|
AppBarLayout.OnOffsetChangedListener { _, verticalOffset ->
|
||||||
binding.refreshLayout.isEnabled = verticalOffset == 0
|
binding.refreshLayout.isEnabled = verticalOffset == 0
|
||||||
})
|
})
|
||||||
|
|
||||||
likeRvDelegate = RVDelegate.Builder<HomeConcernsInfo>()
|
likeRvDelegate = RVDelegate.Builder<HomeConcernsInfo>()
|
||||||
.setAdapter(concernsAdapter)
|
.setAdapter(concernsAdapter)
|
||||||
.setRecyclerView(binding.rvLike)
|
.setRecyclerView(binding.rvLike)
|
||||||
.setEmptyView(EmptyViewHelper.createEmptyView(context, "暂无房间"))
|
|
||||||
.setLayoutManager(LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false))
|
.setLayoutManager(LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
homeViewModel.concernsLiveData.observe(this) {
|
homeViewModel.concernsLiveData.observe(this) {
|
||||||
likeRvDelegate.setNewData(it)
|
likeRvDelegate.setNewData(it)
|
||||||
|
binding.tvMore.isGone = concernsAdapter.data.isNullOrEmpty()
|
||||||
|
binding.tvLike.isGone = concernsAdapter.data.isNullOrEmpty()
|
||||||
}
|
}
|
||||||
homeViewModel.getConcernsRoom()
|
|
||||||
|
|
||||||
rvDelegate = RVDelegate.Builder<HomeRoom>()
|
rvDelegate = RVDelegate.Builder<CollectionRoomInfo.FansRoomListBean>()
|
||||||
.setAdapter(mAdapter)
|
.setAdapter(mAdapter)
|
||||||
.setLayoutManager(LinearLayoutManager(mContext))
|
.setLayoutManager(LinearLayoutManager(mContext))
|
||||||
.setPageSize(pageSize)
|
.setPageSize(pageSize)
|
||||||
.setRefreshLayout(binding.refreshLayout)
|
.setRefreshLayout(binding.refreshLayout)
|
||||||
.setEmptyView(EmptyViewHelper.createEmptyView(mContext, "暂无房间"))
|
.setEmptyView(EmptyViewHelper.createEmptyView(mContext, "暂无收藏"))
|
||||||
.setRecyclerView(binding.rvCollect)
|
.setRecyclerView(binding.rvCollect)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
@@ -75,14 +78,33 @@ class RoomLikeFragment : BaseViewBindingFragment<FragmentRoomLikeBinding>() {
|
|||||||
loadData(true)
|
loadData(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
homeViewModel.emptyLiveData.observe(this) {
|
||||||
|
it?.let {
|
||||||
|
binding.refreshLayout.isRefreshing = false
|
||||||
|
binding.clEmpty.isVisible = it
|
||||||
|
binding.coordinatorLayout.isVisible = !it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.tvGoPlay.setOnClickListener {
|
||||||
|
(parentFragment as PartyFragment).onItemSelect(1,null)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.tvMore.setOnClickListener {
|
||||||
|
AttentionListActivity.start(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
loadData(true)
|
loadData(true)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun loadData(isRefresh: Boolean) {
|
private fun loadData(isRefresh: Boolean) {
|
||||||
if (isRefresh) {
|
if (isRefresh) {
|
||||||
pageNum = 1
|
pageNum = 1
|
||||||
|
binding.refreshLayout.isRefreshing = true
|
||||||
} else {
|
} else {
|
||||||
pageNum++
|
pageNum++
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,76 @@
|
|||||||
|
package com.yizhuan.erban.home.helper
|
||||||
|
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.graphics.drawable.GradientDrawable
|
||||||
|
import android.view.View
|
||||||
|
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||||
|
import com.yizhuan.erban.R
|
||||||
|
import com.yizhuan.erban.home.adapter.BannerAdapter
|
||||||
|
import com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView
|
||||||
|
import com.yizhuan.erban.ui.widget.rollviewpager.Util
|
||||||
|
import com.yizhuan.erban.ui.widget.rollviewpager.hintview.ColorPointHintView
|
||||||
|
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||||
|
import com.yizhuan.xchat_android_library.utils.ListUtils
|
||||||
|
|
||||||
|
class BannerHelper {
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
fun setBanner(rollView: RollPagerView, bannerList: List<BannerInfo>) {
|
||||||
|
|
||||||
|
if (ListUtils.isListEmpty(bannerList)) {
|
||||||
|
rollView.visibility = View.GONE
|
||||||
|
return
|
||||||
|
}
|
||||||
|
rollView.visibility = View.VISIBLE
|
||||||
|
if (rollView.adapter == null) {
|
||||||
|
rollView.setHintView(object : ColorPointHintView(
|
||||||
|
rollView.context, Color.WHITE, rollView.context.resources.getColor(
|
||||||
|
R.color.color_66FFFFFF
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun makeFocusDrawable(): Drawable {
|
||||||
|
val dotFocus = GradientDrawable()
|
||||||
|
dotFocus.setColor(Color.WHITE)
|
||||||
|
dotFocus.cornerRadius = Util.dip2px(
|
||||||
|
context, 2f
|
||||||
|
).toFloat()
|
||||||
|
dotFocus.setSize(
|
||||||
|
Util.dip2px(context, 9f), Util.dip2px(
|
||||||
|
context, 4f
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return dotFocus
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun makeNormalDrawable(): Drawable {
|
||||||
|
val dotNormal = GradientDrawable()
|
||||||
|
dotNormal.setColor(rollView.context.resources.getColor(R.color.color_66FFFFFF))
|
||||||
|
dotNormal.cornerRadius = Util.dip2px(
|
||||||
|
context, 2f
|
||||||
|
).toFloat()
|
||||||
|
dotNormal.setSize(
|
||||||
|
Util.dip2px(context, 4f), Util.dip2px(
|
||||||
|
context, 4f
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return dotNormal
|
||||||
|
}
|
||||||
|
})
|
||||||
|
val bannerAdapter = BannerAdapter(bannerList, rollView.context)
|
||||||
|
bannerAdapter.setRoundingRadius(ScreenUtil.dip2px(8f))
|
||||||
|
bannerAdapter.setHomeGame(true)
|
||||||
|
rollView.adapter = bannerAdapter
|
||||||
|
rollView.setPlayDelay(3000)
|
||||||
|
//设置透明度
|
||||||
|
rollView.setAnimationDurtion(500)
|
||||||
|
}
|
||||||
|
|
||||||
|
(rollView.adapter as? BannerAdapter)?.let {
|
||||||
|
it.setBannerInfoList(bannerList)
|
||||||
|
it.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -1,66 +0,0 @@
|
|||||||
package com.yizhuan.erban.home.presenter;
|
|
||||||
|
|
||||||
import com.yizhuan.erban.base.BaseMvpPresenter;
|
|
||||||
import com.yizhuan.xchat_android_core.home.IHomeTabMapView;
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeTabMapInfo;
|
|
||||||
import com.yizhuan.xchat_android_core.home.model.GameHomeModel;
|
|
||||||
import com.yizhuan.xchat_android_core.Constants;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.reactivex.SingleObserver;
|
|
||||||
import io.reactivex.disposables.Disposable;
|
|
||||||
|
|
||||||
public class HomeTabMapPresenter extends BaseMvpPresenter<IHomeTabMapView> {
|
|
||||||
|
|
||||||
private int page = 0;
|
|
||||||
|
|
||||||
public void loadData(boolean isRefresh, String id) {
|
|
||||||
if (isRefresh) {
|
|
||||||
page = 1;
|
|
||||||
} else {
|
|
||||||
page++;
|
|
||||||
}
|
|
||||||
|
|
||||||
GameHomeModel.get().getHomeTabMap(id, page, Constants.PAGE_SIZE)
|
|
||||||
.compose(bindToLifecycle()).subscribe(new SingleObserver<List<HomeTabMapInfo>>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<HomeTabMapInfo> homeTabMapInfos) {
|
|
||||||
if (homeTabMapInfos != null) {
|
|
||||||
if (mMvpView != null) {
|
|
||||||
if (isRefresh){
|
|
||||||
mMvpView.homeTabMapSuccess(homeTabMapInfos);
|
|
||||||
}else {
|
|
||||||
mMvpView.homeTabMapLoadMoreSuccess(homeTabMapInfos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (mMvpView != null) {
|
|
||||||
if (isRefresh){
|
|
||||||
mMvpView.homeTabMapFails("暂无数据");
|
|
||||||
}else {
|
|
||||||
mMvpView.homeTabMapLoadMoreFails("已经到底啦");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
if (mMvpView != null) {
|
|
||||||
mMvpView.homeTabMapFails(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPage() {
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,209 +0,0 @@
|
|||||||
package com.yizhuan.erban.ui.widget;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.view.ViewTreeObserver;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.bumptech.glide.load.DataSource;
|
|
||||||
import com.bumptech.glide.load.engine.GlideException;
|
|
||||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
|
||||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
|
||||||
import com.bumptech.glide.request.RequestListener;
|
|
||||||
import com.bumptech.glide.request.target.Target;
|
|
||||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
|
||||||
import com.yizhuan.erban.R;
|
|
||||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> 首页item view </p>
|
|
||||||
*
|
|
||||||
* @author Administrator
|
|
||||||
* @date 2017/11/29
|
|
||||||
*/
|
|
||||||
public class RoomItemView extends LinearLayout implements View.OnClickListener {
|
|
||||||
public final static String TAG = RoomItemView.class.getSimpleName();
|
|
||||||
private ImageView mIvCover;
|
|
||||||
private LivingIconView livingIconView;
|
|
||||||
private ImageView mIvTabCategory;
|
|
||||||
private ImageView mIvLockBg;
|
|
||||||
private TextView mTvTitle;
|
|
||||||
private ImageView mIvTabLabel;
|
|
||||||
private ImageView mIvEmperorRecommend;
|
|
||||||
private TextView mTvOnlineNumber;
|
|
||||||
private Context mContext;
|
|
||||||
private LinearLayout llNameContainer;
|
|
||||||
|
|
||||||
private int mRound;
|
|
||||||
private int mTagHeight, mBadgeHeight;
|
|
||||||
private HomeRoom mHomeRoom;
|
|
||||||
private boolean showLiving;
|
|
||||||
|
|
||||||
public RoomItemView(Context context) {
|
|
||||||
this(context, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public RoomItemView(Context context, AttributeSet attrs) {
|
|
||||||
this(context, attrs, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public RoomItemView(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
||||||
super(context, attrs, defStyleAttr);
|
|
||||||
mContext = context;
|
|
||||||
inflate(context, R.layout.list_room_item_view, this);
|
|
||||||
|
|
||||||
livingIconView = findViewById(R.id.liv_living_icon);
|
|
||||||
mIvCover = findViewById(R.id.iv_cover);
|
|
||||||
mIvTabCategory = (ImageView) findViewById(R.id.iv_tab_category);
|
|
||||||
mIvLockBg = (ImageView) findViewById(R.id.lock_bg);
|
|
||||||
mTvTitle = (TextView) findViewById(R.id.title);
|
|
||||||
mIvTabLabel = (ImageView) findViewById(R.id.iv_tab_label);
|
|
||||||
mIvEmperorRecommend = (ImageView) findViewById(R.id.iv_emperor_recommend);
|
|
||||||
mTvOnlineNumber = (TextView) findViewById(R.id.tv_online_number);
|
|
||||||
llNameContainer = findViewById(R.id.ll_name_container);
|
|
||||||
mRound = context.getResources().getDimensionPixelOffset(R.dimen.common_cover_round_size);
|
|
||||||
mTagHeight = (int) context.getResources().getDimension(R.dimen.tag_height);
|
|
||||||
mBadgeHeight = (int) context.getResources().getDimension(R.dimen.tag_height);
|
|
||||||
|
|
||||||
setOnClickListener(this);
|
|
||||||
|
|
||||||
showLiving = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void bindData(HomeRoom homeRoom) {
|
|
||||||
mHomeRoom = homeRoom;
|
|
||||||
if (homeRoom == null) {
|
|
||||||
setVisibility(INVISIBLE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setVisibility(VISIBLE);
|
|
||||||
if (showLiving) {
|
|
||||||
livingIconView.setColor(getResources().getColor(R.color.color_333333));
|
|
||||||
livingIconView.start();
|
|
||||||
} else {
|
|
||||||
livingIconView.setVisibility(INVISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
livingIconView.setColor(Color.WHITE);
|
|
||||||
livingIconView.start();
|
|
||||||
mTvOnlineNumber.setText(getResources().getString(R.string.online_number_text, homeRoom.getOnlineNum()));
|
|
||||||
// LogUtil.d(TAG," width:" + Utils.getWindowWidth(mContext) * 0.6f);
|
|
||||||
// mTvTitle.setMaxWidth((int) (Utils.getWindowWidth(mContext) * 0.6f));
|
|
||||||
mTvTitle.setText(homeRoom.getTitle());
|
|
||||||
// llNameContainer.getViewTreeObserver().addOnGlobalLayoutListener(new MyOnGlobalLayoutListener(mTvTitle) {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onGlobalLayout() {
|
|
||||||
// llNameContainer.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
|
||||||
// int viewWidth = llNameContainer.getWidth();
|
|
||||||
//// LogUtil.d(TAG,"parent width:" + viewWidth + " child width:" + mTvTitle.getMeasuredWidth());
|
|
||||||
// int textWidth = (int) StaticLayout.getDesiredWidth(((TextView)markView).getText().toString(), ((TextView)markView).getPaint());
|
|
||||||
// if (textWidth > (viewWidth - Utils.dip2px(mContext, 30))) {
|
|
||||||
// LayoutParams lp = (LayoutParams) markView.getLayoutParams();
|
|
||||||
// lp.width = viewWidth - Utils.dip2px(mContext, 30);
|
|
||||||
//// LogUtil.d(TAG," mod width:" + lp.width);
|
|
||||||
// markView.setLayoutParams(lp);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
mIvLockBg.setVisibility(!TextUtils.isEmpty(homeRoom.getRoomPwd()) ? VISIBLE : GONE);
|
|
||||||
|
|
||||||
GlideApp.with(mContext)
|
|
||||||
.load(TextUtils.isEmpty(homeRoom.tagPict) ? R.mipmap.ic_tag_default : homeRoom.tagPict)
|
|
||||||
.placeholder(R.mipmap.ic_tag_default)
|
|
||||||
.error(R.mipmap.ic_tag_default)
|
|
||||||
.listener(new RequestListener<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, Object o, Target<Drawable> target, boolean b) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onResourceReady(Drawable drawable, Object o, Target<Drawable> target, DataSource dataSource, boolean b) {
|
|
||||||
float ratio = (drawable.getIntrinsicHeight() + 0.F) / drawable.getIntrinsicWidth();
|
|
||||||
int width = Math.round(mTagHeight / ratio);
|
|
||||||
int height = mTagHeight;
|
|
||||||
ViewGroup.LayoutParams params = mIvTabCategory.getLayoutParams();
|
|
||||||
params.width = width;
|
|
||||||
params.height = height;
|
|
||||||
mIvTabCategory.setLayoutParams(params);
|
|
||||||
mIvTabCategory.setImageDrawable(drawable);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.into(mIvTabCategory);
|
|
||||||
|
|
||||||
|
|
||||||
mIvTabLabel.setVisibility(TextUtils.isEmpty(homeRoom.badge) ? View.GONE : View.VISIBLE);
|
|
||||||
GlideApp.with(mContext)
|
|
||||||
.load(homeRoom.badge)
|
|
||||||
.listener(new RequestListener<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, Object o, Target<Drawable> target, boolean b) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onResourceReady(Drawable drawable, Object o, Target<Drawable> target, DataSource dataSource, boolean b) {
|
|
||||||
float ratio = (drawable.getIntrinsicHeight() + 0.F) / drawable.getIntrinsicWidth();
|
|
||||||
int width = Math.round(mBadgeHeight / ratio);
|
|
||||||
int height = mBadgeHeight;
|
|
||||||
ViewGroup.LayoutParams params = mIvTabLabel.getLayoutParams();
|
|
||||||
params.width = width;
|
|
||||||
params.height = height;
|
|
||||||
mIvTabLabel.setLayoutParams(params);
|
|
||||||
mIvTabLabel.setImageDrawable(drawable);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.into(mIvTabLabel);
|
|
||||||
// 皇帝推荐
|
|
||||||
mIvEmperorRecommend.setVisibility(homeRoom.getIsRecom() > 0 ? View.VISIBLE : View.GONE);
|
|
||||||
GlideApp.with(mContext)
|
|
||||||
.load(mContext.getResources().getDrawable(R.drawable.ic_king_recommend))
|
|
||||||
// .load(homeRoom.getIsRecom() > 0 ? NobleUtil.getEmperorRecommendTag(7) : 0)
|
|
||||||
.fitCenter()
|
|
||||||
.into(mIvEmperorRecommend);
|
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(homeRoom.getAvatar())) {
|
|
||||||
ImageLoadUtils.loadAvatar(homeRoom.getAvatar(), mIvCover, R.drawable.default_cover);
|
|
||||||
} else {
|
|
||||||
GlideApp.with(mContext)
|
|
||||||
.load(R.drawable.default_cover)
|
|
||||||
.placeholder(R.drawable.default_cover)
|
|
||||||
.transforms(new CenterCrop(), new RoundedCorners(mRound))
|
|
||||||
.into(mIvCover);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (mHomeRoom != null) {
|
|
||||||
AVRoomActivity.start(mContext, mHomeRoom.getUid());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShowLiving(boolean showLiving) {
|
|
||||||
this.showLiving = showLiving;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static abstract class MyOnGlobalLayoutListener implements ViewTreeObserver.OnGlobalLayoutListener {
|
|
||||||
protected View markView;
|
|
||||||
public MyOnGlobalLayoutListener(View view) {
|
|
||||||
this.markView = view;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -16,6 +16,7 @@ import android.view.animation.Interpolator;
|
|||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.Scroller;
|
import android.widget.Scroller;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.viewpager.widget.PagerAdapter;
|
import androidx.viewpager.widget.PagerAdapter;
|
||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
import androidx.viewpager.widget.ViewPager.OnPageChangeListener;
|
import androidx.viewpager.widget.ViewPager.OnPageChangeListener;
|
||||||
@@ -381,6 +382,11 @@ public class RollPagerView extends RelativeLayout implements OnPageChangeListene
|
|||||||
dataSetChanged();
|
dataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public PagerAdapter getAdapter(){
|
||||||
|
return mAdapter;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用来实现adapter的notifyDataSetChanged通知HintView变化
|
* 用来实现adapter的notifyDataSetChanged通知HintView变化
|
||||||
*/
|
*/
|
||||||
|
BIN
app/src/main/res/drawable-xhdpi/default_banner.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/default_banner.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_home_recommend_tag.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_home_recommend_tag.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
@@ -2,5 +2,5 @@
|
|||||||
<com.makeramen.roundedimageview.RoundedImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
<com.makeramen.roundedimageview.RoundedImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="fitXY" />
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
|
@@ -111,19 +111,41 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<FrameLayout
|
||||||
android:id="@+id/tv_recommend_room"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp">
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:paddingStart="16dp"
|
<TextView
|
||||||
android:text="推荐房间"
|
android:id="@+id/tv_recommend_room"
|
||||||
android:textColor="@color/color_333333"
|
android:layout_width="wrap_content"
|
||||||
android:textSize="16sp"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:drawableStart="@drawable/ic_home_recommend_tag"
|
||||||
android:visibility="visible"
|
android:includeFontPadding="false"
|
||||||
tools:visibility="visible" />
|
android:paddingStart="16dp"
|
||||||
|
android:text="最新推荐"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="visible"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_more"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end|center_vertical"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:drawableRight="@drawable/arrow_right"
|
||||||
|
android:gravity="center"
|
||||||
|
android:drawablePadding="2dp"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:text="更多"
|
||||||
|
android:textColor="#b3333333"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
android:id="@+id/fg_recommend_room"
|
android:id="@+id/fg_recommend_room"
|
||||||
|
@@ -5,87 +5,141 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
<FrameLayout
|
||||||
android:id="@+id/coordinator_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<LinearLayout
|
||||||
android:id="@+id/app_bar_layout"
|
android:id="@+id/cl_empty"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@color/transparent"
|
|
||||||
app:elevation="0dp"
|
|
||||||
app:layout_behavior="com.yizhuan.erban.ui.widget.AppBarLayoutBehavior">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:contentScrim="@color/transparent"
|
|
||||||
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/recycler_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_like"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="15dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:text="关注的人"
|
|
||||||
android:textColor="@color/color_333333"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="更多"
|
|
||||||
android:textColor="#b3333333"
|
|
||||||
android:textSize="12sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/rv_like"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_like" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_collect"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="15dp"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:text="收藏的房间"
|
|
||||||
android:textColor="#ff333333"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/rv_like" />
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/rv_collect"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
android:visibility="gone"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="70dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/home_like_hint"
|
||||||
|
android:textColor="#b3333333"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="68dp"
|
||||||
|
android:src="@drawable/empty_content_dark" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:text="有许多有趣的人和房间等着你来发掘哦~"
|
||||||
|
android:textColor="#ff333333"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_go_play"
|
||||||
|
android:layout_width="240dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
android:background="@drawable/common_btn_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:text="交友畅聊"
|
||||||
|
android:textColor="#ffffffff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
|
android:id="@+id/coordinator_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/app_bar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
app:elevation="0dp"
|
||||||
|
app:layout_behavior="com.yizhuan.erban.ui.widget.AppBarLayoutBehavior">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:contentScrim="@color/transparent"
|
||||||
|
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_like"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:text="关注的人"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_more"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:drawableRight="@drawable/arrow_right"
|
||||||
|
android:text="更多"
|
||||||
|
android:textColor="#b3333333"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/tv_like"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/tv_like" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_like"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_like" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_collect"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:text="收藏的房间"
|
||||||
|
android:textColor="#ff333333"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/rv_like" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_collect"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
@@ -1,117 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layout 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">
|
|
||||||
|
|
||||||
<data>
|
|
||||||
|
|
||||||
<variable
|
|
||||||
name="homeInfo"
|
|
||||||
type="com.yizhuan.xchat_android_core.home.bean.HomeRoom" />
|
|
||||||
|
|
||||||
<import type="android.text.TextUtils" />
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_container"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_marginRight="15dp"
|
|
||||||
android:layout_marginTop="15dp"
|
|
||||||
tools:layout_width="163dp">
|
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.SquareLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
|
||||||
android:id="@+id/iv_cover"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:src="@drawable/default_avatar"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
app:riv_corner_radius="@dimen/dp_16"
|
|
||||||
nomalUrl="@{homeInfo.avatar}" />
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingLeft="7dp"
|
|
||||||
android:background="@drawable/shape_item_room_online_member"
|
|
||||||
android:paddingTop="2dp"
|
|
||||||
android:paddingRight="7dp"
|
|
||||||
android:paddingBottom="2dp">
|
|
||||||
|
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.LivingIconView
|
|
||||||
android:id="@+id/liv_living_icon"
|
|
||||||
android:layout_width="6dp"
|
|
||||||
android:layout_height="8dp"
|
|
||||||
android:background="@color/transparent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_online_number"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="4dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@{homeInfo.onlineNum + @string/online_text}"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="10sp"
|
|
||||||
tools:text="100人在线" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_tab_label"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="15dp"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_marginStart="6dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:visibility="invisible"
|
|
||||||
nomalUrl="@{homeInfo.badge}"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
|
||||||
android:id="@+id/lock_bg"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:src="@drawable/icon_lock_bg"
|
|
||||||
visible="@{!TextUtils.isEmpty(homeInfo.roomPwd)}"
|
|
||||||
app:riv_corner_radius="@dimen/dp_16"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
</com.yizhuan.erban.ui.widget.SquareLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="7dp"
|
|
||||||
android:layout_marginRight="@dimen/dp_5"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="2"
|
|
||||||
android:lineSpacingExtra="6dp"
|
|
||||||
android:text="@{homeInfo.title}"
|
|
||||||
android:textColor="@color/color_333333"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:text="房间名称" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/dp_5" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</layout>
|
|
22
app/src/main/res/layout/item_room_banner.xml
Normal file
22
app/src/main/res/layout/item_room_banner.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_marginStart="15dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:layout_marginBottom="15dp">
|
||||||
|
|
||||||
|
<com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView
|
||||||
|
android:id="@+id/roll_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintDimensionRatio="345:80"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:rollviewpager_hint_gravity="left"
|
||||||
|
app:rollviewpager_hint_paddingBottom="8dp"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -1,47 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout 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="wrap_content"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/rl_container"
|
|
||||||
android:layout_width="110dp"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:background="@drawable/shape_room_category_selected">
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
|
||||||
android:id="@+id/iv_icon"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@mipmap/ic_default_add_avatar"
|
|
||||||
app:riv_corner_radius="2dp" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/v_cover"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@drawable/shape_room_category_unselected" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_name"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_marginBottom="7dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="12sp"
|
|
||||||
tools:text="热门推荐" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
@@ -3,93 +3,165 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="98dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginEnd="10dp">
|
android:layout_marginEnd="10dp">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/view_bg"
|
android:id="@+id/view_bg"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="74dp"
|
||||||
android:layout_marginStart="15dp"
|
android:layout_marginTop="7dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:background="@drawable/bg_home_common_item"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/iv_room_image"
|
android:id="@+id/iv_room_image"
|
||||||
android:layout_width="78dp"
|
android:layout_width="74dp"
|
||||||
android:layout_height="78dp"
|
android:layout_height="74dp"
|
||||||
|
android:layout_marginStart="3dp"
|
||||||
android:src="@drawable/default_cover"
|
android:src="@drawable/default_cover"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:riv_corner_radius="8dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_in_pk"
|
||||||
|
android:layout_width="44dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:background="@drawable/bg_common_pk"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:text="PK中"
|
||||||
|
android:textColor="#ffffffff"
|
||||||
|
android:textSize="12dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/iv_room_image"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/iv_room_image"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/view_room_cover"
|
android:id="@+id/view_room_cover"
|
||||||
android:layout_width="78dp"
|
android:layout_width="74dp"
|
||||||
android:layout_height="78dp"
|
android:layout_height="74dp"
|
||||||
|
android:background="@drawable/bg_home_common_avatar"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_room_image"
|
app:layout_constraintBottom_toBottomOf="@id/iv_room_image"
|
||||||
app:layout_constraintEnd_toEndOf="@id/iv_room_image" />
|
app:layout_constraintEnd_toEndOf="@id/iv_room_image"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/iv_room_image"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/iv_room_image" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_room_title"
|
android:id="@+id/tv_room_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textColor="@color/text_primary"
|
android:textColor="@color/text_primary"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintBottom_toTopOf="@id/tv_room_tag"
|
app:layout_constraintBottom_toTopOf="@id/iv_room_tag"
|
||||||
app:layout_constraintLeft_toRightOf="@+id/iv_room_image"
|
app:layout_constraintStart_toEndOf="@id/view_room_cover"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_chainStyle="packed"
|
app:layout_constraintVertical_chainStyle="packed"
|
||||||
tools:text="余生点唱歌曲交友房间" />
|
tools:text="余生点唱歌曲交友房间" />
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/tv_room_tag"
|
android:id="@+id/iv_room_tag"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="15dp"
|
android:layout_height="14dp"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginTop="11dp"
|
||||||
android:layout_marginTop="5dp"
|
android:adjustViewBounds="true"
|
||||||
android:gravity="center"
|
|
||||||
android:paddingStart="5dp"
|
|
||||||
android:paddingEnd="5dp"
|
|
||||||
android:textColor="#FFFCFD"
|
|
||||||
android:textSize="10sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toRightOf="@+id/iv_room_image"
|
app:layout_constraintStart_toStartOf="@id/tv_room_title"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_room_title"
|
app:layout_constraintTop_toBottomOf="@id/tv_room_title"
|
||||||
|
tools:src="@drawable/tag_101"
|
||||||
tools:text="聊天" />
|
tools:text="聊天" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_id"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:textColor="#66333333"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_room_tag"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iv_room_tag"
|
||||||
|
tools:text="ID:1234" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_online_number"
|
android:id="@+id/tv_online_number"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="4dp"
|
android:layout_marginTop="14dp"
|
||||||
android:textColor="#5936383A"
|
android:layout_marginEnd="10dp"
|
||||||
|
android:drawableStart="@drawable/ic_home_hot_hot"
|
||||||
|
android:drawablePadding="2dp"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/tv_room_tag"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintLeft_toRightOf="@+id/tv_room_tag"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/tv_room_tag"
|
tools:text="266" />
|
||||||
tools:text="266人热聊中" />
|
|
||||||
|
|
||||||
<TextView
|
<FrameLayout
|
||||||
android:id="@+id/iv_into_room"
|
android:id="@+id/fl_avatar"
|
||||||
android:layout_width="40dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="20dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginEnd="18dp"
|
||||||
android:background="@drawable/common_btn_bg"
|
android:layout_marginBottom="20dp"
|
||||||
android:gravity="center"
|
|
||||||
android:text="进房"
|
|
||||||
android:textColor="#80000000"
|
|
||||||
android:textSize="12dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
<com.yizhuan.erban.common.widget.CircleImageView
|
||||||
|
android:id="@+id/iv_avatar_0"
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:src="@drawable/default_avatar"
|
||||||
|
app:cborder_color="@color/white"
|
||||||
|
app:cborder_width="1px" />
|
||||||
|
|
||||||
|
<com.yizhuan.erban.common.widget.CircleImageView
|
||||||
|
android:id="@+id/iv_avatar_1"
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:src="@drawable/default_avatar"
|
||||||
|
app:cborder_color="@color/white"
|
||||||
|
app:cborder_width="1px" />
|
||||||
|
|
||||||
|
<com.yizhuan.erban.common.widget.CircleImageView
|
||||||
|
android:id="@+id/iv_avatar_2"
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_marginStart="28dp"
|
||||||
|
android:src="@drawable/default_avatar"
|
||||||
|
app:cborder_color="@color/white"
|
||||||
|
app:cborder_width="1px" />
|
||||||
|
|
||||||
|
<com.yizhuan.erban.common.widget.CircleImageView
|
||||||
|
android:id="@+id/iv_avatar_3"
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_marginStart="44dp"
|
||||||
|
android:src="@drawable/default_avatar"
|
||||||
|
app:cborder_color="@color/white"
|
||||||
|
app:cborder_width="1px" />
|
||||||
|
|
||||||
|
<com.yizhuan.erban.common.widget.CircleImageView
|
||||||
|
android:id="@+id/iv_avatar_4"
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_marginStart="58dp"
|
||||||
|
android:src="@drawable/default_avatar"
|
||||||
|
app:cborder_color="@color/white"
|
||||||
|
app:cborder_width="1px" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -60,15 +60,14 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textColor="@color/text_primary"
|
android:textColor="@color/text_primary"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintBottom_toTopOf="@id/iv_room_tag"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/view_room_cover"
|
app:layout_constraintStart_toEndOf="@id/view_room_cover"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_chainStyle="packed"
|
|
||||||
tools:text="余生点唱歌曲交友房间" />
|
tools:text="余生点唱歌曲交友房间" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -77,7 +76,7 @@
|
|||||||
android:layout_height="14dp"
|
android:layout_height="14dp"
|
||||||
android:layout_marginTop="11dp"
|
android:layout_marginTop="11dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:visibility="visible"
|
||||||
app:layout_constraintStart_toStartOf="@id/tv_room_title"
|
app:layout_constraintStart_toStartOf="@id/tv_room_title"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_room_title"
|
app:layout_constraintTop_toBottomOf="@id/tv_room_title"
|
||||||
tools:src="@drawable/tag_101"
|
tools:src="@drawable/tag_101"
|
||||||
@@ -88,10 +87,13 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="6dp"
|
||||||
|
android:layout_marginTop="11dp"
|
||||||
|
android:includeFontPadding="false"
|
||||||
android:textColor="#66333333"
|
android:textColor="#66333333"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_room_tag"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/iv_room_tag"
|
app:layout_constraintStart_toEndOf="@id/iv_room_tag"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_room_title"
|
||||||
|
app:layout_goneMarginStart="0dp"
|
||||||
tools:text="ID:1234" />
|
tools:text="ID:1234" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@color/white"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.RoomItemView
|
|
||||||
android:id="@+id/riv_room_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:background="@color/white"
|
|
||||||
android:paddingLeft="10dp"
|
|
||||||
android:paddingRight="10dp">
|
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.RoomItemView
|
|
||||||
android:id="@+id/riv_room_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1px"
|
|
||||||
android:background="@color/color_ececec"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:background="@color/white"
|
|
||||||
android:paddingLeft="10dp"
|
|
||||||
android:paddingRight="10dp">
|
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.RoomItemView
|
|
||||||
android:id="@+id/riv_room_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1px"
|
|
||||||
android:background="@color/color_ececec"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="15dp"
|
|
||||||
android:layout_marginEnd="15dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.RoomItemView
|
|
||||||
android:id="@+id/riv_room_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<!--<View-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="1px"-->
|
|
||||||
<!--android:layout_marginStart="71dp"-->
|
|
||||||
<!--android:background="@color/color_ececec" />-->
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@@ -1,117 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingLeft="15dp"
|
|
||||||
android:background="@color/white"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="85dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="85dp">
|
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.SquareImageView
|
|
||||||
android:id="@+id/iv_cover"
|
|
||||||
android:layout_width="85dp"
|
|
||||||
android:layout_height="85dp"
|
|
||||||
android:src="@mipmap/app_logo" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_name_container"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="9dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textColor="@color/color_1A1A1A"
|
|
||||||
android:textSize="@dimen/sp_14"
|
|
||||||
tools:text="房间名" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/lock_bg"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:src="@drawable/ic_room_lock_icon"
|
|
||||||
android:visibility="visible" />
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_online_number"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_marginTop="3.5dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textColor="@color/color_999999"
|
|
||||||
android:textSize="12sp"
|
|
||||||
tools:text="100人在线" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="18dp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_title"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_icon"
|
|
||||||
android:layout_width="@dimen/dp_20"
|
|
||||||
android:layout_height="@dimen/dp_20"
|
|
||||||
android:scaleType="centerCrop" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_title"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="@dimen/dp_5"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:textColor="@color/color_1A1A1A"
|
|
||||||
android:textSize="@dimen/dp_15"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.RoomItemView
|
|
||||||
android:id="@+id/riv_room_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
|
||||||
android:layout_marginStart="@dimen/dp_15"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1px"
|
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
|
||||||
android:layout_marginStart="@dimen/dp_15"
|
|
||||||
android:background="@color/color_ececec"
|
|
||||||
android:visibility="gone" />
|
|
||||||
</LinearLayout>
|
|
||||||
</RelativeLayout>
|
|
@@ -907,4 +907,5 @@
|
|||||||
<string name="room_pk_help">1)按收到的礼物价值积分(1钻石=1分),礼物值高的一方获胜。\n 2)PK结束后,若比分差距≥1314或双方分数总值≥15000(平局除外)将在与获胜方相同类型的房间公示PK结果;若比分差距≥5200或双方分数总值≥30000(平局除外)将在全服所有房间公示PK结果。</string>
|
<string name="room_pk_help">1)按收到的礼物价值积分(1钻石=1分),礼物值高的一方获胜。\n 2)PK结束后,若比分差距≥1314或双方分数总值≥15000(平局除外)将在与获胜方相同类型的房间公示PK结果;若比分差距≥5200或双方分数总值≥30000(平局除外)将在全服所有房间公示PK结果。</string>
|
||||||
<string name="room_pk_rule">1)只有牌照房房主和超管才可以发起跨房pk,一次只能选择一个牌照房发起;\n 2)只有房主和超管才可以接受或拒绝跨房pk请求,若10秒内不点击pk邀请弹窗,弹窗消失,视为自动拒绝;\n 3)发起pk时需选择pk时间和pk对象,自定义时间下限为5,上限为180,只能填写整数;\n 4)pk发起后,未到pk时间无法自行结束,若有特殊情况需提前结束可联系客服,但本场pk不算胜负。</string>
|
<string name="room_pk_rule">1)只有牌照房房主和超管才可以发起跨房pk,一次只能选择一个牌照房发起;\n 2)只有房主和超管才可以接受或拒绝跨房pk请求,若10秒内不点击pk邀请弹窗,弹窗消失,视为自动拒绝;\n 3)发起pk时需选择pk时间和pk对象,自定义时间下限为5,上限为180,只能填写整数;\n 4)pk发起后,未到pk时间无法自行结束,若有特殊情况需提前结束可联系客服,但本场pk不算胜负。</string>
|
||||||
<string name="first_charge_help">1.每人仅可获得1次首充福利\n2.每个手机号,设备,实名认证等如已参与过首充,则无法获得奖励。</string>
|
<string name="first_charge_help">1.每人仅可获得1次首充福利\n2.每个手机号,设备,实名认证等如已参与过首充,则无法获得奖励。</string>
|
||||||
|
<string name="home_like_hint">关注的人和收藏的房间都会出现在这里\n暂无关注的人和收藏的房间哦</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -4,7 +4,5 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:paddingStart="10dp"
|
android:paddingTop="2dp" />
|
||||||
android:paddingTop="2dp"
|
|
||||||
android:paddingEnd="10dp" />
|
|
||||||
|
|
||||||
|
@@ -116,7 +116,7 @@ public class MiniWorldMainActivity extends BaseMvpActivity<IMiniWorldMainView, M
|
|||||||
});
|
});
|
||||||
|
|
||||||
mBannerAdapter = new BannerAdapter(new ArrayList<>(), mContext);
|
mBannerAdapter = new BannerAdapter(new ArrayList<>(), mContext);
|
||||||
mBannerAdapter.setRoundingRadius(ScreenUtil.dip2px(12));
|
mBannerAdapter.setRoundingRadius(ScreenUtil.dip2px(8));
|
||||||
rollPagerView.setAdapter(mBannerAdapter);
|
rollPagerView.setAdapter(mBannerAdapter);
|
||||||
rollPagerView.setPlayDelay(3000);
|
rollPagerView.setPlayDelay(3000);
|
||||||
//设置透明度
|
//设置透明度
|
||||||
|
@@ -89,7 +89,7 @@ public class AitFriendsSearchActivity extends BaseBindingActivity<ActivityPublic
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
searchAdapter = new AitFriendsSearchAdapter(this, null);
|
searchAdapter = new AitFriendsSearchAdapter(this);
|
||||||
View headerView = LayoutInflater.from(this).inflate(R.layout.layout_search_header, null, false);
|
View headerView = LayoutInflater.from(this).inflate(R.layout.layout_search_header, null, false);
|
||||||
searchAdapter.addHeaderView(headerView);
|
searchAdapter.addHeaderView(headerView);
|
||||||
recyclerView.setAdapter(searchAdapter);
|
recyclerView.setAdapter(searchAdapter);
|
||||||
|
@@ -14,13 +14,11 @@ import com.yizhuan.erban.public_chat_hall.event.AitFriendEvent;
|
|||||||
import com.yizhuan.erban.public_chat_hall.event.PublicChatHallAitFriendSearchFinishEvent;
|
import com.yizhuan.erban.public_chat_hall.event.PublicChatHallAitFriendSearchFinishEvent;
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||||
import com.yizhuan.erban.ui.widget.NobleAvatarView;
|
import com.yizhuan.erban.ui.widget.NobleAvatarView;
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom;
|
|
||||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||||
import com.yizhuan.xchat_android_core.room.bean.SearchRoomInfo;
|
import com.yizhuan.xchat_android_core.room.bean.SearchRoomInfo;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class AitFriendsSearchAdapter extends BaseQuickAdapter<PublicChatHallSearchRoomInfo, BaseViewHolder> {
|
public class AitFriendsSearchAdapter extends BaseQuickAdapter<PublicChatHallSearchRoomInfo, BaseViewHolder> {
|
||||||
|
|
||||||
@@ -31,7 +29,7 @@ public class AitFriendsSearchAdapter extends BaseQuickAdapter<PublicChatHallSear
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AitFriendsSearchAdapter(Context context, List<HomeRoom> homeRoomList) {
|
public AitFriendsSearchAdapter(Context context) {
|
||||||
super(R.layout.item_public_chat_hall_friend_list);
|
super(R.layout.item_public_chat_hall_friend_list);
|
||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
@@ -39,12 +39,15 @@ public class CollectionRoomInfo {
|
|||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
private int roomId;
|
private int roomId;
|
||||||
private int uid;
|
private long uid;
|
||||||
private String roomAvatar;
|
private String roomAvatar;
|
||||||
private String roomName;
|
private String roomName;
|
||||||
private int roomOnlineNum;
|
private int roomOnlineNum;
|
||||||
private int roomUid;
|
private long roomUid;
|
||||||
private int erbanNo;
|
private int erbanNo;
|
||||||
|
private boolean crossPking;
|
||||||
|
private String tagPict;
|
||||||
|
private List<MicUsersBean> micUsers;
|
||||||
|
|
||||||
public int getErbanNo() {
|
public int getErbanNo() {
|
||||||
return erbanNo;
|
return erbanNo;
|
||||||
@@ -54,7 +57,7 @@ public class CollectionRoomInfo {
|
|||||||
this.erbanNo = erbanNo;
|
this.erbanNo = erbanNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRoomUid() {
|
public long getRoomUid() {
|
||||||
return roomUid;
|
return roomUid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +81,7 @@ public class CollectionRoomInfo {
|
|||||||
this.roomId = roomId;
|
this.roomId = roomId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUid() {
|
public long getUid() {
|
||||||
return uid;
|
return uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,6 +112,38 @@ public class CollectionRoomInfo {
|
|||||||
public void setRoomOnlineNum(int roomOnlineNum) {
|
public void setRoomOnlineNum(int roomOnlineNum) {
|
||||||
this.roomOnlineNum = roomOnlineNum;
|
this.roomOnlineNum = roomOnlineNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setUid(long uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoomUid(long roomUid) {
|
||||||
|
this.roomUid = roomUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCrossPking() {
|
||||||
|
return crossPking;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCrossPking(boolean crossPking) {
|
||||||
|
this.crossPking = crossPking;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTagPict() {
|
||||||
|
return tagPict;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTagPict(String tagPict) {
|
||||||
|
this.tagPict = tagPict;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MicUsersBean> getMicUsers() {
|
||||||
|
return micUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMicUsers(List<MicUsersBean> micUsers) {
|
||||||
|
this.micUsers = micUsers;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,65 +0,0 @@
|
|||||||
package com.yizhuan.xchat_android_core.home.bean;
|
|
||||||
|
|
||||||
import com.yizhuan.xchat_android_core.user.bean.BaseUserInfo;
|
|
||||||
|
|
||||||
public class HomeDynamicInfo extends BaseUserInfo {
|
|
||||||
private long dynamicId;
|
|
||||||
|
|
||||||
private String roomUid;
|
|
||||||
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
private boolean liked;
|
|
||||||
|
|
||||||
private int likeCount;
|
|
||||||
|
|
||||||
private long worldId;
|
|
||||||
|
|
||||||
public long getDynamicId() {
|
|
||||||
return dynamicId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDynamicId(long dynamicId) {
|
|
||||||
this.dynamicId = dynamicId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRoomUid() {
|
|
||||||
return roomUid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoomUid(String roomUid) {
|
|
||||||
this.roomUid = roomUid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getContent() {
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContent(String content) {
|
|
||||||
this.content = content;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isLiked() {
|
|
||||||
return liked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLiked(boolean liked) {
|
|
||||||
this.liked = liked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getLikeCount() {
|
|
||||||
return likeCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLikeCount(int likeCount) {
|
|
||||||
this.likeCount = likeCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getWorldId() {
|
|
||||||
return worldId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWorldId(long worldId) {
|
|
||||||
this.worldId = worldId;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,49 +0,0 @@
|
|||||||
package com.yizhuan.xchat_android_core.home.bean;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class HomePlayInfo {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* uid : 935002
|
|
||||||
* roomId : 170395761
|
|
||||||
* micUsers : [{"uid":935002,"nick":"辅导","avatar":"https://image.zhongjialx.com/default_avatar.png","gender":2}]
|
|
||||||
* micUserCount : 1
|
|
||||||
* onlineNum : 1
|
|
||||||
* isPermitRoom : 2
|
|
||||||
* roomTag : 交友
|
|
||||||
* tagPict : http://image.doudouyuyin.com/FimKEbTsTRGe-o2msp4LWrXgI7DD?imageslim
|
|
||||||
* title : 辅导的房间
|
|
||||||
*/
|
|
||||||
|
|
||||||
private int uid;
|
|
||||||
private int roomId;
|
|
||||||
private int micUserCount;
|
|
||||||
private int onlineNum;
|
|
||||||
private int isPermitRoom;
|
|
||||||
private String roomTag;
|
|
||||||
private String tagPict;
|
|
||||||
private String title;
|
|
||||||
private String avatar;
|
|
||||||
private List<MicUsersBean> micUsers;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public static class MicUsersBean {
|
|
||||||
/**
|
|
||||||
* uid : 935002
|
|
||||||
* nick : 辅导
|
|
||||||
* avatar : https://image.zhongjialx.com/default_avatar.png
|
|
||||||
* gender : 2
|
|
||||||
*/
|
|
||||||
|
|
||||||
private int uid;
|
|
||||||
private String nick;
|
|
||||||
private String avatar;
|
|
||||||
private int gender;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,108 +0,0 @@
|
|||||||
package com.yizhuan.xchat_android_core.home.bean;
|
|
||||||
|
|
||||||
import android.os.Parcel;
|
|
||||||
import android.os.Parcelable;
|
|
||||||
|
|
||||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
|
||||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
|
||||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
|
||||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhouxiangfeng
|
|
||||||
* @date 2017/5/17
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class HomeRoom extends RoomInfo implements Parcelable, Serializable, MultiItemEntity {
|
|
||||||
/**格子布局*/
|
|
||||||
public final static int TYPE_GIRD = 1;
|
|
||||||
/**格子布局不足3个时的填充布局*/
|
|
||||||
public final static int TYPE_GIRD_EMPTY = 2;
|
|
||||||
/**线性横向布局*/
|
|
||||||
public final static int TYPE_LINEAR = 3;
|
|
||||||
|
|
||||||
//性别 1:男 2:女 0 :未知
|
|
||||||
// private int gender;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// private String nick;
|
|
||||||
|
|
||||||
private long erbanNo;
|
|
||||||
|
|
||||||
//角标相关的
|
|
||||||
public String badge;
|
|
||||||
|
|
||||||
/** 是否是靓号,1:靓号 */
|
|
||||||
public boolean hasPrettyErbanNo;
|
|
||||||
public NobleInfo nobleUsers;
|
|
||||||
public UserLevelVo userLevelVo;
|
|
||||||
public boolean newUser;
|
|
||||||
|
|
||||||
/**首页星推荐的类型*/
|
|
||||||
private int itemStarType = TYPE_LINEAR;
|
|
||||||
/**房间描述*/
|
|
||||||
private String description;
|
|
||||||
/** 房间技能标签 */
|
|
||||||
private String skillTag;
|
|
||||||
/** 背景图标 */
|
|
||||||
private String icon;
|
|
||||||
|
|
||||||
private List<HomePlayInfo.MicUsersBean> micUsers;
|
|
||||||
|
|
||||||
private boolean crossPking;
|
|
||||||
|
|
||||||
public HomeRoom() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected HomeRoom(Parcel in) {
|
|
||||||
super(in);
|
|
||||||
// gender = in.readInt();
|
|
||||||
// nick = in.readString();
|
|
||||||
erbanNo = in.readLong();
|
|
||||||
badge = in.readString();
|
|
||||||
hasPrettyErbanNo = in.readByte() != 0;
|
|
||||||
newUser = in.readByte() != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
|
||||||
super.writeToParcel(dest, flags);
|
|
||||||
// dest.writeInt(gender);
|
|
||||||
// dest.writeString(nick);
|
|
||||||
dest.writeLong(erbanNo);
|
|
||||||
dest.writeString(badge);
|
|
||||||
dest.writeByte((byte) (hasPrettyErbanNo ? 1 : 0));
|
|
||||||
dest.writeByte((byte) (newUser ? 1 : 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int describeContents() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final Creator<HomeRoom> CREATOR = new Creator<HomeRoom>() {
|
|
||||||
@Override
|
|
||||||
public HomeRoom createFromParcel(Parcel in) {
|
|
||||||
return new HomeRoom(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HomeRoom[] newArray(int size) {
|
|
||||||
return new HomeRoom[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemType() {
|
|
||||||
return itemStarType;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,37 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.home.bean;
|
||||||
|
|
||||||
|
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HomeRoomInfo implements MultiItemEntity {
|
||||||
|
|
||||||
|
public static final int TYPE_ROOM = 1;
|
||||||
|
public static final int TYPE_BANNER = 2;
|
||||||
|
public String roomPwd;
|
||||||
|
private long uid;
|
||||||
|
private long roomId;
|
||||||
|
private int micUserCount;
|
||||||
|
private int onlineNum;
|
||||||
|
private int isPermitRoom;
|
||||||
|
private String roomTag;
|
||||||
|
private String tagPict;
|
||||||
|
private long erbanNo;
|
||||||
|
private String title;
|
||||||
|
private String avatar;
|
||||||
|
//性别 1:男 2:女 0 :未知
|
||||||
|
private int gender;
|
||||||
|
private List<MicUsersBean> micUsers;
|
||||||
|
private List<BannerInfo> bannerVoList;
|
||||||
|
private boolean crossPking;
|
||||||
|
private boolean valid;
|
||||||
|
private boolean isBanner;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemType() {
|
||||||
|
return isBanner ? TYPE_BANNER : TYPE_ROOM;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,19 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.home.bean;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MicUsersBean {
|
||||||
|
/**
|
||||||
|
* uid : 935002
|
||||||
|
* nick : 辅导
|
||||||
|
* avatar : https://image.zhongjialx.com/default_avatar.png
|
||||||
|
* gender : 2
|
||||||
|
*/
|
||||||
|
|
||||||
|
private int uid;
|
||||||
|
private String nick;
|
||||||
|
private String avatar;
|
||||||
|
private int gender;
|
||||||
|
|
||||||
|
}
|
@@ -1,15 +1,12 @@
|
|||||||
package com.yizhuan.xchat_android_core.home.model;
|
package com.yizhuan.xchat_android_core.home.model;
|
||||||
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeDynamicInfo;
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomePlayInfo;
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeTabMapInfo;
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeTagInfo;
|
|
||||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||||
import com.yizhuan.xchat_android_core.community.CommunityConstant;
|
import com.yizhuan.xchat_android_core.community.CommunityConstant;
|
||||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeConcernsInfo;
|
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo;
|
||||||
|
import com.yizhuan.xchat_android_core.home.bean.HomeTabMapInfo;
|
||||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||||
|
|
||||||
@@ -30,41 +27,13 @@ public class GameHomeModel extends BaseModel {
|
|||||||
return GameHomeModel.Helper.INSTANCE;
|
return GameHomeModel.Helper.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Single<List<HomeDynamicInfo>> getHomeDynamic() {
|
|
||||||
return api.apiHomeDynamics(String.valueOf(AuthModel.get().getCurrentUid()),
|
|
||||||
CommunityConstant.VERSION_VALID_TYPE,
|
|
||||||
AuthModel.get().getTicket())
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Single<List<HomePlayInfo>> getHomePlay() {
|
public Single<List<HomeRoomInfo>> getHomePlayV2() {
|
||||||
return api.apiHomePlay()
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Single<List<HomePlayInfo>> getHomePlayV2() {
|
|
||||||
return api.apiHomePlayV2()
|
return api.apiHomePlayV2()
|
||||||
.compose(RxHelper.handleBeanData())
|
.compose(RxHelper.handleBeanData())
|
||||||
.compose(RxHelper.handleSchedulers());
|
.compose(RxHelper.handleSchedulers());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Single<List<HomeTagInfo>> getHomeTag() {
|
|
||||||
return api.apiHomeTag(String.valueOf(AuthModel.get().getCurrentUid()),
|
|
||||||
CommunityConstant.VERSION_VALID_TYPE,
|
|
||||||
AuthModel.get().getTicket())
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Single<List<HomeTabMapInfo>> getHomeTabMap(String tabId, int page, int pageSize) {
|
|
||||||
return api.apiHomeTabMap(tabId, String.valueOf(page), String.valueOf(pageSize), String.valueOf(AuthModel.get().getCurrentUid()),
|
|
||||||
CommunityConstant.VERSION_VALID_TYPE,
|
|
||||||
AuthModel.get().getTicket())
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Single<List<HomeTabMapInfo>> getHomeTabHome(String tabId) {
|
public Single<List<HomeTabMapInfo>> getHomeTabHome(String tabId) {
|
||||||
return api.apiHomeTabHome(null, String.valueOf(AuthModel.get().getCurrentUid()),
|
return api.apiHomeTabHome(null, String.valueOf(AuthModel.get().getCurrentUid()),
|
||||||
@@ -82,13 +51,6 @@ public class GameHomeModel extends BaseModel {
|
|||||||
.compose(RxHelper.handleSchedulers());
|
.compose(RxHelper.handleSchedulers());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Single<List<HomeConcernsInfo>> getHomeConcerns() {
|
|
||||||
return api.apiHomeConcerns(String.valueOf(AuthModel.get().getCurrentUid()),
|
|
||||||
CommunityConstant.VERSION_VALID_TYPE,
|
|
||||||
AuthModel.get().getTicket())
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Single<String> getRoomShortcut() {
|
public Single<String> getRoomShortcut() {
|
||||||
return api.apiRoomShortcut(String.valueOf(AuthModel.get().getCurrentUid()),
|
return api.apiRoomShortcut(String.valueOf(AuthModel.get().getCurrentUid()),
|
||||||
@@ -100,67 +62,14 @@ public class GameHomeModel extends BaseModel {
|
|||||||
|
|
||||||
private interface Api {
|
private interface Api {
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页动态
|
|
||||||
*
|
|
||||||
* @return -
|
|
||||||
*/
|
|
||||||
@GET("/home/dynamic")
|
|
||||||
Single<ServiceResult<List<HomeDynamicInfo>>> apiHomeDynamics(
|
|
||||||
@Query("uid") String uid,
|
|
||||||
@Query("types") String types,
|
|
||||||
@Query("ticket") String ticket);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页交友扩列
|
|
||||||
*
|
|
||||||
* @return -
|
|
||||||
*/
|
|
||||||
@GET("/home/play")
|
|
||||||
Single<ServiceResult<List<HomePlayInfo>>> apiHomePlay();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页聊天交友
|
* 首页聊天交友
|
||||||
*
|
*
|
||||||
* @return -
|
* @return -
|
||||||
*/
|
*/
|
||||||
@GET("/home/roomListV2")
|
@GET("/home/playV2")
|
||||||
Single<ServiceResult<List<HomePlayInfo>>> apiHomePlayV2();
|
Single<ServiceResult<List<HomeRoomInfo>>> apiHomePlayV2();
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页推荐房间标签
|
|
||||||
*
|
|
||||||
* @param uid
|
|
||||||
* @param types
|
|
||||||
* @param ticket
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET("/home/tag")
|
|
||||||
Single<ServiceResult<List<HomeTagInfo>>> apiHomeTag(
|
|
||||||
@Query("uid") String uid,
|
|
||||||
@Query("types") String types,
|
|
||||||
@Query("ticket") String ticket);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页更多房间
|
|
||||||
*
|
|
||||||
* @param tabId
|
|
||||||
* @param page
|
|
||||||
* @param pageSize
|
|
||||||
* @param uid
|
|
||||||
* @param types
|
|
||||||
* @param ticket
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET("/home/tab/map")
|
|
||||||
Single<ServiceResult<List<HomeTabMapInfo>>> apiHomeTabMap(
|
|
||||||
@Query("tabId") String tabId,
|
|
||||||
@Query("page") String page,
|
|
||||||
@Query("pageSize") String pageSize,
|
|
||||||
@Query("uid") String uid,
|
|
||||||
@Query("types") String types,
|
|
||||||
@Query("ticket") String ticket);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页推荐房间
|
* 首页推荐房间
|
||||||
@@ -194,19 +103,6 @@ public class GameHomeModel extends BaseModel {
|
|||||||
@Query("types") String types,
|
@Query("types") String types,
|
||||||
@Query("ticket") String ticket);
|
@Query("ticket") String ticket);
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页顶部收藏房间列表
|
|
||||||
*
|
|
||||||
* @param uid
|
|
||||||
* @param types
|
|
||||||
* @param ticket
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET("/home/concerns")
|
|
||||||
Single<ServiceResult<List<HomeConcernsInfo>>> apiHomeConcerns(
|
|
||||||
@Query("uid") String uid,
|
|
||||||
@Query("types") String types,
|
|
||||||
@Query("ticket") String ticket);
|
|
||||||
|
|
||||||
@GET("/room/shortcut/recommend")
|
@GET("/room/shortcut/recommend")
|
||||||
Single<ServiceResult<String>> apiRoomShortcut(
|
Single<ServiceResult<String>> apiRoomShortcut(
|
||||||
|
@@ -85,45 +85,6 @@ object HomeModel : BaseModel() {
|
|||||||
}.compose(RxHelper.handleSchAndExce())
|
}.compose(RxHelper.handleSchAndExce())
|
||||||
}
|
}
|
||||||
|
|
||||||
val homePlay: Single<List<HomePlayInfo>>
|
|
||||||
get() = api.apiHomePlay()
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers())
|
|
||||||
|
|
||||||
val homePlayV2: Single<List<HomePlayInfo>>
|
|
||||||
get() = api.apiHomePlayV2()
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers())
|
|
||||||
|
|
||||||
val homeTag: Single<List<HomeTagInfo>>
|
|
||||||
get() = api.apiHomeTag(
|
|
||||||
AuthModel.get().currentUid.toString(),
|
|
||||||
CommunityConstant.VERSION_VALID_TYPE,
|
|
||||||
AuthModel.get().ticket
|
|
||||||
)
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers())
|
|
||||||
|
|
||||||
fun getHomeTabMap(tabId: String, page: Int, pageSize: Int): Single<List<HomeTabMapInfo>> {
|
|
||||||
return api.apiHomeTabMap(
|
|
||||||
tabId, page.toString(), pageSize.toString(), AuthModel.get().currentUid.toString(),
|
|
||||||
CommunityConstant.VERSION_VALID_TYPE,
|
|
||||||
AuthModel.get().ticket
|
|
||||||
)
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers())
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getHomeTabHome(tabId: String): Single<List<HomeTabMapInfo>> {
|
|
||||||
return api.apiHomeTabHome(
|
|
||||||
tabId, AuthModel.get().currentUid.toString(),
|
|
||||||
CommunityConstant.VERSION_VALID_TYPE,
|
|
||||||
AuthModel.get().ticket
|
|
||||||
)
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers())
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun getHomeBanner(type: String): List<BannerInfo>? =
|
suspend fun getHomeBanner(type: String): List<BannerInfo>? =
|
||||||
launchRequest {
|
launchRequest {
|
||||||
api.apiHomeBanner(
|
api.apiHomeBanner(
|
||||||
@@ -133,12 +94,12 @@ object HomeModel : BaseModel() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getHotRoom(pageNum: Int, pageSize: Int): List<HomeRoom>? =
|
suspend fun getHotRoom(): List<HomeRoomInfo>? =
|
||||||
launchRequest {
|
launchRequest {
|
||||||
api.getHotRoom(pageNum, pageSize)
|
api.getHotRoom()
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getCommonRoom(tabId: Int, pageNum: Int, pageSize: Int): List<HomeRoom>? =
|
suspend fun getCommonRoom(tabId: Int, pageNum: Int, pageSize: Int): List<HomeRoomInfo>? =
|
||||||
launchRequest {
|
launchRequest {
|
||||||
api.getCommonRoom(tabId, pageNum, pageSize)
|
api.getCommonRoom(tabId, pageNum, pageSize)
|
||||||
}
|
}
|
||||||
@@ -154,30 +115,12 @@ object HomeModel : BaseModel() {
|
|||||||
api.getConcernsRoom()
|
api.getConcernsRoom()
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getCollectRoom(pageNum: Int, pageSize: Int): List<HomeRoom>? =
|
suspend fun getCollectRoom(pageNum: Int, pageSize: Int): CollectionRoomInfo? =
|
||||||
launchRequest {
|
launchRequest {
|
||||||
api.getCollectRoom(AuthModel.get().currentUid,pageNum, pageSize)
|
api.getCollectRoom(AuthModel.get().currentUid, pageNum, pageSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
val homeConcerns: Single<List<HomeConcernsInfo>>
|
|
||||||
get() = api.apiHomeConcerns(
|
|
||||||
AuthModel.get().currentUid.toString(),
|
|
||||||
CommunityConstant.VERSION_VALID_TYPE,
|
|
||||||
AuthModel.get().ticket
|
|
||||||
)
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers())
|
|
||||||
|
|
||||||
val roomShortcut: Single<String>
|
|
||||||
get() = api.apiRoomShortcut(
|
|
||||||
AuthModel.get().currentUid.toString(),
|
|
||||||
CommunityConstant.VERSION_VALID_TYPE,
|
|
||||||
AuthModel.get().ticket
|
|
||||||
)
|
|
||||||
.compose(RxHelper.handleBeanData())
|
|
||||||
.compose(RxHelper.handleSchedulers())
|
|
||||||
|
|
||||||
private interface Api {
|
private interface Api {
|
||||||
/**
|
/**
|
||||||
* 提交反馈
|
* 提交反馈
|
||||||
@@ -196,14 +139,6 @@ object HomeModel : BaseModel() {
|
|||||||
@Query("ticket") ticket: String
|
@Query("ticket") ticket: String
|
||||||
): Single<ServiceResult<*>>
|
): Single<ServiceResult<*>>
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取首页tab数据
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@get:GET("/room/tag/v3/top")
|
|
||||||
val mainTabList: Single<ServiceResult<List<TabInfo>>>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取新人列表
|
* 获取新人列表
|
||||||
*
|
*
|
||||||
@@ -226,76 +161,6 @@ object HomeModel : BaseModel() {
|
|||||||
@POST("interactive/unreadCount")
|
@POST("interactive/unreadCount")
|
||||||
fun getUnreadCount(@Query("uid") uid: Long): Single<ServiceResult<UnReadCountInfo>>
|
fun getUnreadCount(@Query("uid") uid: Long): Single<ServiceResult<UnReadCountInfo>>
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页交友扩列
|
|
||||||
*
|
|
||||||
* @return -
|
|
||||||
*/
|
|
||||||
@GET("/home/play")
|
|
||||||
fun apiHomePlay(): Single<ServiceResult<List<HomePlayInfo>>>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页聊天交友
|
|
||||||
*
|
|
||||||
* @return -
|
|
||||||
*/
|
|
||||||
@GET("/home/roomListV2")
|
|
||||||
fun apiHomePlayV2(): Single<ServiceResult<List<HomePlayInfo>>>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页推荐房间标签
|
|
||||||
*
|
|
||||||
* @param uid
|
|
||||||
* @param types
|
|
||||||
* @param ticket
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET("/home/tag")
|
|
||||||
fun apiHomeTag(
|
|
||||||
@Query("uid") uid: String,
|
|
||||||
@Query("types") types: String,
|
|
||||||
@Query("ticket") ticket: String
|
|
||||||
): Single<ServiceResult<List<HomeTagInfo>>>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页更多房间
|
|
||||||
*
|
|
||||||
* @param tabId
|
|
||||||
* @param page
|
|
||||||
* @param pageSize
|
|
||||||
* @param uid
|
|
||||||
* @param types
|
|
||||||
* @param ticket
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET("/home/tab/map")
|
|
||||||
fun apiHomeTabMap(
|
|
||||||
@Query("tabId") tabId: String,
|
|
||||||
@Query("page") page: String,
|
|
||||||
@Query("pageSize") pageSize: String,
|
|
||||||
@Query("uid") uid: String,
|
|
||||||
@Query("types") types: String,
|
|
||||||
@Query("ticket") ticket: String
|
|
||||||
): Single<ServiceResult<List<HomeTabMapInfo>>>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页推荐房间
|
|
||||||
*
|
|
||||||
* @param tabId
|
|
||||||
* @param uid
|
|
||||||
* @param types
|
|
||||||
* @param ticket
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET("/home/tab/home")
|
|
||||||
fun apiHomeTabHome(
|
|
||||||
@Query("tabId") tabId: String,
|
|
||||||
@Query("uid") uid: String,
|
|
||||||
@Query("types") types: String,
|
|
||||||
@Query("ticket") ticket: String
|
|
||||||
): Single<ServiceResult<List<HomeTabMapInfo>>>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页Banner
|
* 首页Banner
|
||||||
*
|
*
|
||||||
@@ -319,10 +184,7 @@ object HomeModel : BaseModel() {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GET("/home/hotRoom")
|
@GET("/home/hotRoom")
|
||||||
suspend fun getHotRoom(
|
suspend fun getHotRoom(): ServiceResult<List<HomeRoomInfo>>
|
||||||
@Query("pageNum") pageNum: Int,
|
|
||||||
@Query("pageSize") pageSize: Int
|
|
||||||
): ServiceResult<List<HomeRoom>>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页热门房间
|
* 首页热门房间
|
||||||
@@ -334,7 +196,7 @@ object HomeModel : BaseModel() {
|
|||||||
@Query("tabId") tabId: Int,
|
@Query("tabId") tabId: Int,
|
||||||
@Query("pageNum") pageNum: Int,
|
@Query("pageNum") pageNum: Int,
|
||||||
@Query("pageSize") pageSize: Int
|
@Query("pageSize") pageSize: Int
|
||||||
): ServiceResult<List<HomeRoom>>
|
): ServiceResult<List<HomeRoomInfo>>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页派对 Tag List
|
* 首页派对 Tag List
|
||||||
@@ -352,7 +214,6 @@ object HomeModel : BaseModel() {
|
|||||||
@GET("/fans/partTabFollowList")
|
@GET("/fans/partTabFollowList")
|
||||||
suspend fun getConcernsRoom(): ServiceResult<List<HomeConcernsInfo>>
|
suspend fun getConcernsRoom(): ServiceResult<List<HomeConcernsInfo>>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页派对 Tag List
|
* 首页派对 Tag List
|
||||||
*
|
*
|
||||||
@@ -363,30 +224,8 @@ object HomeModel : BaseModel() {
|
|||||||
@Query("uid") uid: Long,
|
@Query("uid") uid: Long,
|
||||||
@Query("page") pageNum: Int,
|
@Query("page") pageNum: Int,
|
||||||
@Query("pageSize") pageSize: Int
|
@Query("pageSize") pageSize: Int
|
||||||
): ServiceResult<List<HomeRoom>>
|
): ServiceResult<CollectionRoomInfo>
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页顶部收藏房间列表
|
|
||||||
*
|
|
||||||
* @param uid
|
|
||||||
* @param types
|
|
||||||
* @param ticket
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET("/home/concerns")
|
|
||||||
fun apiHomeConcerns(
|
|
||||||
@Query("uid") uid: String,
|
|
||||||
@Query("types") types: String,
|
|
||||||
@Query("ticket") ticket: String
|
|
||||||
): Single<ServiceResult<List<HomeConcernsInfo>>>
|
|
||||||
|
|
||||||
|
|
||||||
@GET("/room/shortcut/recommend")
|
|
||||||
fun apiRoomShortcut(
|
|
||||||
@Query("uid") uid: String,
|
|
||||||
@Query("types") types: String,
|
|
||||||
@Query("ticket") ticket: String
|
|
||||||
): Single<ServiceResult<String>>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -147,4 +147,6 @@ public class InitInfo implements Serializable {
|
|||||||
private List<Long> checkUids;
|
private List<Long> checkUids;
|
||||||
|
|
||||||
private boolean checkInviteCode;
|
private boolean checkInviteCode;
|
||||||
|
|
||||||
|
private List<String> homeTabList;
|
||||||
}
|
}
|
||||||
|
@@ -1,81 +0,0 @@
|
|||||||
package com.yizhuan.xchat_android_core.user.bean;
|
|
||||||
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom;
|
|
||||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
|
||||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class RecommendationUserInfo implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 推荐房间
|
|
||||||
*/
|
|
||||||
public transient static final int STATUS_RECOMMEND_ROOM = -1;
|
|
||||||
public transient static final int STATUS_NORMAL = 0;
|
|
||||||
public transient static final int STATUS_KTV = 1;
|
|
||||||
public transient static final int STATUS_GAME = 2;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public transient static final int STATUS_ROOM = 3;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* uid : 902562
|
|
||||||
* gender : 1
|
|
||||||
* nick : 啊占
|
|
||||||
* avatar : https://image.zhongjialx.com/picture_1543394374687.jpg?imageslim
|
|
||||||
* distance : 1.1131949091474181E-4
|
|
||||||
* recommendRoom : false
|
|
||||||
* liveTag : false
|
|
||||||
* status : 0
|
|
||||||
* description : 她在音游魅力四射...
|
|
||||||
*/
|
|
||||||
|
|
||||||
private int uid;
|
|
||||||
private int gender;
|
|
||||||
private String nick;
|
|
||||||
private String avatar;
|
|
||||||
private Double distance;
|
|
||||||
/**
|
|
||||||
* 用于显示距离字符串,带单位
|
|
||||||
*/
|
|
||||||
private String distanceStr;
|
|
||||||
private boolean recommendRoom;
|
|
||||||
private boolean liveTag;
|
|
||||||
/**
|
|
||||||
* 用户等级
|
|
||||||
*/
|
|
||||||
private UserLevelVo userLevelVo;
|
|
||||||
/**
|
|
||||||
* 贵族信息
|
|
||||||
*/
|
|
||||||
private NobleInfo nobleUsers;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态
|
|
||||||
*/
|
|
||||||
private int status;
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 房间信息
|
|
||||||
*/
|
|
||||||
private HomeRoom roomVo;
|
|
||||||
/**
|
|
||||||
* 用户技能标签
|
|
||||||
*/
|
|
||||||
private String skillTag;
|
|
||||||
/**
|
|
||||||
* 在线人数
|
|
||||||
*/
|
|
||||||
private Integer onlineNum;
|
|
||||||
private int age;
|
|
||||||
|
|
||||||
private UserInfo.NamePlate nameplate;
|
|
||||||
}
|
|
||||||
|
|
Reference in New Issue
Block a user