Merge branch 'feature/room_icon' into test/2.6.0
This commit is contained in:
@@ -843,7 +843,11 @@
|
||||
<activity
|
||||
android:name=".ui.webview.DialogWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity"
|
||||
android:windowSoftInputMode="adjustPan" /> <!-- 隐私政策 -->
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".ui.webview.room_banner.RoomWebDialogActivity"
|
||||
android:theme="@style/room_dialog_web_view_activity"
|
||||
android:windowSoftInputMode="adjustPan" /><!-- 隐私政策 -->
|
||||
<activity
|
||||
android:name=".ui.webview.DatingRuleWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
|
@@ -0,0 +1,40 @@
|
||||
package com.yizhuan.erban.avroom.banner
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import androidx.core.util.Consumer
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapter
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomIcon
|
||||
|
||||
class RoomBannerAdapter(private val mContext: Context, private val data: List<RoomIcon>) :
|
||||
StaticPagerAdapter() {
|
||||
|
||||
var onItemClickListener: Consumer<RoomIcon>? = null
|
||||
|
||||
override fun getView(container: ViewGroup, position: Int): View {
|
||||
val view = LayoutInflater.from(mContext).inflate(R.layout.item_room_act, container, false)
|
||||
val ivCover = view.findViewById<ImageView>(R.id.iv_cover)
|
||||
val bannerInfo = data[position]
|
||||
val actId = bannerInfo.id?.toString()
|
||||
ivCover.scaleType = ImageView.ScaleType.CENTER_CROP
|
||||
ImageLoadUtils.loadImage(
|
||||
mContext,
|
||||
bannerInfo.icon,
|
||||
ivCover,
|
||||
R.drawable.default_cover
|
||||
)
|
||||
ivCover.setOnClickListener { v: View? ->
|
||||
onItemClickListener?.accept(bannerInfo)
|
||||
}
|
||||
return view
|
||||
}
|
||||
|
||||
override fun getCount(): Int {
|
||||
return data.size
|
||||
}
|
||||
}
|
@@ -0,0 +1,194 @@
|
||||
package com.yizhuan.erban.avroom.banner
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.RelativeLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog
|
||||
import com.yizhuan.erban.databinding.RoomBannerWidgetBinding
|
||||
import com.yizhuan.erban.shipantics.PullRadishActivity
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.treasurefairy.HomeFairyActivity
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.erban.ui.webview.room_banner.RoomBannerWebDialogActivity
|
||||
import com.yizhuan.erban.ui.webview.room_banner.RoomWebDialogActivity
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.Util
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.hintview.ColorPointHintView
|
||||
import com.yizhuan.erban.utils.CommonJumpHelper
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomIcon
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.support.room.FrameLayoutRoomWidget
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomView
|
||||
import okhttp3.internal.filterList
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/20 10:42
|
||||
* Desc:玩法活动
|
||||
**/
|
||||
class RoomBannerWidget : FrameLayoutRoomWidget {
|
||||
private val binding: RoomBannerWidgetBinding =
|
||||
DataBindingUtil.inflate(
|
||||
LayoutInflater.from(
|
||||
context
|
||||
), R.layout.room_banner_widget, this, true
|
||||
)
|
||||
|
||||
|
||||
private var indicatorVisible = false
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
|
||||
init {
|
||||
setIndicatorEnabled(true)
|
||||
}
|
||||
|
||||
override fun onInitialize(roomView: RoomView, roomContext: RoomContext) {
|
||||
super.onInitialize(roomView, roomContext)
|
||||
refreshData()
|
||||
}
|
||||
|
||||
fun disabledIndicator() {
|
||||
setIndicatorEnabled(false)
|
||||
}
|
||||
|
||||
fun refreshData() {
|
||||
if (RoomContext.get()?.getRoomInfo()?.type == RoomInfo.ROOMTYPE_GAME) {
|
||||
refreshData(true)
|
||||
} else {
|
||||
refreshData(false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun refreshData(isGameRoom: Boolean) {
|
||||
val disposable = if (isGameRoom) {
|
||||
AvRoomModel.get().gameRoomBannerList
|
||||
} else {
|
||||
AvRoomModel.get().roomBannerList
|
||||
}.subscribe { list: List<RoomIcon> ->
|
||||
loadData(list)
|
||||
}
|
||||
getCompositeDisposable().add(disposable)
|
||||
}
|
||||
|
||||
private fun loadData(list: List<RoomIcon>?) {
|
||||
if (list.isNullOrEmpty()) {
|
||||
this.isVisible = false
|
||||
return
|
||||
}
|
||||
this.isVisible = true
|
||||
// 只有一個圖標,隱藏底部指示器
|
||||
indicatorVisible = list.size > 1
|
||||
|
||||
val bannerAdapter = RoomBannerAdapter(context, list)
|
||||
bannerAdapter.onItemClickListener = androidx.core.util.Consumer<RoomIcon> {
|
||||
if (it.isSeizeTreasure()) {
|
||||
HomeFairyActivity.start(context)
|
||||
} else if (it.isFirstCharge()) {
|
||||
FirstChargeDialog.start(context)
|
||||
} else if (it.isFindLove()) {
|
||||
GoldBoxHelper.handleBoxClick(context)
|
||||
} else if (it.isNauticalAdventure()) {
|
||||
PullRadishActivity.start(context)
|
||||
} else {
|
||||
AvRoomModel.get().activityClickLog("2", it.id?.toString()).subscribe()
|
||||
|
||||
if (it.skipType == 3) {
|
||||
if (it.tag == RoomIcon.TAG_GAMEPLAY) {
|
||||
if (it.showType == 2) {
|
||||
RoomWebDialogActivity.start(context, it.skipContent ?: "", false)
|
||||
} else {
|
||||
CommonWebViewActivity.start(context, it.skipContent ?: "")
|
||||
}
|
||||
} else {
|
||||
val newList = list.filterList {
|
||||
skipType == 3 && tag != RoomIcon.TAG_GAMEPLAY
|
||||
}
|
||||
val newPosition = newList.indexOfFirst { item ->
|
||||
item == it
|
||||
}
|
||||
RoomBannerWebDialogActivity.start(context, newPosition, newList)
|
||||
}
|
||||
} else {
|
||||
CommonJumpHelper.bannerJump(context, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
binding.pagerView.adapter = bannerAdapter
|
||||
binding.pagerView.setPlayDelay(3000)
|
||||
//設置透明度
|
||||
binding.pagerView.setAnimationDurtion(500)
|
||||
bannerAdapter.notifyDataSetChanged()
|
||||
|
||||
val viewPager = binding.pagerView.viewPager
|
||||
viewPager.offscreenPageLimit = list.size
|
||||
}
|
||||
|
||||
private fun setIndicatorEnabled(isEnabled: Boolean) {
|
||||
// 模擬指示器在viewpager底部效果
|
||||
val viewPager = binding.pagerView.viewPager
|
||||
val layoutParams = viewPager.layoutParams as RelativeLayout.LayoutParams
|
||||
if (isEnabled) {
|
||||
layoutParams.setMargins(0, 0, 0, Util.dip2px(context, 7f))
|
||||
binding.pagerView.setHintView(object : ColorPointHintView(
|
||||
context, Color.WHITE, ContextCompat.getColor(
|
||||
context,
|
||||
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 if (indicatorVisible) dotFocus else null
|
||||
}
|
||||
|
||||
override fun makeNormalDrawable(): Drawable? {
|
||||
val dotNormal = GradientDrawable()
|
||||
dotNormal.setColor(ContextCompat.getColor(context, R.color.color_66FFFFFF))
|
||||
dotNormal.cornerRadius = Util.dip2px(
|
||||
context, 2f
|
||||
).toFloat()
|
||||
dotNormal.setSize(
|
||||
Util.dip2px(context, 4f), Util.dip2px(
|
||||
context, 4f
|
||||
)
|
||||
)
|
||||
return if (indicatorVisible) dotNormal else null
|
||||
}
|
||||
})
|
||||
} else {
|
||||
layoutParams.setMargins(0, 0, 0, 0)
|
||||
binding.pagerView.setHintView(null)
|
||||
}
|
||||
viewPager.layoutParams = layoutParams
|
||||
}
|
||||
}
|
@@ -59,34 +59,24 @@ import com.yizhuan.erban.base.BaseMvpActivity
|
||||
import com.yizhuan.erban.base.BaseMvpFragment
|
||||
import com.yizhuan.erban.event.OpenRoomIntroEvent
|
||||
import com.yizhuan.erban.friend.view.SelectFriendActivity
|
||||
import com.yizhuan.erban.home.adapter.RoomActAdapter
|
||||
import com.yizhuan.erban.shipantics.PullRadishActivity
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem
|
||||
import com.yizhuan.erban.ui.widget.GiftDialog
|
||||
import com.yizhuan.erban.ui.widget.GiftDialog.OnGiftDialogBtnClickListener
|
||||
import com.yizhuan.erban.ui.widget.GiftDialog.SenGiftCallback
|
||||
import com.yizhuan.erban.ui.widget.UserInfoDialog
|
||||
import com.yizhuan.erban.ui.widget.dynamicface.DynamicFaceDialog
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
|
||||
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.erban.utils.KeyBoardUtils
|
||||
import com.yizhuan.tutu.music.widget.MusicPlayerView
|
||||
import com.yizhuan.tutu.room_chat.activity.RoomMsgActivity
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants
|
||||
import com.yizhuan.xchat_android_core.Constants
|
||||
import com.yizhuan.xchat_android_core.DemoCache
|
||||
import com.yizhuan.xchat_android_core.UriProvider
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.bean.RoomMicInfo
|
||||
import com.yizhuan.xchat_android_core.gift.GiftModel
|
||||
import com.yizhuan.xchat_android_core.gift.bean.GiftInfo
|
||||
import com.yizhuan.xchat_android_core.gift.event.RoomFreeGiftEvent
|
||||
import com.yizhuan.xchat_android_core.helper.AtProxy
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.home.event.OpenRoomMessageInputEvent
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment2
|
||||
@@ -97,7 +87,6 @@ import com.yizhuan.xchat_android_core.manager.RoomEvent
|
||||
import com.yizhuan.xchat_android_core.mentoring_relationship.event.MentoringStopCountingEvent
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowUserInfoDialogEvent
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomContributeUserInfo
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.event.RoomAtEvent
|
||||
import com.yizhuan.xchat_android_core.room.event.RoomClearScreenEvent
|
||||
@@ -147,7 +136,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
protected lateinit var inputSend: ImageView
|
||||
protected lateinit var microView: MicroView
|
||||
private var musicPlayerView: MusicPlayerView? = null
|
||||
private var ivRadishEntrance: View? = null
|
||||
private var mVsMusicPlayer: ViewStub? = null
|
||||
private var mDisposable: Disposable? = null
|
||||
private var isCloseScreen = false
|
||||
@@ -207,7 +195,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
inputSend = mView.findViewById(R.id.input_send)
|
||||
microView = mView.findViewById(R.id.micro_view)
|
||||
mVsMusicPlayer = mView.findViewById(R.id.vs_music_player)
|
||||
ivRadishEntrance = mView.findViewById(R.id.iv_radish_entrance)
|
||||
messageView.setClickConsumer {
|
||||
if (!TextUtils.isEmpty(it) && it != "0") {
|
||||
showUserCardDialog(it)
|
||||
@@ -289,10 +276,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
checkFollowOwner()
|
||||
GiftValueMrg.get().updateRoomGiftValue(false)
|
||||
|
||||
//先隐藏航海冒险
|
||||
// ivRadishEntrance?.isVisible =
|
||||
// !GoldBoxHelper.needIntegrateBoxEntrance() && GoldBoxHelper.isShowRadish()
|
||||
|
||||
//获取免费礼物详情
|
||||
mvpPresenter?.queryFreeFlower()
|
||||
initRoomAlbum()
|
||||
@@ -464,65 +447,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
}
|
||||
|
||||
fun initRoomAct(
|
||||
rollPagerView: RollPagerView,
|
||||
dialogInfo: List<BannerInfo>,
|
||||
bottomDp: Float = 0f
|
||||
) {
|
||||
if (!ListUtils.isListEmpty(dialogInfo)) {
|
||||
rollPagerView.visibility = View.VISIBLE
|
||||
// 只有一個圖標,隱藏底部指示器
|
||||
val show = dialogInfo.size > 1
|
||||
rollPagerView.setHintView(object : ColorPointHintView(
|
||||
mContext, Color.WHITE, ContextCompat.getColor(
|
||||
mContext,
|
||||
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 if (show) dotFocus else null
|
||||
}
|
||||
|
||||
override fun makeNormalDrawable(): Drawable? {
|
||||
val dotNormal = GradientDrawable()
|
||||
dotNormal.setColor(ContextCompat.getColor(mContext, R.color.color_66FFFFFF))
|
||||
dotNormal.cornerRadius = Util.dip2px(
|
||||
context, 2f
|
||||
).toFloat()
|
||||
dotNormal.setSize(
|
||||
Util.dip2px(context, 4f), Util.dip2px(
|
||||
context, 4f
|
||||
)
|
||||
)
|
||||
return if (show) dotNormal else null
|
||||
}
|
||||
})
|
||||
val bannerAdapter = RoomActAdapter(mContext, dialogInfo)
|
||||
rollPagerView.adapter = bannerAdapter
|
||||
rollPagerView.setPlayDelay(3000)
|
||||
//設置透明度
|
||||
rollPagerView.setAnimationDurtion(500)
|
||||
bannerAdapter.notifyDataSetChanged()
|
||||
|
||||
// 模擬指示器在viewpager底部效果
|
||||
val viewPager = rollPagerView.viewPager
|
||||
viewPager.offscreenPageLimit = dialogInfo.size
|
||||
val layoutParams = viewPager.layoutParams as RelativeLayout.LayoutParams
|
||||
layoutParams.setMargins(0, 0, 0, UIUtil.dip2px(mContext, bottomDp.toDouble()))
|
||||
viewPager.layoutParams = layoutParams
|
||||
}
|
||||
}
|
||||
|
||||
private fun releaseView() {
|
||||
roomFreeGiftDialog?.dismiss()
|
||||
messageView.release()
|
||||
@@ -678,12 +602,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
R.id.input_send -> {
|
||||
sendMsg()
|
||||
}
|
||||
|
||||
R.id.iv_first_charge_enter -> FirstChargeDialog.start(mContext)
|
||||
R.id.iv_treasure_box,
|
||||
R.id.iv_treasure_box_cp -> GoldBoxHelper.handleBoxClick(mContext)
|
||||
|
||||
R.id.iv_radish_entrance -> PullRadishActivity.start(mContext)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -10,6 +10,7 @@ import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.adapter.GameMicroViewAdapter
|
||||
import com.yizhuan.erban.avroom.adapter.GameMiniMicroViewAdapter
|
||||
import com.yizhuan.erban.avroom.adapter.OnMicroItemClickListener
|
||||
import com.yizhuan.erban.avroom.banner.RoomBannerWidget
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog
|
||||
import com.yizhuan.erban.avroom.game.GameDelegate
|
||||
import com.yizhuan.erban.avroom.game.OnGameStatusChangeListener
|
||||
@@ -19,7 +20,6 @@ import com.yizhuan.erban.avroom.redpackage.RedPackageWidget
|
||||
import com.yizhuan.erban.avroom.view.IGameRoomView
|
||||
import com.yizhuan.erban.databinding.FragmentGameRoomBinding
|
||||
import com.yizhuan.erban.ui.widget.GiftDialog.OnGiftDialogBtnClickListener
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.music.model.PlayerModel
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent
|
||||
@@ -79,7 +79,6 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
//游戏模式暂时不需要这个
|
||||
PlayerModel.get().stop()
|
||||
gameBinding.roomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
mvpPresenter?.getBannerList()
|
||||
gameBinding.tvShowMiniMic.setOnClickListener { showMiniMic() }
|
||||
gameBinding.ivShowMic.setOnClickListener { showMic() }
|
||||
}
|
||||
@@ -151,10 +150,6 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
}
|
||||
}
|
||||
|
||||
override fun onShowBanner(dialogInfos: List<BannerInfo>) {
|
||||
initRoomAct(gameBinding.activityImg, dialogInfos)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFinishAvRoomEvent(event: FinishAvRoomEvent) {
|
||||
gameDelegate.exitGame()
|
||||
@@ -162,6 +157,8 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFirstRechargeEvent(event: FirstChargeEvent) {
|
||||
// banner里可能有首充入口:刷新下
|
||||
gameBinding.bannerWidget.refreshData()
|
||||
FirstChargePrizeDialog(
|
||||
requireContext(),
|
||||
event.chargeProdTitle,
|
||||
@@ -197,7 +194,9 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
|
||||
override fun initWidget() {
|
||||
super.initWidget()
|
||||
gameBinding.bannerWidget.disabledIndicator()
|
||||
registerWidget(RedPackageWidget::class.java.simpleName, gameBinding.redPackageWidget)
|
||||
registerWidget(RoomRankWidget::class.java.simpleName, gameBinding.rankWidget)
|
||||
registerWidget(RoomBannerWidget::class.java.simpleName, gameBinding.bannerWidget)
|
||||
}
|
||||
}
|
@@ -20,11 +20,13 @@ import com.yizhuan.erban.avroom.adapter.MicroViewAdapter;
|
||||
import com.yizhuan.erban.avroom.anotherroompk.RoomPkFinishDialog;
|
||||
import com.yizhuan.erban.avroom.anotherroompk.RoomPkForceFinishDialog;
|
||||
import com.yizhuan.erban.avroom.anotherroompk.RoomPkReceivedDialog;
|
||||
import com.yizhuan.erban.avroom.banner.RoomBannerWidget;
|
||||
import com.yizhuan.erban.avroom.dialog.MicQueueDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.PKMicQueueDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.PKResultDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.PKScoreBoardDialog;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog;
|
||||
import com.yizhuan.erban.avroom.gameplay.RoomGameplayWidget;
|
||||
import com.yizhuan.erban.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.yizhuan.erban.avroom.presenter.HomePartyPresenter;
|
||||
import com.yizhuan.erban.avroom.rank.RoomRankWidget;
|
||||
@@ -142,6 +144,8 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
super.initWidget();
|
||||
registerWidget(RedPackageWidget.class.getSimpleName(), gameBinding.redPackageWidget);
|
||||
registerWidget(RoomRankWidget.class.getSimpleName(), gameBinding.rankWidget);
|
||||
registerWidget(RoomBannerWidget.class.getSimpleName(), gameBinding.bannerWidget);
|
||||
registerWidget(RoomGameplayWidget.class.getSimpleName(), gameBinding.gameplayWidget);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@@ -155,7 +159,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
updateQueuingMicBtn();
|
||||
updatePkScoreBoard();
|
||||
initRoomPkOrder(AvRoomDataManager.get().showPkBeginTime, AvRoomDataManager.get().pkBeginTime);
|
||||
getMvpPresenter().getBannerList();
|
||||
// if (!GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
// UserModel.get().getCurrentUserInfo()
|
||||
// .compose(bindToLifecycle())
|
||||
@@ -806,36 +809,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
} else {
|
||||
gameBinding.layoutHourRank.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
GoldBoxHelper.isHideBox().subscribe(
|
||||
hide -> {
|
||||
if (hide != null && !hide) {
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.VISIBLE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
} else {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.VISIBLE);
|
||||
GlideApp.with(BasicConfig.INSTANCE.getAppContext())
|
||||
.load(GoldBoxHelper.getBoxIcon())
|
||||
.error(R.drawable.icon_room_treasure_box)
|
||||
.into(gameBinding.ivTreasureBox);
|
||||
}
|
||||
} else {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
}
|
||||
},
|
||||
throwable -> {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
});
|
||||
} else {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
setDragonView();
|
||||
}
|
||||
|
||||
@@ -969,15 +942,11 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
return pkMicQueueDialog != null && pkMicQueueDialog.isShowing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowBanner(List<BannerInfo> bannerInfos) {
|
||||
initRoomAct(gameBinding.activityImg, bannerInfos, 11f);
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onFirstRechargeEvent(FirstChargeEvent event) {
|
||||
gameBinding.ivFirstChargeEnter.setVisibility(View.GONE);
|
||||
// banner里可能有首充入口:刷新下
|
||||
gameBinding.bannerWidget.refreshData();
|
||||
new FirstChargePrizeDialog(requireContext(), event.getChargeProdTitle(), event.getFirstChargeRewardList()).openDialog();
|
||||
}
|
||||
|
||||
|
@@ -13,8 +13,10 @@ import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.adapter.OnMicroItemClickListener
|
||||
import com.yizhuan.erban.avroom.adapter.SingleAnchorMicroViewAdapter
|
||||
import com.yizhuan.erban.avroom.adapter.SingleRoomPKMicroViewAdapter
|
||||
import com.yizhuan.erban.avroom.banner.RoomBannerWidget
|
||||
import com.yizhuan.erban.avroom.dialog.RequestUpMicDialog
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog
|
||||
import com.yizhuan.erban.avroom.gameplay.RoomGameplayWidget
|
||||
import com.yizhuan.erban.avroom.presenter.SingleRoomPresenter
|
||||
import com.yizhuan.erban.avroom.rank.RoomRankWidget
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageWidget
|
||||
@@ -26,15 +28,12 @@ import com.yizhuan.erban.databinding.FragmentSingleRoomBinding
|
||||
import com.yizhuan.erban.fansteam.FansTeamJoinActivity
|
||||
import com.yizhuan.erban.fansteam.FansTeamJoinedActivity
|
||||
import com.yizhuan.erban.fansteam.FansTeamViewModel
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity
|
||||
import com.yizhuan.tutu.music.widget.MusicPlayerView
|
||||
import com.yizhuan.xchat_android_core.UriProvider
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.fansteam.FansTeamInitInfo
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.FansTeamMsgAttachment
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RequestUpmicAttachment
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPKAttachment
|
||||
@@ -85,24 +84,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
@SuppressLint("CheckResult")
|
||||
override fun initiate() {
|
||||
super.initiate()
|
||||
mvpPresenter?.getBannerList()
|
||||
initSpeedyMessage(gameBinding.flSpeedyMessage)
|
||||
GoldBoxHelper.isHideBox().subscribe(
|
||||
{
|
||||
if (it == false) {
|
||||
gameBinding.ivTreasureBox.visibility = View.VISIBLE
|
||||
gameBinding.ivTreasureBox.load(
|
||||
GoldBoxHelper.getBoxIcon(),
|
||||
defaultRes = R.drawable.icon_room_treasure_box
|
||||
)
|
||||
} else {
|
||||
gameBinding.ivTreasureBox.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
) {
|
||||
gameBinding.ivTreasureBox.visibility = View.GONE
|
||||
}
|
||||
|
||||
fansTeamViewModel.loadFansTeamInitInfo()
|
||||
|
||||
fansTeamViewModel.fansTeamInitInfoLiveData.observe(viewLifecycleOwner) {
|
||||
@@ -258,13 +240,10 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
}
|
||||
|
||||
override fun onShowBanner(dialogInfos: List<BannerInfo>) {
|
||||
initRoomAct(gameBinding.activityImg, dialogInfos, 10f)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFirstRechargeEvent(event: FirstChargeEvent) {
|
||||
gameBinding.ivFirstChargeEnter.visibility = View.GONE
|
||||
// banner里可能有首充入口:刷新下
|
||||
gameBinding.bannerWidget.refreshData()
|
||||
FirstChargePrizeDialog(
|
||||
requireContext(),
|
||||
event.chargeProdTitle,
|
||||
@@ -276,6 +255,8 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
super.initWidget()
|
||||
registerWidget(RedPackageWidget::class.java.simpleName, gameBinding.redPackageWidget)
|
||||
registerWidget(RoomRankWidget::class.java.simpleName, gameBinding.rankWidget)
|
||||
registerWidget(RoomBannerWidget::class.java.simpleName, gameBinding.bannerWidget)
|
||||
registerWidget(RoomGameplayWidget::class.java.simpleName, gameBinding.gameplayWidget)
|
||||
}
|
||||
|
||||
override fun onInitMusicPlayerView(view: MusicPlayerView) {
|
||||
|
@@ -0,0 +1,126 @@
|
||||
package com.yizhuan.erban.avroom.gameplay
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.chuhai.utils.ktx.singleClick
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog
|
||||
import com.yizhuan.erban.databinding.RoomGameplayWidgetBinding
|
||||
import com.yizhuan.erban.shipantics.PullRadishActivity
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.treasurefairy.HomeFairyActivity
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.erban.ui.webview.room_banner.RoomWebDialogActivity
|
||||
import com.yizhuan.erban.utils.CommonJumpHelper
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomIcon
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.support.room.FrameLayoutRoomWidget
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomView
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/20 10:42
|
||||
* Desc:玩法活动
|
||||
**/
|
||||
class RoomGameplayWidget : FrameLayoutRoomWidget {
|
||||
private val adapter = RoomPlayListAdapter()
|
||||
private val binding: RoomGameplayWidgetBinding =
|
||||
DataBindingUtil.inflate(
|
||||
LayoutInflater.from(
|
||||
context
|
||||
), R.layout.room_gameplay_widget, this, true
|
||||
)
|
||||
|
||||
private var isOpened = false
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
|
||||
init {
|
||||
binding.recyclerView.adapter = adapter
|
||||
binding.ivSwitch.setOnClickListener {
|
||||
switchUI(!isOpened)
|
||||
}
|
||||
binding.ivIcon.singleClick {
|
||||
adapter.getItem(0)?.let {
|
||||
jump(it)
|
||||
}
|
||||
}
|
||||
adapter.setOnItemClickListener { adapter, view, position ->
|
||||
(adapter.getItem(position) as? RoomIcon)?.let {
|
||||
jump(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onInitialize(roomView: RoomView, roomContext: RoomContext) {
|
||||
super.onInitialize(roomView, roomContext)
|
||||
refreshData()
|
||||
}
|
||||
|
||||
private fun refreshData() {
|
||||
val disposable = AvRoomModel.get().roomGamePlayList
|
||||
.subscribe { list: List<RoomIcon> ->
|
||||
loadData(list)
|
||||
}
|
||||
getCompositeDisposable().add(disposable)
|
||||
}
|
||||
|
||||
private fun switchUI(open: Boolean) {
|
||||
this.isOpened = open
|
||||
if (open) {
|
||||
binding.recyclerView.isVisible = true
|
||||
binding.ivIcon.isVisible = false
|
||||
binding.ivSwitch.setImageResource(R.drawable.room_gameplay_ic_arrow_right)
|
||||
} else {
|
||||
binding.recyclerView.isVisible = false
|
||||
binding.ivIcon.isVisible = true
|
||||
binding.ivSwitch.setImageResource(R.drawable.room_gameplay_ic_arrow_left)
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadData(list: List<RoomIcon>) {
|
||||
this.isVisible = list.isNotEmpty()
|
||||
adapter.setNewData(list)
|
||||
binding.ivIcon.load(list.firstOrNull()?.icon)
|
||||
}
|
||||
|
||||
private fun jump(data: RoomIcon) {
|
||||
if (data.isSeizeTreasure()) {
|
||||
HomeFairyActivity.start(context)
|
||||
} else if (data.isFirstCharge()) {
|
||||
FirstChargeDialog.start(context)
|
||||
} else if (data.isFindLove()) {
|
||||
GoldBoxHelper.handleBoxClick(context)
|
||||
} else if (data.isNauticalAdventure()) {
|
||||
PullRadishActivity.start(context)
|
||||
} else {
|
||||
val url = data.skipContent
|
||||
if (data.skipType == 3 && !url.isNullOrEmpty()) {
|
||||
if (data.showType == 2) {
|
||||
RoomWebDialogActivity.start(context, url, false)
|
||||
} else {
|
||||
CommonWebViewActivity.start(context, url)
|
||||
}
|
||||
} else {
|
||||
CommonJumpHelper.bannerJump(context, data)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
package com.yizhuan.erban.avroom.gameplay
|
||||
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomIcon
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/20 11:38
|
||||
* Desc:
|
||||
**/
|
||||
class RoomPlayListAdapter :
|
||||
BaseQuickAdapter<RoomIcon, BaseViewHolder>(R.layout.room_gameplay_item) {
|
||||
override fun convert(helper: BaseViewHolder, item: RoomIcon?) {
|
||||
helper.getView<ImageView>(R.id.iv_icon).load(item?.icon)
|
||||
}
|
||||
}
|
@@ -1,15 +1,7 @@
|
||||
package com.yizhuan.erban.avroom.presenter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import com.yizhuan.erban.avroom.view.IGameRoomView;
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -20,37 +12,4 @@ import java.util.List;
|
||||
*/
|
||||
public class GameRoomPresenter extends BaseRoomPresenter<IGameRoomView> {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void getBannerList() {
|
||||
AvRoomModel.get().getRoomBanner()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(bannerInfos -> {
|
||||
if (bannerInfos == null) bannerInfos = new ArrayList<>();
|
||||
final boolean firstCharge = UserUtils.getUserInfo().isFirstCharge();
|
||||
if (firstCharge) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFirstCharge(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
if(GoldBoxHelper.isShowFairy()){
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFairy(true);
|
||||
bannerInfos.add(firstCharge ? 1 : 0, bannerInfo);
|
||||
}
|
||||
List<BannerInfo> finalBannerInfos = bannerInfos;
|
||||
GoldBoxHelper.isHideBox()
|
||||
.subscribe(isHide -> {
|
||||
if (!isHide) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setBox(true);
|
||||
int index = 0;
|
||||
if (firstCharge) index++;
|
||||
if (GoldBoxHelper.isShowFairy()) index++;
|
||||
finalBannerInfos.add(index, bannerInfo);
|
||||
}
|
||||
getMvpView().onShowBanner(finalBannerInfos);
|
||||
}, throwable -> getMvpView().onShowBanner(finalBannerInfos));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -12,12 +12,10 @@ import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyView;
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.FaceAttachment;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
@@ -297,49 +295,4 @@ public class HomePartyPresenter extends BaseRoomPresenter<IHomePartyView> {
|
||||
.subscribe(s -> SingleToastUtil.showToast(ResUtil.getString(R.string.avroom_presenter_homepartypresenter_01))
|
||||
, e -> SingleToastUtil.showToast(e.getMessage()));
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void getBannerList() {
|
||||
mAvRoomModel.getRoomBanner()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(bannerInfos -> {
|
||||
final boolean firstCharge = UserUtils.getUserInfo().isFirstCharge();
|
||||
if (GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
if (firstCharge) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFirstCharge(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
if (GoldBoxHelper.isShowRadish()) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setRadish(true);
|
||||
bannerInfos.add(firstCharge ? 1 : 0, bannerInfo);
|
||||
}
|
||||
GoldBoxHelper.isHideBox()
|
||||
.subscribe(isHide -> {
|
||||
if (!isHide) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setBox(true);
|
||||
int index = 0;
|
||||
if (firstCharge) index++;
|
||||
if (GoldBoxHelper.isShowRadish()) index++;
|
||||
bannerInfos.add(index, bannerInfo);
|
||||
}
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
}, throwable -> getMvpView().onShowBanner(bannerInfos));
|
||||
} else {
|
||||
if(GoldBoxHelper.isShowFairy()){
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFairy(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
if (firstCharge) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFirstCharge(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,7 @@
|
||||
package com.yizhuan.erban.avroom.presenter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import com.yizhuan.erban.avroom.view.ISingleRoomView;
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
|
||||
/**
|
||||
* <p> </p>
|
||||
@@ -14,50 +10,4 @@ import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
* @date 2017/12/8
|
||||
*/
|
||||
public class SingleRoomPresenter extends BaseRoomPresenter<ISingleRoomView> {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void getBannerList() {
|
||||
mAvRoomModel.getRoomBanner()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(bannerInfos -> {
|
||||
final boolean firstCharge = UserUtils.getUserInfo().isFirstCharge();
|
||||
if (GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
if (firstCharge) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFirstCharge(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
if (GoldBoxHelper.isShowRadish()) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setRadish(true);
|
||||
bannerInfos.add(firstCharge ? 1 : 0, bannerInfo);
|
||||
}
|
||||
GoldBoxHelper.isHideBox()
|
||||
.subscribe(isHide -> {
|
||||
if (!isHide) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setBox(true);
|
||||
int index = 0;
|
||||
if (firstCharge) index++;
|
||||
if (GoldBoxHelper.isShowRadish()) index++;
|
||||
bannerInfos.add(index, bannerInfo);
|
||||
}
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
}, throwable -> getMvpView().onShowBanner(bannerInfos));
|
||||
} else {
|
||||
if(GoldBoxHelper.isShowFairy()){
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFairy(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
if (firstCharge) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFirstCharge(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,5 @@
|
||||
package com.yizhuan.erban.avroom.view;
|
||||
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 轰趴房View层 </p>
|
||||
@@ -12,6 +9,4 @@ import java.util.List;
|
||||
*/
|
||||
public interface IGameRoomView extends IBaseRoomView {
|
||||
|
||||
void onShowBanner(List<BannerInfo> dialogInfos);
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,7 @@
|
||||
package com.yizhuan.erban.avroom.view;
|
||||
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 轰趴房View层 </p>
|
||||
@@ -20,6 +18,4 @@ public interface IHomePartyView extends IBaseRoomView {
|
||||
* 礼物值模式下换麦
|
||||
*/
|
||||
void onGiftValueChangeMic(int micPosition, String uId, boolean isInviteUpMic, RoomInfo roomInfo);
|
||||
|
||||
void onShowBanner(List<BannerInfo> bannerInfos);
|
||||
}
|
||||
|
@@ -1,8 +1,5 @@
|
||||
package com.yizhuan.erban.avroom.view;
|
||||
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 轰趴房View层 </p>
|
||||
@@ -12,6 +9,4 @@ import java.util.List;
|
||||
*/
|
||||
public interface ISingleRoomView extends IBaseRoomView {
|
||||
|
||||
void onShowBanner(List<BannerInfo> dialogInfos);
|
||||
|
||||
}
|
||||
|
@@ -1,80 +0,0 @@
|
||||
package com.yizhuan.erban.home.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import com.netease.nim.uikit.support.glide.GlideApp
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog
|
||||
import com.yizhuan.erban.shipantics.PullRadishActivity
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.treasurefairy.HomeFairyActivity
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.erban.ui.webview.room_banner.RoomBannerWebDialogActivity
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapter
|
||||
import com.yizhuan.erban.utils.CommonJumpHelper
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig
|
||||
import okhttp3.internal.filterList
|
||||
|
||||
class RoomActAdapter(private val mContext: Context, private val data: List<BannerInfo>) :
|
||||
StaticPagerAdapter() {
|
||||
override fun getView(container: ViewGroup, position: Int): View {
|
||||
val view = LayoutInflater.from(mContext).inflate(R.layout.item_room_act, container, false)
|
||||
val ivCover = view.findViewById<ImageView>(R.id.iv_cover)
|
||||
val bannerInfo = data[position]
|
||||
val actId = bannerInfo.bannerId.toString()
|
||||
ivCover.scaleType = ImageView.ScaleType.CENTER_CROP
|
||||
if (bannerInfo.isFairy) {
|
||||
ivCover.setImageResource(R.drawable.ic_fairy_entrance)
|
||||
} else if (bannerInfo.isFirstCharge) {
|
||||
ivCover.setImageResource(R.drawable.ic_first_charge_enter)
|
||||
} else if (bannerInfo.isBox) {
|
||||
GlideApp.with(BasicConfig.INSTANCE.appContext)
|
||||
.load(GoldBoxHelper.getBoxIcon())
|
||||
.error(R.drawable.icon_room_treasure_box)
|
||||
.into(ivCover)
|
||||
} else if (bannerInfo.isRadish) {
|
||||
ivCover.setImageResource(R.drawable.ic_radish_entrance)
|
||||
} else {
|
||||
ImageLoadUtils.loadImage(
|
||||
mContext,
|
||||
bannerInfo.bannerPic,
|
||||
ivCover,
|
||||
R.drawable.default_cover
|
||||
)
|
||||
}
|
||||
ivCover.setOnClickListener { v: View? ->
|
||||
if (bannerInfo.isFairy) {
|
||||
HomeFairyActivity.start(mContext)
|
||||
} else if (bannerInfo.isFirstCharge) {
|
||||
FirstChargeDialog.start(mContext)
|
||||
} else if (bannerInfo.isBox) {
|
||||
GoldBoxHelper.handleBoxClick(mContext)
|
||||
} else if (bannerInfo.isRadish) {
|
||||
PullRadishActivity.start(mContext)
|
||||
} else {
|
||||
AvRoomModel.get().activityClickLog("2", actId).subscribe()
|
||||
if (bannerInfo.skipType == 3) {
|
||||
val list = data.filterList {
|
||||
skipType == 3
|
||||
}
|
||||
val newPosition = list.indexOfFirst {
|
||||
it == bannerInfo
|
||||
}
|
||||
RoomBannerWebDialogActivity.start(mContext, newPosition, list)
|
||||
} else {
|
||||
CommonJumpHelper.bannerJump(mContext, bannerInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
return view
|
||||
}
|
||||
|
||||
override fun getCount(): Int {
|
||||
return data.size
|
||||
}
|
||||
}
|
@@ -38,8 +38,7 @@ public class DialogWebViewActivity extends CommonWebViewActivity {
|
||||
View topView = findViewById(R.id.v_top);
|
||||
topView.setOnClickListener(v -> finish());
|
||||
ViewGroup.LayoutParams params = topView.getLayoutParams();
|
||||
params.height = ScreenUtil.screenHeight / 3;
|
||||
topView.setLayoutParams(params);
|
||||
params.height = getTopMargin();
|
||||
showTitleBar = getIntent().getBooleanExtra("showTitleBar", true);
|
||||
if (!showTitleBar) {
|
||||
layoutTitleBar.setVisibility(View.GONE);
|
||||
@@ -50,4 +49,8 @@ public class DialogWebViewActivity extends CommonWebViewActivity {
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_dialog_web_view;
|
||||
}
|
||||
|
||||
protected int getTopMargin() {
|
||||
return ScreenUtil.screenHeight / 3;
|
||||
}
|
||||
}
|
||||
|
@@ -8,30 +8,31 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomIcon
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/11/17 12:30
|
||||
* Desc:
|
||||
**/
|
||||
class RoomBannerTabAdapter :
|
||||
BaseQuickAdapter<BannerInfo, BaseViewHolder>(R.layout.room_banner_item_tab) {
|
||||
BaseQuickAdapter<RoomIcon, BaseViewHolder>(R.layout.room_banner_item_tab) {
|
||||
|
||||
private var selectedPosition = -1
|
||||
override fun convert(helper: BaseViewHolder, item: BannerInfo?) {
|
||||
helper.getView<ImageView>(R.id.iv_content).load(item?.bannerUrl)
|
||||
override fun convert(helper: BaseViewHolder, item: RoomIcon?) {
|
||||
helper.getView<ImageView>(R.id.iv_content).load(item?.icon)
|
||||
convertState(helper, item)
|
||||
}
|
||||
|
||||
override fun convertPayloads(
|
||||
helper: BaseViewHolder,
|
||||
item: BannerInfo?,
|
||||
item: RoomIcon?,
|
||||
payloads: MutableList<Any>
|
||||
) {
|
||||
super.convertPayloads(helper, item, payloads)
|
||||
convertState(helper, item)
|
||||
}
|
||||
|
||||
private fun convertState(helper: BaseViewHolder, item: BannerInfo?) {
|
||||
private fun convertState(helper: BaseViewHolder, item: RoomIcon?) {
|
||||
helper.getView<View>(R.id.v_selector).isInvisible =
|
||||
helper.absoluteAdapterPosition != selectedPosition
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chuhai.utils.UiUtils
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomIcon
|
||||
|
||||
|
||||
/**
|
||||
@@ -24,8 +24,8 @@ class RoomBannerWebDialogActivity : CommonWebViewActivity() {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, position: Int, list: List<BannerInfo>) {
|
||||
val newList = ArrayList<BannerInfo>()
|
||||
fun start(context: Context, position: Int, list: List<RoomIcon>) {
|
||||
val newList = ArrayList<RoomIcon>()
|
||||
newList.addAll(list)
|
||||
val intent = Intent(context, RoomBannerWebDialogActivity::class.java)
|
||||
intent.putExtra("position", position)
|
||||
@@ -56,7 +56,7 @@ class RoomBannerWebDialogActivity : CommonWebViewActivity() {
|
||||
webView.setBackgroundColor(Color.parseColor("#C9CBD1"))
|
||||
recyclerView = findViewById(R.id.recyclerView)
|
||||
val position = 0.coerceAtLeast(intent.getIntExtra("position", 0))
|
||||
val list = intent.getSerializableExtra("list") as? ArrayList<BannerInfo>
|
||||
val list = intent.getSerializableExtra("list") as? ArrayList<RoomIcon>
|
||||
// if ((list?.size ?: 0) <= 1) {
|
||||
// recyclerView?.isVisible = false
|
||||
// }
|
||||
@@ -74,7 +74,7 @@ class RoomBannerWebDialogActivity : CommonWebViewActivity() {
|
||||
}
|
||||
|
||||
private fun switchTab(position: Int) {
|
||||
val url = adapter?.getItem(position)?.skipUri
|
||||
val url = adapter?.getItem(position)?.skipContent
|
||||
showWebView(url)
|
||||
adapter?.select(position)
|
||||
recyclerView?.post {
|
||||
|
@@ -0,0 +1,26 @@
|
||||
package com.yizhuan.erban.ui.webview.room_banner
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.Util
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/20 17:47
|
||||
* Desc:房间半屏Web弹窗
|
||||
**/
|
||||
class RoomWebDialogActivity : DialogWebViewActivity() {
|
||||
|
||||
companion object {
|
||||
fun start(context: Context, url: String, showTitleBar: Boolean) {
|
||||
val intent = Intent(context, RoomWebDialogActivity::class.java)
|
||||
intent.putExtra("url", url)
|
||||
intent.putExtra("showTitleBar", showTitleBar)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getTopMargin(): Int {
|
||||
return Util.dip2px(this, 168f)
|
||||
}
|
||||
}
|
@@ -14,6 +14,7 @@ import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.ui.im.RouterHandler;
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.IRouterData;
|
||||
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
||||
|
||||
/**
|
||||
@@ -27,7 +28,7 @@ public class CommonJumpHelper {
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void bannerJump(Context context, BannerInfo bannerInfo) {
|
||||
public static void bannerJump(Context context, IRouterData bannerInfo) {
|
||||
|
||||
|
||||
if (null == context || null == bannerInfo) {
|
||||
|
9
app/src/main/res/drawable/room_gameplay_bg.xml
Normal file
9
app/src/main/res/drawable/room_gameplay_bg.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<stroke
|
||||
android:width="2px"
|
||||
android:color="#CCFFFFFF" />
|
||||
<corners android:radius="@dimen/dp_12" />
|
||||
</shape>
|
14
app/src/main/res/drawable/room_gameplay_ic_arrow_left.xml
Normal file
14
app/src/main/res/drawable/room_gameplay_ic_arrow_left.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="14dp"
|
||||
android:height="14dp"
|
||||
android:viewportWidth="14"
|
||||
android:viewportHeight="14">
|
||||
<path
|
||||
android:pathData="M4.148,7.389C3.951,7.174 3.951,6.826 4.148,6.611L9.139,1.161C9.336,0.946 9.655,0.946 9.852,1.161C10.049,1.376 10.049,1.725 9.852,1.94L5.217,7L9.852,12.06C10.049,12.275 10.049,12.624 9.852,12.839C9.655,13.054 9.336,13.054 9.139,12.839L4.148,7.389Z"
|
||||
android:strokeAlpha="0.90000004"
|
||||
android:strokeWidth="0.4"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:strokeColor="#FFFFFF"
|
||||
android:fillType="evenOdd"
|
||||
android:fillAlpha="0.90000004"/>
|
||||
</vector>
|
14
app/src/main/res/drawable/room_gameplay_ic_arrow_right.xml
Normal file
14
app/src/main/res/drawable/room_gameplay_ic_arrow_right.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="14dp"
|
||||
android:height="14dp"
|
||||
android:viewportWidth="14"
|
||||
android:viewportHeight="14">
|
||||
<path
|
||||
android:pathData="M9.852,7.389C10.049,7.174 10.049,6.826 9.852,6.611L4.861,1.161C4.664,0.946 4.345,0.946 4.148,1.161C3.951,1.376 3.951,1.725 4.148,1.94L8.783,7L4.148,12.06C3.951,12.275 3.951,12.624 4.148,12.839C4.345,13.054 4.664,13.054 4.861,12.839L9.852,7.389Z"
|
||||
android:strokeAlpha="0.90000004"
|
||||
android:strokeWidth="0.4"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:strokeColor="#FFFFFF"
|
||||
android:fillType="evenOdd"
|
||||
android:fillAlpha="0.90000004"/>
|
||||
</vector>
|
7
app/src/main/res/drawable/shape_727272_7dp.xml
Normal file
7
app/src/main/res/drawable/shape_727272_7dp.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#727272" />
|
||||
<corners android:radius="@dimen/dp_7" />
|
||||
</shape>
|
16
app/src/main/res/layout/room_banner_widget.xml
Normal file
16
app/src/main/res/layout/room_banner_widget.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView 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:id="@+id/pagerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:rollviewpager_hint_gravity="center"
|
||||
app:rollviewpager_hint_paddingBottom="0px"
|
||||
app:rollviewpager_hint_paddingTop="4dp"
|
||||
tools:layout_height="65dp"
|
||||
tools:layout_width="58dp" />
|
||||
|
||||
</layout>
|
18
app/src/main/res/layout/room_gameplay_item.xml
Normal file
18
app/src/main/res/layout/room_gameplay_item.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:background="@drawable/shape_727272_7dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
82
app/src/main/res/layout/room_gameplay_widget.xml
Normal file
82
app/src/main/res/layout/room_gameplay_widget.xml
Normal file
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:background="@color/black">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:cardBackgroundColor="@color/transparent"
|
||||
app:cardCornerRadius="@dimen/dp_12"
|
||||
app:cardElevation="0px"
|
||||
app:cardMaxElevation="0px"
|
||||
app:layout_constraintBottom_toBottomOf="@id/layout_content"
|
||||
app:layout_constraintEnd_toEndOf="@id/layout_content"
|
||||
app:layout_constraintStart_toStartOf="@id/layout_content"
|
||||
app:layout_constraintTop_toTopOf="@id/layout_content">
|
||||
|
||||
<com.github.mmin18.widget.RealtimeBlurView
|
||||
android:id="@+id/blur_view_icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:realtimeBlurRadius="25dp"
|
||||
app:realtimeDownsampleFactor="4"
|
||||
app:realtimeOverlayColor="#80000000" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/room_gameplay_bg" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/layout_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="@dimen/dp_58"
|
||||
android:layout_height="@dimen/dp_58"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@drawable/default_cover" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="@dimen/dp_176"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:spanCount="3"/>
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="-5dp"
|
||||
android:paddingVertical="@dimen/dp_15"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingEnd="6dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/room_gameplay_ic_arrow_left"
|
||||
app:layout_constraintBottom_toBottomOf="@id/layout_content"
|
||||
app:layout_constraintEnd_toStartOf="@id/layout_content"
|
||||
app:layout_constraintTop_toTopOf="@id/layout_content" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
@@ -207,6 +207,9 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="room_dialog_web_view_activity" parent="dialog_web_view_activity">
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
</style>
|
||||
|
||||
<style name="FullScreenDialog" parent="@android:style/Theme.Dialog">
|
||||
<!--<item name="android:windowBackground">@drawable/filled_activity_bg</item>-->
|
||||
|
@@ -151,7 +151,8 @@
|
||||
android:layout_above="@+id/bottom_view"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="6dp">
|
||||
android:layout_marginBottom="6dp"
|
||||
tools:layout_alignParentBottom="true">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_speedy_message"
|
||||
@@ -209,90 +210,36 @@
|
||||
app:shaderMode="rightToLeft"
|
||||
app:shaderStartColor="#FA4771" />
|
||||
|
||||
<com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/activity_img"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="70dp"
|
||||
<com.yizhuan.erban.avroom.banner.RoomBannerWidget
|
||||
android:id="@+id/bannerWidget"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_below="@id/micro_view"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:rollviewpager_hint_gravity="center" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box_cp"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_below="@id/activity_img"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_treasure_box"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="@string/layout_fragment_av_room_game_01" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_first_charge_enter"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_above="@id/iv_radish_entrance"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_first_charge_enter"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="@string/layout_fragment_av_room_game_02"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_radish_entrance"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_above="@id/red_package_widget"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_radish_entrance"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="@string/layout_fragment_av_room_game_03"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.yizhuan.erban.avroom.redpackage.RedPackageWidget
|
||||
android:id="@+id/red_package_widget"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="58dp"
|
||||
android:layout_above="@id/iv_treasure_box"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="18.5dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_above="@id/iv_queuing_micro"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="9.5dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_treasure_box"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="@string/layout_fragment_av_room_game_04"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_queuing_micro"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/fl_speedy_message"
|
||||
android:layout_above="@id/gameplay_widget"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_dating_queuing_micro"
|
||||
@@ -300,6 +247,17 @@
|
||||
tools:contentDescription="@string/layout_fragment_av_room_game_05"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.yizhuan.erban.avroom.gameplay.RoomGameplayWidget
|
||||
android:id="@+id/gameplay_widget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/fl_speedy_message"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -315,7 +273,8 @@
|
||||
android:layout_width="86dp"
|
||||
android:layout_height="92dp"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="@string/layout_fragment_av_room_game_06">
|
||||
tools:contentDescription="@string/layout_fragment_av_room_game_06"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/play_dragon"
|
||||
@@ -353,7 +312,8 @@
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_play_together"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="@string/layout_fragment_av_room_game_09" />
|
||||
tools:contentDescription="@string/layout_fragment_av_room_game_09"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -98,21 +98,20 @@
|
||||
android:layout_marginEnd="90dp"
|
||||
android:layout_marginBottom="@dimen/dp_10" />
|
||||
|
||||
<com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/activity_img"
|
||||
<com.yizhuan.erban.avroom.banner.RoomBannerWidget
|
||||
android:id="@+id/bannerWidget"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_above="@id/bottom_view"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:rollviewpager_hint_gravity="center" />
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<com.yizhuan.erban.avroom.redpackage.RedPackageWidget
|
||||
android:id="@+id/red_package_widget"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="58dp"
|
||||
android:layout_above="@id/activity_img"
|
||||
android:layout_above="@id/bannerWidget"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="8.5dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
|
@@ -194,56 +194,14 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_first_charge_enter"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_first_charge_enter"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/iv_radish_entrance"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:contentDescription="@string/layout_fragment_single_room_05" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_radish_entrance"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_radish_entrance"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/red_package_widget"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:contentDescription="@string/layout_fragment_single_room_06"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_treasure_box"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/fl_speedy_message"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:contentDescription="@string/layout_fragment_single_room_07"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.yizhuan.erban.avroom.redpackage.RedPackageWidget
|
||||
android:id="@+id/red_package_widget"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="58dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:layout_marginBottom="72dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/iv_treasure_box"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_treasure_box"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_treasure_box"
|
||||
app:layout_constraintBottom_toBottomOf="@id/gameplay_widget"
|
||||
app:layout_constraintEnd_toEndOf="@id/gameplay_widget"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.yizhuan.erban.avroom.widget.MessageView
|
||||
@@ -259,18 +217,29 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/barrier_micro" />
|
||||
|
||||
|
||||
<com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/activity_img"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="75dp"
|
||||
<com.yizhuan.erban.avroom.banner.RoomBannerWidget
|
||||
android:id="@+id/bannerWidget"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_below="@id/barrier_micro"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/barrier_micro"
|
||||
app:rollviewpager_hint_gravity="center" />
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.yizhuan.erban.avroom.gameplay.RoomGameplayWidget
|
||||
android:id="@+id/gameplay_widget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/fl_speedy_message"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/input_layout"
|
||||
|
@@ -13,7 +13,7 @@ import lombok.ToString;
|
||||
*/
|
||||
@ToString
|
||||
@Data
|
||||
public class BannerInfo implements Parcelable, Serializable {
|
||||
public class BannerInfo implements Parcelable, Serializable, IRouterData {
|
||||
/**
|
||||
* 跳转app
|
||||
*/
|
||||
@@ -103,4 +103,5 @@ public class BannerInfo implements Parcelable, Serializable {
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,18 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/20 16:43
|
||||
* Desc:路由跳转参数
|
||||
**/
|
||||
interface IRouterData : Serializable {
|
||||
|
||||
fun getSkipUri(): String?
|
||||
|
||||
fun getSkipType(): Int
|
||||
|
||||
fun getRouterType(): String?
|
||||
|
||||
fun getRouterValue(): String?
|
||||
}
|
@@ -0,0 +1,57 @@
|
||||
package com.yizhuan.xchat_android_core.room.bean
|
||||
|
||||
import com.yizhuan.xchat_android_core.home.bean.IRouterData
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/20 11:49
|
||||
* Desc:房间资源位
|
||||
**/
|
||||
data class RoomIcon(
|
||||
val code: String? = null,
|
||||
val createTime: String? = null,
|
||||
val endTime: String? = null,
|
||||
val icon: String? = null,
|
||||
val id: Long? = null,
|
||||
val isEnabled: Int? = null,
|
||||
val isManual: Int? = null,
|
||||
val name: String? = null,
|
||||
val ruleValue: String? = null,
|
||||
val seqNo: Int? = null,
|
||||
// showType 1 全屏 2 半屏
|
||||
val showType: Int? = null,
|
||||
val skipContent: String? = null,
|
||||
// skipType 0 无 1 native 2 房间内 3 H5
|
||||
val skipType: Int? = null,
|
||||
val startTime: String? = null,
|
||||
val type: Int? = null,
|
||||
val updateTime: String? = null,
|
||||
val url: String? = null,
|
||||
// 标记(本地自己加的,部分业务需要)
|
||||
var tag: String? = null
|
||||
) : IRouterData {
|
||||
|
||||
companion object {
|
||||
const val TAG_GAMEPLAY = "GAMEPLAY"
|
||||
}
|
||||
|
||||
fun isFirstCharge(): Boolean = code == "FIRST_CHARGE"
|
||||
fun isSeizeTreasure(): Boolean = code == "SEIZE_TREASURE"
|
||||
fun isFindLove(): Boolean = code == "FIND_LOVE"
|
||||
fun isNauticalAdventure(): Boolean = code == "NAUTICAL_ADVENTURE"
|
||||
|
||||
override fun getSkipUri(): String? {
|
||||
return skipContent
|
||||
}
|
||||
|
||||
override fun getSkipType(): Int {
|
||||
return skipType ?: 0
|
||||
}
|
||||
|
||||
override fun getRouterType(): String? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getRouterValue(): String? {
|
||||
return null
|
||||
}
|
||||
}
|
@@ -155,6 +155,10 @@ public class RoomInfo implements Parcelable,Serializable {
|
||||
private long pkBeginTime;
|
||||
|
||||
|
||||
public long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
protected RoomInfo(Parcel in) {
|
||||
uid = in.readLong();
|
||||
officeUser = in.readInt();
|
||||
|
@@ -41,6 +41,7 @@ import com.yizhuan.xchat_android_core.patriarch.exception.PmRoomLimitException;
|
||||
import com.yizhuan.xchat_android_core.room.activitytimer.ActivityTimerEvent;
|
||||
import com.yizhuan.xchat_android_core.room.activitytimer.TimerBean;
|
||||
import com.yizhuan.xchat_android_core.room.bean.BroadcastInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomIcon;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomResult;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomWelcomeConfig;
|
||||
@@ -75,6 +76,7 @@ import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.functions.BiFunction;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.observers.DisposableObserver;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
@@ -126,67 +128,67 @@ public class AvRoomModel extends RoomBaseModel implements IAvRoomModel {
|
||||
@Override
|
||||
public Observable<EnterChatRoomResultData> enterRoom(final long roomId, final int retryCount, final int fromType, final String fromNick, final String fromUid) {
|
||||
return Observable.create((ObservableOnSubscribe<EnterChatRoomResultData>) e -> {
|
||||
EnterChatRoomData enterChatRoomData = new EnterChatRoomData(String.valueOf(roomId));
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
if (userInfo == null) {
|
||||
e.onError(new Throwable("userInfo is null"));
|
||||
return;
|
||||
}
|
||||
NobleInfo nobleInfo = userInfo.getNobleInfo();
|
||||
HeadWearInfo headWearInfo = userInfo.getUserHeadwear();
|
||||
UserLevelVo userLevelVo = userInfo.getUserLevelVo();
|
||||
CarInfo carInfo = userInfo.getCarInfo();
|
||||
Map<String, Object> map = new HashMap<>(1);
|
||||
Map<String, Object> valueMap = userInfo.toMap(null, userInfo);
|
||||
EnterChatRoomData enterChatRoomData = new EnterChatRoomData(String.valueOf(roomId));
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
if (userInfo == null) {
|
||||
e.onError(new Throwable("userInfo is null"));
|
||||
return;
|
||||
}
|
||||
NobleInfo nobleInfo = userInfo.getNobleInfo();
|
||||
HeadWearInfo headWearInfo = userInfo.getUserHeadwear();
|
||||
UserLevelVo userLevelVo = userInfo.getUserLevelVo();
|
||||
CarInfo carInfo = userInfo.getCarInfo();
|
||||
Map<String, Object> map = new HashMap<>(1);
|
||||
Map<String, Object> valueMap = userInfo.toMap(null, userInfo);
|
||||
|
||||
valueMap.put("fromType", fromType);
|
||||
valueMap.put("fromNick", fromNick);
|
||||
valueMap.put("fromUid", fromUid);
|
||||
valueMap.put("fromType", fromType);
|
||||
valueMap.put("fromNick", fromNick);
|
||||
valueMap.put("fromUid", fromUid);
|
||||
|
||||
if (userLevelVo != null) {
|
||||
valueMap = userLevelVo.toMap((nobleInfo != null && nobleInfo.getLevel() > 0) ? nobleInfo.toMap(valueMap) : valueMap);
|
||||
valueMap.put("experLevelSeq", userLevelVo.getExperLevelSeq());
|
||||
}
|
||||
if (carInfo != null) {
|
||||
valueMap = carInfo.toMap(valueMap, carInfo);
|
||||
}
|
||||
if (userLevelVo != null) {
|
||||
valueMap = userLevelVo.toMap((nobleInfo != null && nobleInfo.getLevel() > 0) ? nobleInfo.toMap(valueMap) : valueMap);
|
||||
valueMap.put("experLevelSeq", userLevelVo.getExperLevelSeq());
|
||||
}
|
||||
if (carInfo != null) {
|
||||
valueMap = carInfo.toMap(valueMap, carInfo);
|
||||
}
|
||||
|
||||
valueMap = toMap(valueMap, userInfo.getNameplateWord(), userInfo.getNameplatePic(), userInfo.isCustomWord());
|
||||
valueMap = toMap(valueMap, userInfo.getNameplateWord(), userInfo.getNameplatePic(), userInfo.isCustomWord());
|
||||
|
||||
//多个判断,头饰不过期才传pic
|
||||
if (headWearInfo != null && headWearInfo.getStatus() == HeadWearInfo.STATUS_IN_USED) {
|
||||
valueMap = headWearInfo.toMap(valueMap);
|
||||
}
|
||||
//多个判断,头饰不过期才传pic
|
||||
if (headWearInfo != null && headWearInfo.getStatus() == HeadWearInfo.STATUS_IN_USED) {
|
||||
valueMap = headWearInfo.toMap(valueMap);
|
||||
}
|
||||
|
||||
valueMap.put(SuperAdminUtil.PLATFORM_ROLE, userInfo.getPlatformRole());
|
||||
valueMap.put(SuperAdminUtil.PLATFORM_ROLE, userInfo.getPlatformRole());
|
||||
|
||||
if (valueMap.size() > 0) {
|
||||
map.put(String.valueOf(userInfo.getUid()), valueMap);
|
||||
}
|
||||
if (map.size() > 0)
|
||||
enterChatRoomData.setExtension(map);
|
||||
if (valueMap.size() > 0) {
|
||||
map.put(String.valueOf(userInfo.getUid()), valueMap);
|
||||
}
|
||||
if (map.size() > 0)
|
||||
enterChatRoomData.setExtension(map);
|
||||
|
||||
AbortableFuture<EnterChatRoomResultData> enterChatRoomEx =
|
||||
NIMChatRoomSDK.getChatRoomService().enterChatRoomEx(enterChatRoomData, retryCount);
|
||||
enterChatRoomEx.setCallback(new RequestCallback<EnterChatRoomResultData>() {
|
||||
AbortableFuture<EnterChatRoomResultData> enterChatRoomEx =
|
||||
NIMChatRoomSDK.getChatRoomService().enterChatRoomEx(enterChatRoomData, retryCount);
|
||||
enterChatRoomEx.setCallback(new RequestCallback<EnterChatRoomResultData>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(EnterChatRoomResultData param) {
|
||||
e.onNext(param);
|
||||
e.onComplete();
|
||||
}
|
||||
@Override
|
||||
public void onSuccess(EnterChatRoomResultData param) {
|
||||
e.onNext(param);
|
||||
e.onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(int code) {
|
||||
e.onError(new Throwable(String.valueOf(code)));
|
||||
}
|
||||
@Override
|
||||
public void onFailed(int code) {
|
||||
e.onError(new Throwable(String.valueOf(code)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onException(Throwable exception) {
|
||||
e.onError(exception);
|
||||
}
|
||||
});
|
||||
}).subscribeOn(Schedulers.computation())
|
||||
@Override
|
||||
public void onException(Throwable exception) {
|
||||
e.onError(exception);
|
||||
}
|
||||
});
|
||||
}).subscribeOn(Schedulers.computation())
|
||||
.unsubscribeOn(Schedulers.computation());
|
||||
}
|
||||
|
||||
@@ -374,7 +376,7 @@ public class AvRoomModel extends RoomBaseModel implements IAvRoomModel {
|
||||
@Override
|
||||
public Single<ServiceResult<RoomInfo>> userRoomIn(String uid, long roomUid, int behaveType, String inviteUid) {
|
||||
return mRoomService.userRoomInV2(uid, AuthModel.get().getTicket(),
|
||||
String.valueOf(roomUid), behaveType, inviteUid)
|
||||
String.valueOf(roomUid), behaveType, inviteUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.unsubscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
@@ -518,7 +520,7 @@ public class AvRoomModel extends RoomBaseModel implements IAvRoomModel {
|
||||
*/
|
||||
private Single<String> setRole(long targetUid, int opt, boolean isSet, String notifyExt) {
|
||||
return mRoomService.setChatRoomRole(AvRoomDataManager.get().getRoomUid(),
|
||||
targetUid, opt, isSet, notifyExt)
|
||||
targetUid, opt, isSet, notifyExt)
|
||||
.compose(RxHelper.handleIgnoreData());
|
||||
}
|
||||
|
||||
@@ -706,6 +708,7 @@ public class AvRoomModel extends RoomBaseModel implements IAvRoomModel {
|
||||
|
||||
/**
|
||||
* 获取踢人列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Single<List<String>> getKickList() {
|
||||
@@ -717,12 +720,59 @@ public class AvRoomModel extends RoomBaseModel implements IAvRoomModel {
|
||||
|
||||
/**
|
||||
* 踢人
|
||||
*
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
public Single<String> kickUser(long uid) {
|
||||
return mRoomService.kickUser(AvRoomDataManager.get().getRoomUid(),uid)
|
||||
return mRoomService.kickUser(AvRoomDataManager.get().getRoomUid(), uid)
|
||||
.compose(RxHelper.handleStringData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取房间banner列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Single<List<RoomIcon>> getRoomBannerList() {
|
||||
return mRoomService.getRoomBanner(AvRoomDataManager.get().getRoomUid())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取游戏房间banner列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Single<List<RoomIcon>> getGameRoomBannerList() {
|
||||
return Single.zip(getRoomBannerList().onErrorReturn(throwable -> new ArrayList<RoomIcon>()), getRoomGamePlayList().onErrorReturn(throwable -> new ArrayList<RoomIcon>()), new BiFunction<List<RoomIcon>, List<RoomIcon>, List<RoomIcon>>() {
|
||||
@Override
|
||||
public List<RoomIcon> apply(List<RoomIcon> roomIcons, List<RoomIcon> roomIcons2) throws Exception {
|
||||
ArrayList<RoomIcon> list = new ArrayList<>();
|
||||
if (roomIcons2 != null) {
|
||||
for (RoomIcon icon : roomIcons2) {
|
||||
icon.setTag(RoomIcon.TAG_GAMEPLAY);
|
||||
}
|
||||
list.addAll(roomIcons2);
|
||||
}
|
||||
if (roomIcons != null) {
|
||||
list.addAll(roomIcons);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取房间玩法列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Single<List<RoomIcon>> getRoomGamePlayList() {
|
||||
return mRoomService.getRoomGamePlay(AvRoomDataManager.get().getRoomUid())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.room.activitytimer.TimerBean;
|
||||
import com.yizhuan.xchat_android_core.room.bean.BroadcastInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomIcon;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomResult;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomSettingTabInfo;
|
||||
@@ -1207,6 +1208,24 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
|
||||
@GET("/room/kick/")
|
||||
Single<ServiceResult<List<String>>> getKickList(@Query("roomUid") long roomUid);
|
||||
|
||||
/**
|
||||
* 获取房间bannerList
|
||||
*
|
||||
* @param roomUid
|
||||
* @return
|
||||
*/
|
||||
@GET("/resource/list")
|
||||
Single<ServiceResult<List<RoomIcon>>> getRoomBanner(@Query("roomUid") long roomUid);
|
||||
|
||||
/**
|
||||
* 获取房间玩法List
|
||||
*
|
||||
* @param roomUid
|
||||
* @return
|
||||
*/
|
||||
@GET("/resource/gamePlay")
|
||||
Single<ServiceResult<List<RoomIcon>>> getRoomGamePlay(@Query("roomUid") long roomUid);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,6 +3,8 @@ package com.yizhuan.xchat_android_core.support.room
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.chuhai.utils.log.ILog
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.support.room.lifecycle.RoomLifecycle
|
||||
import com.yizhuan.xchat_android_core.support.room.lifecycle.RoomLifecycleRegistry
|
||||
|
||||
@@ -109,4 +111,13 @@ abstract class RoomContext(val roomId: Long) : ILog {
|
||||
abilityList.clear()
|
||||
set(null)
|
||||
}
|
||||
|
||||
@Deprecated("临时方法:后面可能会整合Data相关API")
|
||||
fun getRoomInfo(): RoomInfo? {
|
||||
val roomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
if (roomInfo?.getUid() == roomId) {
|
||||
return roomInfo
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user