房间心愿单:心愿面板,心愿单房间入口
This commit is contained in:
@@ -111,9 +111,9 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
|||||||
rvOPtList.setLayoutManager(new FullyGridLayoutManager(getContext(), 5));
|
rvOPtList.setLayoutManager(new FullyGridLayoutManager(getContext(), 5));
|
||||||
optAdapter = new OptAdapter(context, null);
|
optAdapter = new OptAdapter(context, null);
|
||||||
addDatingAction(optAdapter);
|
addDatingAction(optAdapter);
|
||||||
|
addWishListAction(optAdapter);
|
||||||
addPKAction(optAdapter);
|
addPKAction(optAdapter);
|
||||||
addRoomPKAction(optAdapter);
|
addRoomPKAction(optAdapter);
|
||||||
addWishListAction(optAdapter);
|
|
||||||
addSingleRoomPKAction(optAdapter);
|
addSingleRoomPKAction(optAdapter);
|
||||||
addSendBroadcastAction(optAdapter);
|
addSendBroadcastAction(optAdapter);
|
||||||
addInviteFansOptAdapter();
|
addInviteFansOptAdapter();
|
||||||
@@ -223,25 +223,21 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跨房PK
|
* 心愿礼物
|
||||||
*
|
*
|
||||||
* @param optAdapter
|
* @param optAdapter
|
||||||
*/
|
*/
|
||||||
private void addWishListAction(OptAdapter optAdapter) {
|
private void addWishListAction(OptAdapter optAdapter) {
|
||||||
if (SuperAdminUtil.isSuperAdmin()) {
|
if (!AvRoomDataManager.get().isHasWishGiftPermit()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (AvRoomDataManager.get().isOpenGame()) {
|
if (!AvRoomDataManager.get().isRoomOwner() &&
|
||||||
return;
|
!AvRoomDataManager.get().isManager() &&
|
||||||
}
|
!AvRoomDataManager.get().isSuperAdmin()) {
|
||||||
|
|
||||||
if (!AvRoomDataManager.get().isRoomOwner()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String str = "心愿礼物";
|
String str = "心愿礼物";
|
||||||
int icon = AvRoomDataManager.get().isOpenAnotherPKMode() ?
|
int icon = R.drawable.ic_room_opt_wish_entrance;
|
||||||
R.drawable.ic_room_opt_another_pk_in :
|
|
||||||
R.drawable.ic_room_opt_another_pk_open;
|
|
||||||
optAdapter.addData(new OptAction(icon, str, () -> {
|
optAdapter.addData(new OptAction(icon, str, () -> {
|
||||||
Map<String, String> arguments = new HashMap<>();
|
Map<String, String> arguments = new HashMap<>();
|
||||||
arguments.put("name", str);
|
arguments.put("name", str);
|
||||||
|
@@ -11,17 +11,22 @@ import android.graphics.drawable.Drawable
|
|||||||
import android.graphics.drawable.GradientDrawable
|
import android.graphics.drawable.GradientDrawable
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
|
import android.text.style.ForegroundColorSpan
|
||||||
|
import android.view.LayoutInflater
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
import android.view.ViewStub
|
import android.view.ViewStub
|
||||||
import android.view.animation.AnimationUtils
|
import android.view.animation.AnimationUtils
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.EditText
|
import android.widget.EditText
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
import android.widget.ProgressBar
|
||||||
import android.widget.RelativeLayout
|
import android.widget.RelativeLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.annotation.CallSuper
|
import androidx.annotation.CallSuper
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.core.graphics.toColorInt
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
@@ -55,6 +60,7 @@ import com.mango.core.room.event.RoomClearScreenEvent
|
|||||||
import com.mango.core.room.game.GameStatus
|
import com.mango.core.room.game.GameStatus
|
||||||
import com.mango.core.room.giftvalue.helper.GiftValueMrg
|
import com.mango.core.room.giftvalue.helper.GiftValueMrg
|
||||||
import com.mango.core.room.queue.bean.MicMemberInfo
|
import com.mango.core.room.queue.bean.MicMemberInfo
|
||||||
|
import com.mango.core.room.wishlist.WishItemInfo
|
||||||
import com.mango.core.share.bean.SessionType
|
import com.mango.core.share.bean.SessionType
|
||||||
import com.mango.core.statistic.StatisticManager
|
import com.mango.core.statistic.StatisticManager
|
||||||
import com.mango.core.statistic.protocol.StatisticsProtocol
|
import com.mango.core.statistic.protocol.StatisticsProtocol
|
||||||
@@ -83,6 +89,7 @@ import com.mango.moshen.avroom.view.IBaseRoomView
|
|||||||
import com.mango.moshen.avroom.widget.BottomView
|
import com.mango.moshen.avroom.widget.BottomView
|
||||||
import com.mango.moshen.avroom.widget.MessageView
|
import com.mango.moshen.avroom.widget.MessageView
|
||||||
import com.mango.moshen.avroom.widget.MicroView
|
import com.mango.moshen.avroom.widget.MicroView
|
||||||
|
import com.mango.moshen.avroom.wishlist.WishListPanelDialog
|
||||||
import com.mango.moshen.base.BaseMvpActivity
|
import com.mango.moshen.base.BaseMvpActivity
|
||||||
import com.mango.moshen.base.BaseMvpFragment
|
import com.mango.moshen.base.BaseMvpFragment
|
||||||
import com.mango.moshen.event.OpenRoomIntroEvent
|
import com.mango.moshen.event.OpenRoomIntroEvent
|
||||||
@@ -93,6 +100,7 @@ import com.mango.moshen.music.widget.MusicPlayerView
|
|||||||
import com.mango.moshen.room_chat.activity.RoomMsgActivity
|
import com.mango.moshen.room_chat.activity.RoomMsgActivity
|
||||||
import com.mango.moshen.shipantics.PullRadishActivity
|
import com.mango.moshen.shipantics.PullRadishActivity
|
||||||
import com.mango.moshen.treasure_box.widget.GoldBoxHelper
|
import com.mango.moshen.treasure_box.widget.GoldBoxHelper
|
||||||
|
import com.mango.moshen.ui.utils.load
|
||||||
import com.mango.moshen.ui.utils.loadAvatar
|
import com.mango.moshen.ui.utils.loadAvatar
|
||||||
import com.mango.moshen.ui.webview.DialogWebViewActivity
|
import com.mango.moshen.ui.webview.DialogWebViewActivity
|
||||||
import com.mango.moshen.ui.widget.ButtonItem
|
import com.mango.moshen.ui.widget.ButtonItem
|
||||||
@@ -104,8 +112,11 @@ import com.mango.moshen.ui.widget.dynamicface.DynamicFaceDialog
|
|||||||
import com.mango.moshen.ui.widget.magicindicator.buildins.UIUtil
|
import com.mango.moshen.ui.widget.magicindicator.buildins.UIUtil
|
||||||
import com.mango.moshen.ui.widget.rollviewpager.RollPagerView
|
import com.mango.moshen.ui.widget.rollviewpager.RollPagerView
|
||||||
import com.mango.moshen.ui.widget.rollviewpager.Util
|
import com.mango.moshen.ui.widget.rollviewpager.Util
|
||||||
|
import com.mango.moshen.ui.widget.rollviewpager.adapter.StaticPagerAdapter
|
||||||
import com.mango.moshen.ui.widget.rollviewpager.hintview.ColorPointHintView
|
import com.mango.moshen.ui.widget.rollviewpager.hintview.ColorPointHintView
|
||||||
import com.mango.moshen.utils.KeyBoardUtils
|
import com.mango.moshen.utils.KeyBoardUtils
|
||||||
|
import com.mango.moshen.utils.SpannableBuilder
|
||||||
|
import com.mango.moshen.vip.VipMainActivity
|
||||||
import com.mango.xchat_android_constants.XChatConstants
|
import com.mango.xchat_android_constants.XChatConstants
|
||||||
import com.mango.xchat_android_library.net.rxnet.utils.RxNetWorkUtils
|
import com.mango.xchat_android_library.net.rxnet.utils.RxNetWorkUtils
|
||||||
import com.mango.xchat_android_library.rxbus.RxBus
|
import com.mango.xchat_android_library.rxbus.RxBus
|
||||||
@@ -149,6 +160,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
|||||||
private var mVsMusicPlayer: ViewStub? = null
|
private var mVsMusicPlayer: ViewStub? = null
|
||||||
private var ivMusicFlag: ImageView? = null
|
private var ivMusicFlag: ImageView? = null
|
||||||
private var mDisposable: Disposable? = null
|
private var mDisposable: Disposable? = null
|
||||||
|
private var pagerViewWishList: RollPagerView? = null
|
||||||
private var isCloseScreen = false
|
private var isCloseScreen = false
|
||||||
private var isOpenRedPackage = false
|
private var isOpenRedPackage = false
|
||||||
private val llBox: View by lazy { mView.findViewById(R.id.ll_box) }
|
private val llBox: View by lazy { mView.findViewById(R.id.ll_box) }
|
||||||
@@ -195,6 +207,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
|||||||
mVsMusicPlayer = mView.findViewById(R.id.vs_music_player)
|
mVsMusicPlayer = mView.findViewById(R.id.vs_music_player)
|
||||||
ivMusicFlag = mView.findViewById(R.id.iv_music_flag)
|
ivMusicFlag = mView.findViewById(R.id.iv_music_flag)
|
||||||
ivRadishEntrance = mView.findViewById(R.id.iv_radish_entrance)
|
ivRadishEntrance = mView.findViewById(R.id.iv_radish_entrance)
|
||||||
|
pagerViewWishList = mView.findViewById(R.id.pager_view_wish_list)
|
||||||
messageView.setClickConsumer {
|
messageView.setClickConsumer {
|
||||||
if (!TextUtils.isEmpty(it) && it != "0") {
|
if (!TextUtils.isEmpty(it) && it != "0") {
|
||||||
showUserCardDialog(it)
|
showUserCardDialog(it)
|
||||||
@@ -499,6 +512,54 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun initVipPager() {
|
||||||
|
pagerViewWishList?.let { pagerViewWishList ->
|
||||||
|
val adapter = object : StaticPagerAdapter() {
|
||||||
|
var wishGiftList: List<WishItemInfo>? = null
|
||||||
|
override fun getCount(): Int {
|
||||||
|
return wishGiftList?.size ?: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
override fun getView(container: ViewGroup, position: Int): View {
|
||||||
|
val rootView = LayoutInflater.from(mContext)
|
||||||
|
.inflate(R.layout.item_wish_list_entrance, null)
|
||||||
|
wishGiftList?.getOrNull(position)?.let {
|
||||||
|
rootView.findViewById<ImageView>(R.id.iv_gift).load(it.giftUrl)
|
||||||
|
rootView.findViewById<TextView>(R.id.tv_gift_name).text = it.giftName
|
||||||
|
val isComplete = it.actualNum == it.targetNum
|
||||||
|
rootView.findViewById<TextView>(R.id.tv_progress).text =
|
||||||
|
SpannableBuilder()
|
||||||
|
.append(
|
||||||
|
"${it.actualNum}",
|
||||||
|
ForegroundColorSpan(("#FFC300".toColorInt()))
|
||||||
|
)
|
||||||
|
.append(
|
||||||
|
"/${it.targetNum}",
|
||||||
|
ForegroundColorSpan((if (isComplete) "#FFC300" else "#FFFFFF").toColorInt())
|
||||||
|
)
|
||||||
|
.build()
|
||||||
|
val progressBar = rootView.findViewById<ProgressBar>(R.id.progress_bar)
|
||||||
|
progressBar.max = it.targetNum
|
||||||
|
progressBar.progress = it.actualNum
|
||||||
|
}
|
||||||
|
rootView.setOnClickListener {
|
||||||
|
WishListPanelDialog.newInstance().show(mContext)
|
||||||
|
}
|
||||||
|
return rootView
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pagerViewWishList.adapter = adapter
|
||||||
|
AvRoomDataManager.get().wishGiftLiveData.observe(viewLifecycleOwner) {
|
||||||
|
adapter.wishGiftList = it
|
||||||
|
adapter.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
pagerViewWishList.setPlayDelay(5000)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun releaseView() {
|
private fun releaseView() {
|
||||||
messageView.release()
|
messageView.release()
|
||||||
microView.release()
|
microView.release()
|
||||||
@@ -510,6 +571,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
|||||||
open fun updateView() {
|
open fun updateView() {
|
||||||
// 更新底栏
|
// 更新底栏
|
||||||
showBottomViewForDifRole()
|
showBottomViewForDifRole()
|
||||||
|
initVipPager()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -14,6 +14,7 @@ import com.google.gson.JsonElement;
|
|||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.mango.core.room.wishlist.WishListModel;
|
||||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomInfo;
|
import com.netease.nimlib.sdk.chatroom.model.ChatRoomInfo;
|
||||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
||||||
import com.netease.nimlib.sdk.chatroom.model.EnterChatRoomResultData;
|
import com.netease.nimlib.sdk.chatroom.model.EnterChatRoomResultData;
|
||||||
@@ -152,6 +153,12 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
|||||||
.compose(bindToLifecycle())
|
.compose(bindToLifecycle())
|
||||||
.subscribe(roomPkBean -> AvRoomDataManager.get().roomPkLiveData.setValue(roomPkBean));
|
.subscribe(roomPkBean -> AvRoomDataManager.get().roomPkLiveData.setValue(roomPkBean));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AvRoomDataManager.get().isHasOpenWishGift()) {
|
||||||
|
WishListModel.INSTANCE.getRoomWishGiftListWithJava()
|
||||||
|
.compose(bindToLifecycle())
|
||||||
|
.subscribe(wishItemInfos -> AvRoomDataManager.get().wishGiftLiveData.setValue(wishItemInfos));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dealEnterRoomError(Throwable throwable) {
|
private void dealEnterRoomError(Throwable throwable) {
|
||||||
|
@@ -8,6 +8,7 @@ import androidx.activity.viewModels
|
|||||||
import androidx.core.graphics.toColorInt
|
import androidx.core.graphics.toColorInt
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.mango.core.manager.AvRoomDataManager
|
||||||
import com.mango.core.room.wishlist.WishCreateItemInfo
|
import com.mango.core.room.wishlist.WishCreateItemInfo
|
||||||
import com.mango.core.room.wishlist.WishItemInfo
|
import com.mango.core.room.wishlist.WishItemInfo
|
||||||
import com.mango.core.utils.toast
|
import com.mango.core.utils.toast
|
||||||
@@ -18,6 +19,7 @@ import com.mango.moshen.common.EmptyViewHelper
|
|||||||
import com.mango.moshen.databinding.ActivityWishListCreateBinding
|
import com.mango.moshen.databinding.ActivityWishListCreateBinding
|
||||||
import com.mango.moshen.ui.utils.RVDelegate
|
import com.mango.moshen.ui.utils.RVDelegate
|
||||||
import com.mango.xchat_android_library.annatation.ActLayoutRes
|
import com.mango.xchat_android_library.annatation.ActLayoutRes
|
||||||
|
import com.mango.xchat_android_library.utils.SingleToastUtil
|
||||||
import com.netease.nim.uikit.StatusBarUtil
|
import com.netease.nim.uikit.StatusBarUtil
|
||||||
import com.netease.nim.uikit.common.ui.recyclerview.decoration.DividerItemDecoration
|
import com.netease.nim.uikit.common.ui.recyclerview.decoration.DividerItemDecoration
|
||||||
|
|
||||||
@@ -34,6 +36,7 @@ class WishListCreateActivity : BaseViewBindingActivity<ActivityWishListCreateBin
|
|||||||
|
|
||||||
private lateinit var rvDelegate: RVDelegate<WishItemInfo>
|
private lateinit var rvDelegate: RVDelegate<WishItemInfo>
|
||||||
private val viewModel: WishListViewModel by viewModels()
|
private val viewModel: WishListViewModel by viewModels()
|
||||||
|
private val tips = "心愿单已创建,当日不能再进行操作!"
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
@@ -50,6 +53,10 @@ class WishListCreateActivity : BaseViewBindingActivity<ActivityWishListCreateBin
|
|||||||
.setAdapter(WishListAdapter())
|
.setAdapter(WishListAdapter())
|
||||||
.build()
|
.build()
|
||||||
rvDelegate.adapter.setOnItemChildClickListener { _, view, position ->
|
rvDelegate.adapter.setOnItemChildClickListener { _, view, position ->
|
||||||
|
if (isCreatedWishList()) {
|
||||||
|
SingleToastUtil.showToast(tips)
|
||||||
|
return@setOnItemChildClickListener
|
||||||
|
}
|
||||||
rvDelegate.adapter.getItem(position)?.let {
|
rvDelegate.adapter.getItem(position)?.let {
|
||||||
when (view.id) {
|
when (view.id) {
|
||||||
R.id.tv_edit -> {
|
R.id.tv_edit -> {
|
||||||
@@ -71,15 +78,27 @@ class WishListCreateActivity : BaseViewBindingActivity<ActivityWishListCreateBin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.tvAddWish.setOnClickListener {
|
binding.tvAddWish.setOnClickListener {
|
||||||
|
if (isCreatedWishList()) {
|
||||||
|
SingleToastUtil.showToast(tips)
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
WishListCreateDialog.newInstance().show(this)
|
WishListCreateDialog.newInstance().show(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.tvCreateWish.setOnClickListener {
|
binding.tvCreateWish.setOnClickListener {
|
||||||
|
if (isCreatedWishList()) {
|
||||||
|
SingleToastUtil.showToast(tips)
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
dialogManager.showOkCancelDialog("确认创建当前心愿?,创建后当日不可再编辑或删除") {
|
dialogManager.showOkCancelDialog("确认创建当前心愿?,创建后当日不可再编辑或删除") {
|
||||||
viewModel.createWishList()
|
viewModel.createWishList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.tvCleanWish.setOnClickListener {
|
binding.tvCleanWish.setOnClickListener {
|
||||||
|
if (isCreatedWishList()) {
|
||||||
|
SingleToastUtil.showToast(tips)
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
dialogManager.showOkCancelDialog("确认清空当前数据?") {
|
dialogManager.showOkCancelDialog("确认清空当前数据?") {
|
||||||
viewModel.delWishItem("-1", -1)
|
viewModel.delWishItem("-1", -1)
|
||||||
}
|
}
|
||||||
@@ -112,6 +131,10 @@ 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()
|
||||||
|
@@ -9,6 +9,7 @@ import android.widget.TextView
|
|||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.mango.core.room.wishlist.WishHistoryInfo
|
||||||
import com.mango.core.room.wishlist.WishItemInfo
|
import com.mango.core.room.wishlist.WishItemInfo
|
||||||
import com.mango.moshen.R
|
import com.mango.moshen.R
|
||||||
import com.mango.moshen.base.BaseViewBindingActivity
|
import com.mango.moshen.base.BaseViewBindingActivity
|
||||||
@@ -35,46 +36,20 @@ class WishListHistoryActivity : BaseViewBindingActivity<ActivityWishListHistoryB
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private lateinit var rvDelegate: RVDelegate<WishItemInfo>
|
private lateinit var rvDelegate: RVDelegate<WishHistoryInfo>
|
||||||
private val viewModel: WishListViewModel by viewModels()
|
private val viewModel: WishListViewModel by viewModels()
|
||||||
private val format = SimpleDateFormat("yyyy年MM月dd日", Locale.getDefault())
|
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
override fun init() {
|
override fun init() {
|
||||||
initTitleBar("历史心愿单")
|
initTitleBar("历史心愿单")
|
||||||
rvDelegate = RVDelegate.Builder<WishItemInfo>()
|
rvDelegate = RVDelegate.Builder<WishHistoryInfo>()
|
||||||
.setLayoutManager(LinearLayoutManager(this))
|
.setLayoutManager(LinearLayoutManager(this))
|
||||||
.setRecyclerView(binding.recyclerView)
|
.setRecyclerView(binding.recyclerView)
|
||||||
.setAdapter(WishListHistoryAdapter())
|
.setAdapter(WishListHistoryTimeAdapter())
|
||||||
.setEmptyView(EmptyViewHelper.createEmptyView(this, "暂无记录"))
|
.setEmptyView(EmptyViewHelper.createEmptyView(this, "暂无记录"))
|
||||||
.build()
|
.build()
|
||||||
viewModel.getWisHistoryList()
|
viewModel.getWisHistoryList()
|
||||||
|
|
||||||
val decoration = PowerfulStickyDecoration.Builder
|
|
||||||
.init(object : PowerGroupListener {
|
|
||||||
override fun getGroupName(position: Int): String? { //获取组名,用于判断是否是同一组
|
|
||||||
rvDelegate.adapter.getItem(position)?.let {
|
|
||||||
return format.format(it.createTime)
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getGroupView(position: Int): View? { //获取自定定义的组View
|
|
||||||
rvDelegate.adapter.getItem(position)?.let {
|
|
||||||
val view =
|
|
||||||
layoutInflater.inflate(R.layout.item_wish_list_history_time, null)
|
|
||||||
view.findViewById<TextView>(R.id.tv).text = format.format(it.createTime)
|
|
||||||
return view
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setGroupHeight(ScreenUtil.dip2px(45.0f)) //设置高度
|
|
||||||
.isAlignLeft(true) //靠右边显示 默认左边
|
|
||||||
.build()
|
|
||||||
binding.recyclerView.addItemDecoration(decoration)
|
|
||||||
|
|
||||||
viewModel.wishHistoryLiveData.observe(this) {
|
viewModel.wishHistoryLiveData.observe(this) {
|
||||||
rvDelegate.loadData(it)
|
rvDelegate.loadData(it)
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,30 @@
|
|||||||
|
package com.mango.moshen.avroom.wishlist
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder
|
||||||
|
import com.mango.core.room.wishlist.WishHistoryInfo
|
||||||
|
import com.mango.moshen.R
|
||||||
|
|
||||||
|
|
||||||
|
class WishListHistoryTimeAdapter :
|
||||||
|
BaseQuickAdapter<WishHistoryInfo, BaseViewHolder>(R.layout.item_wish_list_history_time) {
|
||||||
|
|
||||||
|
|
||||||
|
override fun convert(helper: BaseViewHolder, item: WishHistoryInfo) {
|
||||||
|
|
||||||
|
helper.setText(R.id.tv_create_time, item.createDate)
|
||||||
|
|
||||||
|
val rv = helper.getView<RecyclerView>(R.id.recycler_view)
|
||||||
|
if (rv.adapter == null) {
|
||||||
|
val adapter = WishListHistoryAdapter()
|
||||||
|
rv.adapter = adapter
|
||||||
|
rv.layoutManager = LinearLayoutManager(mContext)
|
||||||
|
adapter.setNewData(item.gifts)
|
||||||
|
} else {
|
||||||
|
(rv.adapter as WishListHistoryAdapter).setNewData(item.gifts)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,97 @@
|
|||||||
|
package com.mango.moshen.avroom.wishlist
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.text.style.ForegroundColorSpan
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.WindowManager
|
||||||
|
import androidx.core.graphics.toColorInt
|
||||||
|
import androidx.fragment.app.viewModels
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.mango.core.gift.bean.SimpleUserInfo
|
||||||
|
import com.mango.core.room.anotherroompk.ShowGiftDialogEvent
|
||||||
|
import com.mango.core.room.wishlist.WishItemInfo
|
||||||
|
import com.mango.core.utils.toIntOrDef
|
||||||
|
import com.mango.moshen.base.BaseDialog
|
||||||
|
import com.mango.moshen.databinding.DialogWishListPanelBinding
|
||||||
|
import com.mango.moshen.ui.utils.RVDelegate
|
||||||
|
import com.mango.moshen.utils.SpannableBuilder
|
||||||
|
import com.mango.xchat_android_library.rxbus.RxBus
|
||||||
|
import kotlin.math.min
|
||||||
|
|
||||||
|
class WishListPanelDialog : BaseDialog<DialogWishListPanelBinding>() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun newInstance(): WishListPanelDialog {
|
||||||
|
return WishListPanelDialog()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val viewModel: WishListViewModel by viewModels()
|
||||||
|
private lateinit var rvDelegateUser: RVDelegate<SimpleUserInfo>
|
||||||
|
private lateinit var rvDelegateGift: RVDelegate<WishItemInfo>
|
||||||
|
override var width = WindowManager.LayoutParams.MATCH_PARENT
|
||||||
|
override var gravity: Int = Gravity.BOTTOM
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
override fun init() {
|
||||||
|
|
||||||
|
rvDelegateUser = RVDelegate.Builder<SimpleUserInfo>()
|
||||||
|
.setLayoutManager(LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false))
|
||||||
|
.setRecyclerView(binding.rvUsers)
|
||||||
|
.setAdapter(WishListPanelUserAdapter())
|
||||||
|
.build()
|
||||||
|
|
||||||
|
rvDelegateGift = RVDelegate.Builder<WishItemInfo>()
|
||||||
|
.setLayoutManager(LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false))
|
||||||
|
.setRecyclerView(binding.rvGifts)
|
||||||
|
.setAdapter(WishListPanelGiftAdapter())
|
||||||
|
.build()
|
||||||
|
|
||||||
|
viewModel.getRoomWishUserList()
|
||||||
|
viewModel.getRoomWishGiftList()
|
||||||
|
|
||||||
|
viewModel.wishUserLiveData.observe(viewLifecycleOwner) {
|
||||||
|
if (it.isSuccess && !it.data.isNullOrEmpty()) {
|
||||||
|
it.data?.let { users ->
|
||||||
|
rvDelegateUser.setNewData(users.subList(0, min(3, users.size)))
|
||||||
|
binding.tvCallNum.text =
|
||||||
|
SpannableBuilder()
|
||||||
|
.append(
|
||||||
|
"${users.size}",
|
||||||
|
ForegroundColorSpan("#FFC300".toColorInt())
|
||||||
|
)
|
||||||
|
.append(
|
||||||
|
"人已助力",
|
||||||
|
ForegroundColorSpan("#999999".toColorInt())
|
||||||
|
)
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel.wishGiftLiveData.observe(viewLifecycleOwner) {
|
||||||
|
rvDelegateGift.loadData(it)
|
||||||
|
if (it.isSuccess && !it.data.isNullOrEmpty()) {
|
||||||
|
it.data?.let { gifts ->
|
||||||
|
binding.tvTitle.text =
|
||||||
|
"今日心愿礼物(${gifts.filter { info -> info.actualNum == info.targetNum }.size}/${gifts.size})"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
binding.tvTitle.text = "今日心愿礼物"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
rvDelegateGift.adapter.setOnItemChildClickListener { _, _, position ->
|
||||||
|
rvDelegateGift.adapter.getItem(position)?.let {
|
||||||
|
RxBus.get().post(ShowGiftDialogEvent(it.giftId.toIntOrDef(0)))
|
||||||
|
dismissAllowingStateLoss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,44 @@
|
|||||||
|
package com.mango.moshen.avroom.wishlist
|
||||||
|
|
||||||
|
import android.text.style.ForegroundColorSpan
|
||||||
|
import android.widget.ImageView
|
||||||
|
import android.widget.ProgressBar
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.core.graphics.toColorInt
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder
|
||||||
|
import com.mango.core.room.wishlist.WishItemInfo
|
||||||
|
import com.mango.moshen.R
|
||||||
|
import com.mango.moshen.ui.utils.load
|
||||||
|
import com.mango.moshen.utils.SpannableBuilder
|
||||||
|
|
||||||
|
|
||||||
|
class WishListPanelGiftAdapter :
|
||||||
|
BaseQuickAdapter<WishItemInfo, BaseViewHolder>(R.layout.item_wish_list_panel_gift) {
|
||||||
|
|
||||||
|
override fun convert(helper: BaseViewHolder, item: WishItemInfo) {
|
||||||
|
helper.setText(R.id.tv_gift_name, item.giftName)
|
||||||
|
helper.setText(R.id.tv_price, "${item.goldPrice}钻石")
|
||||||
|
helper.setText(R.id.tv_progress, "${item.actualNum}/${item.targetNum}")
|
||||||
|
helper.getView<ImageView>(R.id.iv_gift).load(item.giftUrl)
|
||||||
|
helper.addOnClickListener(R.id.tv_send)
|
||||||
|
|
||||||
|
val progressBar = helper.getView<ProgressBar>(R.id.progress_bar)
|
||||||
|
progressBar.max = item.targetNum
|
||||||
|
progressBar.progress = item.actualNum
|
||||||
|
|
||||||
|
val isComplete = item.actualNum == item.targetNum
|
||||||
|
helper.setGone(R.id.iv_complete, isComplete)
|
||||||
|
helper.getView<TextView>(R.id.tv_progress).text =
|
||||||
|
SpannableBuilder()
|
||||||
|
.append(
|
||||||
|
"${item.actualNum}",
|
||||||
|
ForegroundColorSpan((if (isComplete) "#E991B8" else "#FFA0C3").toColorInt())
|
||||||
|
)
|
||||||
|
.append(
|
||||||
|
"/${item.targetNum}",
|
||||||
|
ForegroundColorSpan((if (isComplete) "#E991B8" else "#80FFFFFF").toColorInt())
|
||||||
|
)
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,18 @@
|
|||||||
|
package com.mango.moshen.avroom.wishlist
|
||||||
|
|
||||||
|
import android.widget.ImageView
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder
|
||||||
|
import com.mango.core.gift.bean.SimpleUserInfo
|
||||||
|
import com.mango.core.room.wishlist.WishItemInfo
|
||||||
|
import com.mango.moshen.R
|
||||||
|
import com.mango.moshen.ui.utils.load
|
||||||
|
|
||||||
|
|
||||||
|
class WishListPanelUserAdapter :
|
||||||
|
BaseQuickAdapter<SimpleUserInfo, BaseViewHolder>(R.layout.item_wish_list_panel_user) {
|
||||||
|
|
||||||
|
override fun convert(helper: BaseViewHolder, item: SimpleUserInfo) {
|
||||||
|
helper.getView<ImageView>(R.id.iv_avatar).load(item.avatar)
|
||||||
|
}
|
||||||
|
}
|
@@ -7,6 +7,7 @@ import com.mango.core.bean.response.ListResult
|
|||||||
import com.mango.core.gift.bean.SimpleUserInfo
|
import com.mango.core.gift.bean.SimpleUserInfo
|
||||||
import com.mango.core.home.bean.HomeRoomInfo
|
import com.mango.core.home.bean.HomeRoomInfo
|
||||||
import com.mango.core.room.wishlist.WishCreateItemInfo
|
import com.mango.core.room.wishlist.WishCreateItemInfo
|
||||||
|
import com.mango.core.room.wishlist.WishHistoryInfo
|
||||||
import com.mango.core.room.wishlist.WishItemInfo
|
import com.mango.core.room.wishlist.WishItemInfo
|
||||||
import com.mango.core.room.wishlist.WishListModel
|
import com.mango.core.room.wishlist.WishListModel
|
||||||
import com.mango.core.utils.toast
|
import com.mango.core.utils.toast
|
||||||
@@ -20,8 +21,8 @@ class WishListViewModel : BaseViewModel() {
|
|||||||
private val _wishUserLiveData = MutableLiveData<ListResult<SimpleUserInfo>>()
|
private val _wishUserLiveData = MutableLiveData<ListResult<SimpleUserInfo>>()
|
||||||
val wishUserLiveData: LiveData<ListResult<SimpleUserInfo>> = _wishUserLiveData
|
val wishUserLiveData: LiveData<ListResult<SimpleUserInfo>> = _wishUserLiveData
|
||||||
|
|
||||||
private val _wishHistoryLiveData = MutableLiveData<ListResult<WishItemInfo>>()
|
private val _wishHistoryLiveData = MutableLiveData<ListResult<WishHistoryInfo>>()
|
||||||
val wishHistoryLiveData: LiveData<ListResult<WishItemInfo>> = _wishHistoryLiveData
|
val wishHistoryLiveData: LiveData<ListResult<WishHistoryInfo>> = _wishHistoryLiveData
|
||||||
|
|
||||||
private val _wishConfigLiveData = MutableLiveData<ListResult<WishCreateItemInfo>>()
|
private val _wishConfigLiveData = MutableLiveData<ListResult<WishCreateItemInfo>>()
|
||||||
val wishConfigLiveData: LiveData<ListResult<WishCreateItemInfo>> = _wishConfigLiveData
|
val wishConfigLiveData: LiveData<ListResult<WishCreateItemInfo>> = _wishConfigLiveData
|
||||||
@@ -92,6 +93,7 @@ class WishListViewModel : BaseViewModel() {
|
|||||||
}, block = {
|
}, block = {
|
||||||
WishListModel.addWishItem(giftId, itemId, targetNum)
|
WishListModel.addWishItem(giftId, itemId, targetNum)
|
||||||
_addWishLiveData.value = Event(true)
|
_addWishLiveData.value = Event(true)
|
||||||
|
getRoomWishGiftList()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
app/src/main/res/drawable-xhdpi/bg_wish_list_entrance_gift.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_wish_list_entrance_gift.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_wish_list_panel.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_wish_list_panel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 164 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_wish_list_panel_complete.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_wish_list_panel_complete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_wish_list_panel_item.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_wish_list_panel_item.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_room_opt_wish_entrance.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_room_opt_wish_entrance.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
22
app/src/main/res/drawable/bg_wish_list_entrance_pb.xml
Normal file
22
app/src/main/res/drawable/bg_wish_list_entrance_pb.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 定义轨道的背景 -->
|
||||||
|
<item android:id="@android:id/background">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/white_transparent_20" />
|
||||||
|
<corners android:radius="@dimen/dp_10" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 定义轨道上已完成部分的样式 -->
|
||||||
|
<item android:id="@android:id/progress">
|
||||||
|
<scale android:scaleWidth="100%">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:endColor="#FFA0C3"
|
||||||
|
android:startColor="#C176FF" />
|
||||||
|
<corners android:radius="@dimen/dp_10" />
|
||||||
|
</shape>
|
||||||
|
</scale>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
22
app/src/main/res/drawable/bg_wish_list_pb.xml
Normal file
22
app/src/main/res/drawable/bg_wish_list_pb.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 定义轨道的背景 -->
|
||||||
|
<item android:id="@android:id/background">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#17093E" />
|
||||||
|
<corners android:radius="@dimen/dp_10" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 定义轨道上已完成部分的样式 -->
|
||||||
|
<item android:id="@android:id/progress">
|
||||||
|
<scale android:scaleWidth="100%">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:endColor="#FFA0C3"
|
||||||
|
android:startColor="#C176FF" />
|
||||||
|
<corners android:radius="@dimen/dp_10" />
|
||||||
|
</shape>
|
||||||
|
</scale>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
10
app/src/main/res/drawable/shape_white_alpha20_left_100dp.xml
Normal file
10
app/src/main/res/drawable/shape_white_alpha20_left_100dp.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="@color/white_transparent_20" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="100dp"
|
||||||
|
android:bottomRightRadius="0dp"
|
||||||
|
android:topLeftRadius="100dp"
|
||||||
|
android:topRightRadius="0dp" />
|
||||||
|
</shape>
|
@@ -14,12 +14,6 @@
|
|||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/recycler_view"
|
android:id="@+id/recycler_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent" />
|
||||||
android:layout_marginStart="13dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginEnd="13dp"
|
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:paddingTop="10dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
92
app/src/main/res/layout/dialog_wish_list_panel.xml
Normal file
92
app/src/main/res/layout/dialog_wish_list_panel.xml
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout 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_gravity="bottom"
|
||||||
|
tools:background="@color/bg_normal_1c1b22">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bg"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:background="@drawable/bg_wish_list_panel"
|
||||||
|
app:layout_constraintDimensionRatio="750:640"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="今日心愿礼物"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bg" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_tips"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:text="-当日设置的心愿,会在次日0点失效-"
|
||||||
|
android:textColor="@color/color_666666"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_line"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="1px"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="@color/white_transparent_10"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_tips" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_users"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="28dp"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/view_line" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_call_num"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/rv_users"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/rv_users"
|
||||||
|
tools:text="8人已助力" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_gifts"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/rv_users" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
67
app/src/main/res/layout/item_wish_list_entrance.xml
Normal file
67
app/src/main/res/layout/item_wish_list_entrance.xml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:background="@drawable/shape_white_alpha20_left_100dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp">
|
||||||
|
|
||||||
|
<com.mango.moshen.common.widget.CircleImageView
|
||||||
|
android:id="@+id/iv_gift"
|
||||||
|
android:layout_width="28dp"
|
||||||
|
android:layout_height="28dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/default_avatar" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:background="@drawable/bg_wish_list_entrance_gift" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_gift_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:lines="1"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="10sp"
|
||||||
|
tools:text="流星敢月" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_progress"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="#ffff5f3c"
|
||||||
|
android:textSize="10sp"
|
||||||
|
tools:text="152/291" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progress_bar"
|
||||||
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="2dp"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:progressDrawable="@drawable/bg_wish_list_entrance_pb"
|
||||||
|
tools:max="100"
|
||||||
|
tools:progress="50" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
@@ -2,18 +2,29 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/ll"
|
android:id="@+id/ll"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="45dp"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="vertical">
|
||||||
>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv"
|
android:id="@+id/tv_create_time"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="50dp"
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:textColor="@color/text_normal_c6c6e9"
|
android:textColor="@color/text_normal_c6c6e9"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp" />
|
||||||
android:paddingStart="9dp"/>
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:background="@drawable/shape_white_8dp_round"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:paddingBottom="10dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
90
app/src/main/res/layout/item_wish_list_panel_gift.xml
Normal file
90
app/src/main/res/layout/item_wish_list_panel_gift.xml
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout 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="106dp"
|
||||||
|
android:layout_height="165dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:layout_marginEnd="6dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="106dp"
|
||||||
|
android:layout_height="165dp"
|
||||||
|
android:background="@drawable/bg_wish_list_panel_item"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_gift"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:src="@drawable/default_cover" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_gift_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="12sp"
|
||||||
|
tools:text="流星敢月" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_price"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="@color/white_transparent_50"
|
||||||
|
android:textSize="10sp"
|
||||||
|
tools:text="1钻石" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progress_bar"
|
||||||
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="5dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:progressDrawable="@drawable/bg_wish_list_pb"
|
||||||
|
tools:max="100"
|
||||||
|
tools:progress="50" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_progress"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="#ffff5f3c"
|
||||||
|
android:textSize="10sp"
|
||||||
|
tools:text="152/291" />
|
||||||
|
|
||||||
|
<com.coorchice.library.SuperTextView
|
||||||
|
android:id="@+id/tv_send"
|
||||||
|
android:layout_width="76dp"
|
||||||
|
android:layout_height="22dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="赠送"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:corner="20dp"
|
||||||
|
app:shaderEnable="true"
|
||||||
|
app:shaderEndColor="#C176FF"
|
||||||
|
app:shaderMode="leftToRight"
|
||||||
|
app:shaderStartColor="#FFA0C3" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_complete"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:src="@drawable/bg_wish_list_panel_complete" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
7
app/src/main/res/layout/item_wish_list_panel_user.xml
Normal file
7
app/src/main/res/layout/item_wish_list_panel_user.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<com.mango.moshen.common.widget.CircleImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/iv_avatar"
|
||||||
|
android:layout_width="28dp"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:layout_marginEnd="2dp"
|
||||||
|
android:layout_height="28dp" />
|
@@ -117,6 +117,14 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.mango.moshen.ui.widget.rollviewpager.RollPagerView
|
||||||
|
android:id="@+id/pager_view_wish_list"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_below="@id/ll_room_pk_order"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginTop="5dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_hour_rank"
|
android:id="@+id/tv_hour_rank"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@@ -93,6 +93,14 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.mango.moshen.ui.widget.rollviewpager.RollPagerView
|
||||||
|
android:id="@+id/pager_view_wish_list"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/contribute_list" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/fl_fans_team"
|
android:id="@+id/fl_fans_team"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@@ -23,6 +23,7 @@ import com.google.gson.JsonObject;
|
|||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
|
import com.mango.core.im.custom.bean.WishListAttachment;
|
||||||
import com.netease.nim.uikit.business.session.helper.MessageListPanelHelper;
|
import com.netease.nim.uikit.business.session.helper.MessageListPanelHelper;
|
||||||
import com.netease.nim.uikit.common.antispam.AntiSpamEvent;
|
import com.netease.nim.uikit.common.antispam.AntiSpamEvent;
|
||||||
import com.netease.nim.uikit.common.util.AntiSpamUtil;
|
import com.netease.nim.uikit.common.util.AntiSpamUtil;
|
||||||
@@ -1365,6 +1366,22 @@ public final class IMNetEaseManager {
|
|||||||
noticeRoomEvent(msg, RoomEvent.DRAW_GIFT_EFFECT);
|
noticeRoomEvent(msg, RoomEvent.DRAW_GIFT_EFFECT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case CUSTOM_MSG_WISH_LIST:
|
||||||
|
WishListAttachment wishListAttachment = (WishListAttachment) attachment;
|
||||||
|
switch (second) {
|
||||||
|
case CUSTOM_MSG_WISH_LIST_OPEN:
|
||||||
|
case CUSTOM_MSG_WISH_LIST_UPDATE:
|
||||||
|
AvRoomDataManager.get().wishGiftLiveData.setValue(wishListAttachment.getWishItemInfos());
|
||||||
|
break;
|
||||||
|
case CUSTOM_MSG_WISH_LIST_FINISH:
|
||||||
|
addMessages(msg);
|
||||||
|
break;
|
||||||
|
case CUSTOM_MSG_WISH_LIST_CELEBRATE:
|
||||||
|
noticeRoomEvent(msg, RoomEvent.WISH_LIST_EFFECT);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -76,6 +76,7 @@ import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_VOICE_BO
|
|||||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_VOICE_BOTTLE_SUB_HELLO;
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_VOICE_BOTTLE_SUB_HELLO;
|
||||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_VOICE_BOTTLE_SUB_TO_RECORDING;
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_VOICE_BOTTLE_SUB_TO_RECORDING;
|
||||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_VOICE_BOTTLE_SUB_tO_MATCHING;
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_VOICE_BOTTLE_SUB_tO_MATCHING;
|
||||||
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_WISH_LIST;
|
||||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_NOTI_SUB_GAME_ATTACK;
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_NOTI_SUB_GAME_ATTACK;
|
||||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_NOTI_SUB_GAME_RESULT;
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_NOTI_SUB_GAME_RESULT;
|
||||||
|
|
||||||
@@ -597,6 +598,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
|
|||||||
attachment = new DrawGiftAttachment(first, second);
|
attachment = new DrawGiftAttachment(first, second);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case CUSTOM_MSG_WISH_LIST:
|
||||||
|
attachment = new WishListAttachment(first, second);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
LogUtils.e("未定义的first,请现在CustomAttachParser中解析first=" + first + " second=" + second);
|
LogUtils.e("未定义的first,请现在CustomAttachParser中解析first=" + first + " second=" + second);
|
||||||
break;
|
break;
|
||||||
|
@@ -411,6 +411,19 @@ public class CustomAttachment implements MsgAttachment {
|
|||||||
public static final int CUSTOM_MSG_DRAW_GIFT_EFFECT = 94;
|
public static final int CUSTOM_MSG_DRAW_GIFT_EFFECT = 94;
|
||||||
public static final int CUSTOM_MSG_SUB_TYPE_DRAW_GIFT_EFFECT = 941;
|
public static final int CUSTOM_MSG_SUB_TYPE_DRAW_GIFT_EFFECT = 941;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 心愿礼物
|
||||||
|
*/
|
||||||
|
public static final int CUSTOM_MSG_WISH_LIST = 95;
|
||||||
|
// 开启心愿礼物
|
||||||
|
public static final int CUSTOM_MSG_WISH_LIST_OPEN = 951;
|
||||||
|
// 心愿礼物完成
|
||||||
|
public static final int CUSTOM_MSG_WISH_LIST_FINISH = 952;
|
||||||
|
// 心愿礼物庆祝动效
|
||||||
|
public static final int CUSTOM_MSG_WISH_LIST_CELEBRATE = 953;
|
||||||
|
// 心愿礼物进度更新
|
||||||
|
public static final int CUSTOM_MSG_WISH_LIST_UPDATE = 954;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义消息附件的类型,根据该字段区分不同的自定义消息
|
* 自定义消息附件的类型,根据该字段区分不同的自定义消息
|
||||||
|
@@ -0,0 +1,51 @@
|
|||||||
|
package com.mango.core.im.custom.bean;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.alibaba.fastjson.TypeReference;
|
||||||
|
import com.mango.core.room.wishlist.WishItemInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author chenran
|
||||||
|
* @date 2017/7/28
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class WishListAttachment extends CustomAttachment {
|
||||||
|
private long roomUid;
|
||||||
|
private List<WishItemInfo> wishItemInfos;
|
||||||
|
|
||||||
|
|
||||||
|
public WishListAttachment(int first, int second) {
|
||||||
|
super(first, second);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getRoomUid() {
|
||||||
|
return roomUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoomUid(long roomUid) {
|
||||||
|
this.roomUid = roomUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<WishItemInfo> getWishItemInfos() {
|
||||||
|
return wishItemInfos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWishItemInfos(List<WishItemInfo> wishItemInfos) {
|
||||||
|
this.wishItemInfos = wishItemInfos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void parseData(JSONObject data) {
|
||||||
|
roomUid = data.getLongValue("roomUid");
|
||||||
|
wishItemInfos = data.getObject("wishItemInfos", new TypeReference<List<List<Integer>>>() {
|
||||||
|
}.getType());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected JSONObject packData() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@@ -11,6 +11,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.mango.core.room.wishlist.WishItemInfo;
|
||||||
import com.netease.nimlib.sdk.NIMChatRoomSDK;
|
import com.netease.nimlib.sdk.NIMChatRoomSDK;
|
||||||
import com.netease.nimlib.sdk.RequestCallback;
|
import com.netease.nimlib.sdk.RequestCallback;
|
||||||
import com.netease.nimlib.sdk.chatroom.constant.MemberType;
|
import com.netease.nimlib.sdk.chatroom.constant.MemberType;
|
||||||
@@ -95,6 +96,9 @@ public final class AvRoomDataManager {
|
|||||||
public final List<ChatRoomMember> roomSuperAdminList = new ArrayList<>();
|
public final List<ChatRoomMember> roomSuperAdminList = new ArrayList<>();
|
||||||
@NonNull
|
@NonNull
|
||||||
public final MutableLiveData<RoomPkBean> roomPkLiveData = new MutableLiveData<>();
|
public final MutableLiveData<RoomPkBean> roomPkLiveData = new MutableLiveData<>();
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public final MutableLiveData<List<WishItemInfo>> wishGiftLiveData = new MutableLiveData<>();
|
||||||
/**
|
/**
|
||||||
* 是否需要关麦,用户自己的行为,不受房主管理员的管理,与闭麦状态相同,当闭麦这个值就是ture;
|
* 是否需要关麦,用户自己的行为,不受房主管理员的管理,与闭麦状态相同,当闭麦这个值就是ture;
|
||||||
* 2022/9/1更改:无论什么情况上麦,默认都是关麦的!
|
* 2022/9/1更改:无论什么情况上麦,默认都是关麦的!
|
||||||
@@ -187,6 +191,16 @@ public final class AvRoomDataManager {
|
|||||||
public long clearScreenTime;
|
public long clearScreenTime;
|
||||||
public boolean showPkBeginTime;
|
public boolean showPkBeginTime;
|
||||||
public long pkBeginTime;
|
public long pkBeginTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有心愿礼物权限
|
||||||
|
*/
|
||||||
|
private boolean hasWishGiftPermit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已经开启心愿礼物
|
||||||
|
*/
|
||||||
|
private boolean hasOpenWishGift;
|
||||||
/**
|
/**
|
||||||
* 一起玩 按钮开关
|
* 一起玩 按钮开关
|
||||||
*/
|
*/
|
||||||
@@ -272,6 +286,8 @@ public final class AvRoomDataManager {
|
|||||||
showPkBeginTime = roomInfo.isShowPkBeginTime();
|
showPkBeginTime = roomInfo.isShowPkBeginTime();
|
||||||
pkBeginTime = roomInfo.getPkBeginTime();
|
pkBeginTime = roomInfo.getPkBeginTime();
|
||||||
redEnvelopeOpen = roomInfo.isRedEnvelopeOpen();
|
redEnvelopeOpen = roomInfo.isRedEnvelopeOpen();
|
||||||
|
hasWishGiftPermit = roomInfo.isHasWishGiftPermit();
|
||||||
|
hasOpenWishGift = roomInfo.isHasOpenWishGift();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -377,6 +393,7 @@ public final class AvRoomDataManager {
|
|||||||
roomNoDestory = false;
|
roomNoDestory = false;
|
||||||
SuperAdminDataMrg.get().clearData();
|
SuperAdminDataMrg.get().clearData();
|
||||||
roomPkLiveData.setValue(null);
|
roomPkLiveData.setValue(null);
|
||||||
|
wishGiftLiveData.setValue(null);
|
||||||
isFirstFollow = true;
|
isFirstFollow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1303,6 +1320,14 @@ public final class AvRoomDataManager {
|
|||||||
return isDatingMode() && roomQueueInfo.mChatRoomMember.isHasSelectUser();
|
return isDatingMode() && roomQueueInfo.mChatRoomMember.isHasSelectUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isHasWishGiftPermit() {
|
||||||
|
return hasWishGiftPermit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHasOpenWishGift() {
|
||||||
|
return hasOpenWishGift;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isLimitEnterRoom(String roomUid) {
|
public boolean isLimitEnterRoom(String roomUid) {
|
||||||
initKickOutRoomUids();
|
initKickOutRoomUids();
|
||||||
Long limitTime = kickOutRoomUids.get(roomUid);
|
Long limitTime = kickOutRoomUids.get(roomUid);
|
||||||
|
@@ -247,6 +247,8 @@ public class RoomEvent {
|
|||||||
|
|
||||||
public static final int DRAW_GIFT_EFFECT = 98;
|
public static final int DRAW_GIFT_EFFECT = 98;
|
||||||
|
|
||||||
|
public static final int WISH_LIST_EFFECT = 99;
|
||||||
|
|
||||||
private int event = NONE;
|
private int event = NONE;
|
||||||
private int micPosition = Integer.MIN_VALUE;
|
private int micPosition = Integer.MIN_VALUE;
|
||||||
private int posState = -1;
|
private int posState = -1;
|
||||||
|
@@ -3,6 +3,13 @@ package com.mango.core.room.anotherroompk;
|
|||||||
public class ShowGiftDialogEvent {
|
public class ShowGiftDialogEvent {
|
||||||
private int giftId;
|
private int giftId;
|
||||||
|
|
||||||
|
public ShowGiftDialogEvent() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShowGiftDialogEvent(int giftId) {
|
||||||
|
this.giftId = giftId;
|
||||||
|
}
|
||||||
|
|
||||||
public int getGiftId() {
|
public int getGiftId() {
|
||||||
return giftId;
|
return giftId;
|
||||||
}
|
}
|
||||||
|
@@ -143,6 +143,16 @@ public class RoomInfo implements Parcelable,Serializable {
|
|||||||
private boolean showPkBeginTime;
|
private boolean showPkBeginTime;
|
||||||
private long pkBeginTime;
|
private long pkBeginTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有心愿礼物权限
|
||||||
|
*/
|
||||||
|
private boolean hasWishGiftPermit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已经开启心愿礼物
|
||||||
|
*/
|
||||||
|
private boolean hasOpenWishGift;
|
||||||
|
|
||||||
|
|
||||||
protected RoomInfo(Parcel in) {
|
protected RoomInfo(Parcel in) {
|
||||||
uid = in.readLong();
|
uid = in.readLong();
|
||||||
|
@@ -0,0 +1,6 @@
|
|||||||
|
package com.mango.core.room.wishlist
|
||||||
|
|
||||||
|
data class WishHistoryInfo(
|
||||||
|
val gifts: List<WishItemInfo>? = null,
|
||||||
|
val createDate: String
|
||||||
|
)
|
@@ -6,7 +6,7 @@ data class WishItemInfo(
|
|||||||
val targetNum: Int = 0,
|
val targetNum: Int = 0,
|
||||||
val giftName: String = "",
|
val giftName: String = "",
|
||||||
val giftUrl: String? = null,
|
val giftUrl: String? = null,
|
||||||
val goldPrice: Double = 0.0,
|
val goldPrice: String = "",
|
||||||
val itemId: String = "",
|
val itemId: String = "",
|
||||||
val level: String? = null,
|
val level: String? = null,
|
||||||
val createTime: Long
|
val createTime: Long
|
||||||
|
@@ -4,8 +4,11 @@ import com.mango.core.base.BaseModel
|
|||||||
import com.mango.core.bean.response.ServiceResult
|
import com.mango.core.bean.response.ServiceResult
|
||||||
import com.mango.core.gift.bean.SimpleUserInfo
|
import com.mango.core.gift.bean.SimpleUserInfo
|
||||||
import com.mango.core.manager.AvRoomDataManager
|
import com.mango.core.manager.AvRoomDataManager
|
||||||
|
import com.mango.core.utils.net.handleBeanData
|
||||||
|
import com.mango.core.utils.net.io2main
|
||||||
import com.mango.core.utils.net.launchRequest
|
import com.mango.core.utils.net.launchRequest
|
||||||
import com.mango.xchat_android_library.net.rxnet.RxNet
|
import com.mango.xchat_android_library.net.rxnet.RxNet
|
||||||
|
import io.reactivex.Single
|
||||||
import retrofit2.http.Field
|
import retrofit2.http.Field
|
||||||
import retrofit2.http.FormUrlEncoded
|
import retrofit2.http.FormUrlEncoded
|
||||||
import retrofit2.http.GET
|
import retrofit2.http.GET
|
||||||
@@ -46,6 +49,12 @@ object WishListModel : BaseModel() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getRoomWishGiftListWithJava(): Single<List<WishItemInfo>> =
|
||||||
|
api.getRoomWishGiftListWithJava(AvRoomDataManager.get().roomUid.toString())
|
||||||
|
.io2main()
|
||||||
|
.handleBeanData()
|
||||||
|
|
||||||
|
|
||||||
suspend fun getRoomWishUserList(): List<SimpleUserInfo>? = launchRequest {
|
suspend fun getRoomWishUserList(): List<SimpleUserInfo>? = launchRequest {
|
||||||
api.getRoomWishUserList(
|
api.getRoomWishUserList(
|
||||||
AvRoomDataManager.get().roomUid.toString()
|
AvRoomDataManager.get().roomUid.toString()
|
||||||
@@ -59,7 +68,7 @@ object WishListModel : BaseModel() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getWisHistoryList(): List<WishItemInfo>? = launchRequest {
|
suspend fun getWisHistoryList(): List<WishHistoryInfo>? = launchRequest {
|
||||||
api.getWisHistoryList(
|
api.getWisHistoryList(
|
||||||
AvRoomDataManager.get().roomUid.toString()
|
AvRoomDataManager.get().roomUid.toString()
|
||||||
)
|
)
|
||||||
@@ -111,6 +120,14 @@ object WishListModel : BaseModel() {
|
|||||||
@GET("/wishGift/list")
|
@GET("/wishGift/list")
|
||||||
suspend fun getRoomWishGiftList(@Query("roomUid") roomUid: String): ServiceResult<List<WishItemInfo>>
|
suspend fun getRoomWishGiftList(@Query("roomUid") roomUid: String): ServiceResult<List<WishItemInfo>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取房间心愿礼物列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("/wishGift/list")
|
||||||
|
fun getRoomWishGiftListWithJava(@Query("roomUid") roomUid: String): Single<ServiceResult<List<WishItemInfo>>>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取房间心愿礼物助力用户列表
|
* 获取房间心愿礼物助力用户列表
|
||||||
*
|
*
|
||||||
@@ -136,7 +153,7 @@ object WishListModel : BaseModel() {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GET("/wishGift/listWishGiftHistory")
|
@GET("/wishGift/listWishGiftHistory")
|
||||||
suspend fun getWisHistoryList(@Query("roomUid") roomUid: String): ServiceResult<List<WishItemInfo>>
|
suspend fun getWisHistoryList(@Query("roomUid") roomUid: String): ServiceResult<List<WishHistoryInfo>>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user