房间心愿单:入口显示逻辑优化,是否开启心愿单判断方式修改
This commit is contained in:
@@ -516,6 +516,10 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
|||||||
pagerViewWishList?.let { pagerViewWishList ->
|
pagerViewWishList?.let { pagerViewWishList ->
|
||||||
val adapter = object : StaticPagerAdapter() {
|
val adapter = object : StaticPagerAdapter() {
|
||||||
var wishGiftList: List<WishItemInfo>? = null
|
var wishGiftList: List<WishItemInfo>? = null
|
||||||
|
set(value) {
|
||||||
|
pagerViewWishList.isVisible = !value.isNullOrEmpty()
|
||||||
|
field = value
|
||||||
|
}
|
||||||
override fun getCount(): Int {
|
override fun getCount(): Int {
|
||||||
return wishGiftList?.size ?: 0
|
return wishGiftList?.size ?: 0
|
||||||
}
|
}
|
||||||
|
@@ -53,7 +53,7 @@ class WishListCreateActivity : BaseViewBindingActivity<ActivityWishListCreateBin
|
|||||||
.setAdapter(WishListAdapter())
|
.setAdapter(WishListAdapter())
|
||||||
.build()
|
.build()
|
||||||
rvDelegate.adapter.setOnItemChildClickListener { _, view, position ->
|
rvDelegate.adapter.setOnItemChildClickListener { _, view, position ->
|
||||||
if (isCreatedWishList()) {
|
if (AvRoomDataManager.get().isHasOpenWishGift) {
|
||||||
SingleToastUtil.showToast(tips)
|
SingleToastUtil.showToast(tips)
|
||||||
return@setOnItemChildClickListener
|
return@setOnItemChildClickListener
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ class WishListCreateActivity : BaseViewBindingActivity<ActivityWishListCreateBin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.tvAddWish.setOnClickListener {
|
binding.tvAddWish.setOnClickListener {
|
||||||
if (isCreatedWishList()) {
|
if (AvRoomDataManager.get().isHasOpenWishGift) {
|
||||||
SingleToastUtil.showToast(tips)
|
SingleToastUtil.showToast(tips)
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ class WishListCreateActivity : BaseViewBindingActivity<ActivityWishListCreateBin
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.tvCreateWish.setOnClickListener {
|
binding.tvCreateWish.setOnClickListener {
|
||||||
if (isCreatedWishList()) {
|
if (AvRoomDataManager.get().isHasOpenWishGift) {
|
||||||
SingleToastUtil.showToast(tips)
|
SingleToastUtil.showToast(tips)
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ class WishListCreateActivity : BaseViewBindingActivity<ActivityWishListCreateBin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.tvCleanWish.setOnClickListener {
|
binding.tvCleanWish.setOnClickListener {
|
||||||
if (isCreatedWishList()) {
|
if (AvRoomDataManager.get().isHasOpenWishGift) {
|
||||||
SingleToastUtil.showToast(tips)
|
SingleToastUtil.showToast(tips)
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
@@ -131,10 +131,6 @@ class WishListCreateActivity : BaseViewBindingActivity<ActivityWishListCreateBin
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isCreatedWishList(): Boolean {
|
|
||||||
return !AvRoomDataManager.get().wishGiftLiveData.value.isNullOrEmpty()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
viewModel.getRoomWishGiftList()
|
viewModel.getRoomWishGiftList()
|
||||||
|
@@ -123,7 +123,8 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_below="@id/ll_room_pk_order"
|
android:layout_below="@id/ll_room_pk_order"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_marginTop="5dp" />
|
android:layout_marginTop="5dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_hour_rank"
|
android:id="@+id/tv_hour_rank"
|
||||||
|
@@ -98,6 +98,7 @@
|
|||||||
android:layout_width="80dp"
|
android:layout_width="80dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/contribute_list" />
|
app:layout_constraintTop_toBottomOf="@id/contribute_list" />
|
||||||
|
|
||||||
|
@@ -1370,8 +1370,9 @@ public final class IMNetEaseManager {
|
|||||||
WishListAttachment wishListAttachment = (WishListAttachment) attachment;
|
WishListAttachment wishListAttachment = (WishListAttachment) attachment;
|
||||||
switch (second) {
|
switch (second) {
|
||||||
case CUSTOM_MSG_WISH_LIST_OPEN:
|
case CUSTOM_MSG_WISH_LIST_OPEN:
|
||||||
|
AvRoomDataManager.get().setHasOpenWishGift(true);
|
||||||
case CUSTOM_MSG_WISH_LIST_UPDATE:
|
case CUSTOM_MSG_WISH_LIST_UPDATE:
|
||||||
AvRoomDataManager.get().wishGiftLiveData.setValue(wishListAttachment.getWishItemInfos());
|
AvRoomDataManager.get().wishGiftLiveData.setValue(wishListAttachment.getGifts());
|
||||||
break;
|
break;
|
||||||
case CUSTOM_MSG_WISH_LIST_FINISH:
|
case CUSTOM_MSG_WISH_LIST_FINISH:
|
||||||
addMessages(msg);
|
addMessages(msg);
|
||||||
|
@@ -13,7 +13,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class WishListAttachment extends CustomAttachment {
|
public class WishListAttachment extends CustomAttachment {
|
||||||
private long roomUid;
|
private long roomUid;
|
||||||
private List<WishItemInfo> wishItemInfos;
|
private List<WishItemInfo> gifts;
|
||||||
|
|
||||||
|
|
||||||
public WishListAttachment(int first, int second) {
|
public WishListAttachment(int first, int second) {
|
||||||
@@ -28,20 +28,19 @@ public class WishListAttachment extends CustomAttachment {
|
|||||||
this.roomUid = roomUid;
|
this.roomUid = roomUid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<WishItemInfo> getWishItemInfos() {
|
public List<WishItemInfo> getGifts() {
|
||||||
return wishItemInfos;
|
return gifts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWishItemInfos(List<WishItemInfo> wishItemInfos) {
|
public void setGifts(List<WishItemInfo> gifts) {
|
||||||
this.wishItemInfos = wishItemInfos;
|
this.gifts = gifts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void parseData(JSONObject data) {
|
protected void parseData(JSONObject data) {
|
||||||
roomUid = data.getLongValue("roomUid");
|
roomUid = data.getLongValue("roomUid");
|
||||||
wishItemInfos = data.getObject("wishItemInfos", new TypeReference<List<List<Integer>>>() {
|
gifts = data.getObject("gifts", new TypeReference<List<List<Integer>>>() {
|
||||||
}.getType());
|
}.getType());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1328,6 +1328,10 @@ public final class AvRoomDataManager {
|
|||||||
return hasOpenWishGift;
|
return hasOpenWishGift;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setHasOpenWishGift(boolean hasOpenWishGift) {
|
||||||
|
this.hasOpenWishGift = hasOpenWishGift;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isLimitEnterRoom(String roomUid) {
|
public boolean isLimitEnterRoom(String roomUid) {
|
||||||
initKickOutRoomUids();
|
initKickOutRoomUids();
|
||||||
Long limitTime = kickOutRoomUids.get(roomUid);
|
Long limitTime = kickOutRoomUids.get(roomUid);
|
||||||
|
Reference in New Issue
Block a user