Compare commits
19 Commits
peko_relea
...
peko_relea
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6b7adc5950 | ||
![]() |
87b81b7761 | ||
![]() |
842bf98958 | ||
![]() |
f110a47c0e | ||
![]() |
160e5025b8 | ||
![]() |
9ec8385544 | ||
![]() |
13106a62e4 | ||
![]() |
7a677c96cd | ||
![]() |
7093cfa7f3 | ||
![]() |
3747c10dc1 | ||
![]() |
d9e3c32f1b | ||
![]() |
9891c6f9d0 | ||
![]() |
f721e34139 | ||
![]() |
069eb3e89c | ||
![]() |
8ae154cf09 | ||
![]() |
6b90fedb8b | ||
![]() |
cee6060d62 | ||
![]() |
0acd6f9c88 | ||
![]() |
9a075db5d5 |
@@ -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" />
|
||||
|
@@ -140,6 +140,7 @@ import com.yizhuan.xchat_android_core.super_admin.util.SAdminOptUtil;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext;
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomView;
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomWidget;
|
||||
import com.yizhuan.xchat_android_core.treasurefairy.FairyMsgInfoBean;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.FirstChargeInfo;
|
||||
@@ -1419,6 +1420,12 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
return this;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public RoomWidget findWidget(@NonNull String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static class GiftBroadcastObserver implements Observer<BroadcastMessage> {
|
||||
private WeakReference<AVRoomActivity> mReference;
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
@@ -6,9 +6,6 @@ import android.app.Activity
|
||||
import android.content.DialogInterface
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.KeyEvent
|
||||
@@ -47,7 +44,6 @@ import com.yizhuan.erban.avroom.dialog.AttentionHintDialog
|
||||
import com.yizhuan.erban.avroom.dialog.DatingVipRuleDialog
|
||||
import com.yizhuan.erban.avroom.dialog.RoomFreeGiftDialog
|
||||
import com.yizhuan.erban.avroom.dialog.RoomOperationDialog
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog
|
||||
import com.yizhuan.erban.avroom.presenter.BaseRoomPresenter
|
||||
import com.yizhuan.erban.avroom.redpackage.send.RedPackageSendDialog
|
||||
import com.yizhuan.erban.avroom.room_album.RoomAlbumModel
|
||||
@@ -59,34 +55,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 +83,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 +132,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 +191,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 +272,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 +443,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()
|
||||
@@ -586,10 +506,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
} else {
|
||||
val roomQueueInfo = AvRoomDataManager.get()
|
||||
.getRoomQueueMemberInfoByAccount(myUid.toString())
|
||||
if (roomQueueInfo?.mChatRoomMember?.isNoProhibitMic == true && roomQueueInfo.mRoomMicInfo?.isMicMute == false) {
|
||||
bottomView.setMicBtnEnable(true)
|
||||
bottomView.setMicBtnOpen(true)
|
||||
} else if (roomQueueInfo?.mChatRoomMember != null
|
||||
if (roomQueueInfo?.mChatRoomMember != null
|
||||
&& myUid.toString() == roomQueueInfo.mChatRoomMember.account
|
||||
&& roomQueueInfo.mRoomMicInfo?.isMicMute == true
|
||||
) {
|
||||
@@ -678,12 +595,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1320,6 +1231,10 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
return this
|
||||
}
|
||||
|
||||
override fun findWidget(name: String): RoomWidget? {
|
||||
return widgets[name]
|
||||
}
|
||||
|
||||
open fun initWidget() {
|
||||
|
||||
}
|
||||
|
@@ -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,14 @@ 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.RoomGameplayListWidget;
|
||||
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 +145,9 @@ 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(RoomGameplayListWidget.class.getSimpleName(), gameBinding.gameplayListWidget);
|
||||
registerWidget(RoomGameplayWidget.class.getSimpleName(), gameBinding.gameplayWidget);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@@ -155,7 +161,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 +811,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 +944,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,11 @@ 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.RoomGameplayListWidget
|
||||
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 +29,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 +85,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 +241,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 +256,9 @@ 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(RoomGameplayListWidget::class.java.simpleName, gameBinding.gameplayListWidget)
|
||||
registerWidget(RoomGameplayWidget::class.java.simpleName, gameBinding.gameplayWidget)
|
||||
}
|
||||
|
||||
override fun onInitMusicPlayerView(view: MusicPlayerView) {
|
||||
|
@@ -0,0 +1,25 @@
|
||||
package com.yizhuan.erban.avroom.gameplay
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.MotionEvent
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/23 16:09
|
||||
* Desc:
|
||||
**/
|
||||
class GameplayRecyclerView : RecyclerView {
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
override fun onInterceptTouchEvent(e: MotionEvent?): Boolean {
|
||||
parent.requestDisallowInterceptTouchEvent(true)
|
||||
return super.onInterceptTouchEvent(e)
|
||||
}
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
package com.yizhuan.erban.avroom.gameplay
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewConfiguration
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.RoomGameplayListWidgetBinding
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomIcon
|
||||
import com.yizhuan.xchat_android_core.support.room.FrameLayoutRoomWidget
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/20 10:42
|
||||
* Desc:玩法活动
|
||||
**/
|
||||
class RoomGameplayListWidget : FrameLayoutRoomWidget {
|
||||
private val adapter = RoomPlayListAdapter()
|
||||
private val binding: RoomGameplayListWidgetBinding =
|
||||
DataBindingUtil.inflate(
|
||||
LayoutInflater.from(
|
||||
context
|
||||
), R.layout.room_gameplay_list_widget, this, true
|
||||
)
|
||||
|
||||
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 {
|
||||
getGameplayIconWidget()?.switchUI(false)
|
||||
}
|
||||
adapter.setOnItemClickListener { adapter, view, position ->
|
||||
(adapter.getItem(position) as? RoomIcon)?.let {
|
||||
getGameplayIconWidget()?.jump(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getGameplayIconWidget(): RoomGameplayWidget? {
|
||||
return roomView?.findWidget(
|
||||
RoomGameplayWidget::class.simpleName ?: ""
|
||||
) as? RoomGameplayWidget
|
||||
}
|
||||
|
||||
fun loadData(list: List<RoomIcon>) {
|
||||
adapter.setNewData(list)
|
||||
if (list.size > 6) {
|
||||
binding.recyclerView.isScrollbarFadingEnabled = false
|
||||
binding.recyclerView.scrollBarFadeDuration = 0
|
||||
} else {
|
||||
binding.recyclerView.isScrollbarFadingEnabled = true
|
||||
binding.recyclerView.scrollBarFadeDuration =
|
||||
ViewConfiguration.getScrollBarFadeDuration()
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,131 @@
|
||||
package com.yizhuan.erban.avroom.gameplay
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
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 binding: RoomGameplayWidgetBinding =
|
||||
DataBindingUtil.inflate(
|
||||
LayoutInflater.from(
|
||||
context
|
||||
), R.layout.room_gameplay_widget, this, true
|
||||
)
|
||||
|
||||
private var isOpened = false
|
||||
|
||||
private var list: List<RoomIcon>? = null
|
||||
|
||||
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.ivSwitch.setOnClickListener {
|
||||
switchUI(!isOpened)
|
||||
}
|
||||
binding.ivIcon.singleClick {
|
||||
list?.getOrNull(0)?.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)
|
||||
}
|
||||
|
||||
fun switchUI(openListWidget: Boolean) {
|
||||
this.isOpened = openListWidget
|
||||
if (openListWidget) {
|
||||
this.visibility = View.INVISIBLE
|
||||
getGameplayListWidget()?.visibility = View.VISIBLE
|
||||
} else {
|
||||
this.visibility = View.VISIBLE
|
||||
getGameplayListWidget()?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadData(list: List<RoomIcon>) {
|
||||
this.list = list
|
||||
this.isVisible = list.isNotEmpty()
|
||||
val listWidget = getGameplayListWidget()
|
||||
if (list.isEmpty()) {
|
||||
listWidget?.isVisible = false
|
||||
}
|
||||
listWidget?.loadData(list)
|
||||
binding.ivIcon.load(list.firstOrNull()?.icon)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getGameplayListWidget(): RoomGameplayListWidget? {
|
||||
return roomView?.findWidget(
|
||||
RoomGameplayListWidget::class.simpleName ?: ""
|
||||
) as? RoomGameplayListWidget
|
||||
}
|
||||
}
|
@@ -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);
|
||||
|
||||
}
|
||||
|
@@ -2,8 +2,10 @@ package com.yizhuan.erban.avroom.widget;
|
||||
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_FAIRY;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GIFT_COMPOUND;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GUARDIAN_PLANET;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_RED_PACKAGE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ROOM_ALBUM;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_ROOM_TEMPLATE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_BOX_ME;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_CONVERT_L1;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_CONVERT_L2;
|
||||
@@ -119,6 +121,7 @@ import com.yizhuan.xchat_android_core.im.custom.bean.GiftAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.GiftBatchAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.GiftCompoundAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.GiftCompoundMsgBean;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.GuardianPlanetAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.JoinMiniWorldAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.JoinMiniWorldNoticeAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.MagicAllMicAttachment;
|
||||
@@ -143,6 +146,7 @@ import com.yizhuan.xchat_android_core.im.custom.bean.RoomReceivedLuckyGiftAttach
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomTipAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.TarotAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.TarotMsgBean;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.TemplateMessageAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.User;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.VipMessageAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.WelcomeAttachment;
|
||||
@@ -253,6 +257,7 @@ public class MessageView extends FrameLayout {
|
||||
private OnClick onClick;
|
||||
|
||||
private OnMsgLongClickListener onLongClickListener;
|
||||
private TemplateMessageAdapter templateMessageAdapter;
|
||||
|
||||
public MessageView(Context context) {
|
||||
this(context, null);
|
||||
@@ -433,7 +438,17 @@ public class MessageView extends FrameLayout {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private TemplateMessageAdapter getTemplateMessageAdapter() {
|
||||
if (templateMessageAdapter == null) {
|
||||
templateMessageAdapter = new TemplateMessageAdapter(uid -> {
|
||||
if (clickConsumer != null) {
|
||||
Single.just(String.valueOf(uid)).subscribe(clickConsumer);
|
||||
}
|
||||
});
|
||||
}
|
||||
return templateMessageAdapter;
|
||||
}
|
||||
|
||||
public void onCurrentRoomReceiveNewMsg(List<ChatRoomMessage> messages) {
|
||||
@@ -617,6 +632,19 @@ public class MessageView extends FrameLayout {
|
||||
builder.setSpan(imageSpan, start, builder.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* @param drawable -icon url
|
||||
* @return -返回一個spannableStringBuilder
|
||||
*/
|
||||
public SpannableBuilder appendImg(String drawable, Object what) {
|
||||
if (TextUtils.isEmpty(drawable)) return this;
|
||||
int start = builder.length();
|
||||
builder.append("-");
|
||||
CustomImageSpan imageSpan = new CustomImageSpan(new ColorDrawable(Color.TRANSPARENT), textView, drawable);
|
||||
builder.setSpan(imageSpan, start, builder.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(what, start, builder.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param drawable -icon url
|
||||
@@ -633,6 +661,16 @@ public class MessageView extends FrameLayout {
|
||||
return this;
|
||||
}
|
||||
|
||||
public SpannableBuilder append(String drawable, int width, int height, Object what) {
|
||||
if (TextUtils.isEmpty(drawable)) return this;
|
||||
int start = builder.length();
|
||||
builder.append("-");
|
||||
CustomImageSpan imageSpan = new CustomImageSpan(new ColorDrawable(Color.TRANSPARENT), textView, drawable, width, height);
|
||||
builder.setSpan(imageSpan, start, builder.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(what, start, builder.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文本和背景分離的情況
|
||||
*/
|
||||
@@ -674,6 +712,16 @@ public class MessageView extends FrameLayout {
|
||||
return this;
|
||||
}
|
||||
|
||||
public SpannableBuilder append(String imgUrl, int height, Object what) {
|
||||
if (TextUtils.isEmpty(imgUrl)) return this;
|
||||
int start = builder.length();
|
||||
builder.append("-");
|
||||
builder.setSpan(new CustomAutoWidthImageSpan(new ColorDrawable(Color.TRANSPARENT), textView, imgUrl, height)
|
||||
, start, builder.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(what, start, builder.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param drawable -icon
|
||||
* @param width 寬
|
||||
@@ -1032,6 +1080,15 @@ public class MessageView extends FrameLayout {
|
||||
setFairyMsg(chatRoomMessage, tvContent);
|
||||
} else if (first == CUSTOM_MSG_ROOM_ALBUM) {
|
||||
setRoomAlbumMsg(chatRoomMessage, baseViewHolder);
|
||||
} else if (first == CUSTOM_MSG_GUARDIAN_PLANET) {
|
||||
setGuardianPlanetMsg(chatRoomMessage, tvContent);
|
||||
} else if (first == CUSTOM_MSG_ROOM_TEMPLATE) {
|
||||
TemplateMessageAttachment templateMessageAttachment = (TemplateMessageAttachment) chatRoomMessage.getAttachment();
|
||||
if (templateMessageAttachment != null) {
|
||||
getTemplateMessageAdapter().convert(tvContent, templateMessageAttachment.getTemplateMessage());
|
||||
} else {
|
||||
getTemplateMessageAdapter().convert(tvContent, null);
|
||||
}
|
||||
} else {
|
||||
tvContent.setTextColor(Color.WHITE);
|
||||
tvContent.setText(tvContent.getResources().getText(R.string.not_support_message_tip));
|
||||
@@ -1948,6 +2005,37 @@ public class MessageView extends FrameLayout {
|
||||
tvContent.setText(text.build());
|
||||
}
|
||||
|
||||
private void setGuardianPlanetMsg(ChatRoomMessage chatRoomMessage, TextView tvContent) {
|
||||
GuardianPlanetAttachment attachment = (GuardianPlanetAttachment) chatRoomMessage.getAttachment();
|
||||
// 內容
|
||||
SpannableBuilder text = new SpannableBuilder(tvContent)
|
||||
.append(ResUtil.getString(R.string.congratulation), new ForegroundColorSpan(greyColor))
|
||||
.append(attachment.getNick(), new ForegroundColorSpan(roomTipNickColor),
|
||||
new OriginalDrawStatusClickSpan() {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
if (clickConsumer != null) {
|
||||
Single.just(String.valueOf(attachment.getUid())).subscribe(clickConsumer);
|
||||
}
|
||||
}
|
||||
})
|
||||
.append(
|
||||
ResUtil.getString(R.string.guardian_planet_msg_1),
|
||||
new ForegroundColorSpan(greyColor)
|
||||
)
|
||||
.append(
|
||||
String.valueOf(attachment.getDiamonds()),
|
||||
new ForegroundColorSpan(whiteColor)
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.guardian_planet_msg_2),
|
||||
new ForegroundColorSpan(greyColor)
|
||||
);
|
||||
tvContent.setText(text.build());
|
||||
tvContent.setOnClickListener(null);
|
||||
tvContent.setMovementMethod(new LinkMovementMethod());
|
||||
}
|
||||
|
||||
private void setLuckySeaMsg(ChatRoomMessage chatRoomMessage, TextView tvContent) {
|
||||
RoomLuckySeaAttachment attachment = (RoomLuckySeaAttachment) chatRoomMessage.getAttachment();
|
||||
RoomLuckySeaMsgBean bean = attachment.getRoomLuckySeaMsgInfo();
|
||||
|
@@ -0,0 +1,133 @@
|
||||
package com.yizhuan.erban.avroom.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import com.chuhai.utils.UiUtils
|
||||
import com.yizhuan.erban.common.widget.OriginalDrawStatusClickSpan
|
||||
import com.yizhuan.erban.utils.CommonJumpHelper
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.TemplateMessage
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.TemplateMessage.TemplateNode
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/22 17:20
|
||||
* Desc:模版消息适配器
|
||||
**/
|
||||
class TemplateMessageAdapter(val listener: Listener) {
|
||||
|
||||
fun convert(textView: TextView, attachment: TemplateMessage?) {
|
||||
if (attachment == null) {
|
||||
textView.text = ""
|
||||
return
|
||||
}
|
||||
val nodeList = attachment.getNodeList()
|
||||
val textBuilder = MessageView.SpannableBuilder(textView)
|
||||
nodeList.forEach {
|
||||
if (it is TemplateNode.NormalNode) {
|
||||
val textColor = parseColor(it.textColor)
|
||||
if (textColor != null) {
|
||||
textBuilder.append(it.text, ForegroundColorSpan(textColor))
|
||||
} else {
|
||||
textBuilder.append(it.text)
|
||||
}
|
||||
} else if (it is TemplateNode.SpecialNode) {
|
||||
when (it.content.type) {
|
||||
TemplateMessage.Content.TEXT -> {
|
||||
val text = it.content.text?.getFirstText()
|
||||
if (!text.isNullOrEmpty()) {
|
||||
val textColor = parseColor(it.content.textColor)
|
||||
val clickSpan = createClickSpan(textView.context, it.content)
|
||||
val list = ArrayList<Any>()
|
||||
if (textColor != null) {
|
||||
list.add(ForegroundColorSpan(textColor))
|
||||
}
|
||||
if (clickSpan != null) {
|
||||
list.add(clickSpan)
|
||||
}
|
||||
textBuilder.append(text, *list.toArray())
|
||||
}
|
||||
}
|
||||
|
||||
TemplateMessage.Content.IMAGE -> {
|
||||
val image = it.content.image
|
||||
val width = it.content.width ?: 0
|
||||
val height = it.content.height ?: 0
|
||||
val clickSpan = createClickSpan(textView.context, it.content)
|
||||
if (height > 0 && width == 0) {
|
||||
if (clickSpan != null) {
|
||||
textBuilder.append(
|
||||
image,
|
||||
UiUtils.dip2px(height.toFloat()),
|
||||
clickSpan
|
||||
)
|
||||
} else {
|
||||
textBuilder.append(image, UiUtils.dip2px(height.toFloat()))
|
||||
}
|
||||
} else if (height > 0 && width > 0) {
|
||||
if (clickSpan != null) {
|
||||
textBuilder.append(
|
||||
image,
|
||||
UiUtils.dip2px(width.toFloat()),
|
||||
UiUtils.dip2px(height.toFloat()), clickSpan
|
||||
)
|
||||
} else {
|
||||
textBuilder.append(
|
||||
image,
|
||||
UiUtils.dip2px(width.toFloat()),
|
||||
UiUtils.dip2px(height.toFloat())
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (clickSpan != null) {
|
||||
textBuilder.appendImg(image, clickSpan)
|
||||
} else {
|
||||
textBuilder.appendImg(image)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
textView.text = textBuilder.build()
|
||||
textView.setOnClickListener(null)
|
||||
textView.movementMethod = LinkMovementMethod()
|
||||
}
|
||||
|
||||
private fun createClickSpan(
|
||||
context: Context,
|
||||
content: TemplateMessage.Content
|
||||
): OriginalDrawStatusClickSpan? {
|
||||
val skipType = content.getSkipType()
|
||||
val skipUri = content.getSkipUri()
|
||||
if (skipType > 0 && !skipUri.isNullOrEmpty()) {
|
||||
return object : OriginalDrawStatusClickSpan() {
|
||||
override fun onClick(widget: View) {
|
||||
if (skipType == BannerInfo.SKIP_TYPE_ROOM_USER_CARD) {
|
||||
listener.onShowUserCard(skipUri)
|
||||
} else {
|
||||
CommonJumpHelper.bannerJump(context, content)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
private fun parseColor(color: String?): Int? {
|
||||
try {
|
||||
return Color.parseColor(color)
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
interface Listener {
|
||||
fun onShowUserCard(uid: String)
|
||||
}
|
||||
}
|
@@ -14,8 +14,8 @@ import kotlinx.coroutines.async
|
||||
|
||||
class HomeViewModel : BaseViewModel() {
|
||||
|
||||
private val _tabHomeLiveData = MutableLiveData<List<HomeTabMapInfo>?>()
|
||||
val tabHomeLiveData: MutableLiveData<List<HomeTabMapInfo>?> = _tabHomeLiveData
|
||||
private val _tabHomeLiveData = MutableLiveData<ListResult<HomeRoomInfo>?>()
|
||||
val tabHomeLiveData: MutableLiveData<ListResult<HomeRoomInfo>?> = _tabHomeLiveData
|
||||
|
||||
private val _bannerLiveData = MutableLiveData<List<BannerInfo>?>()
|
||||
val bannerLiveData: MutableLiveData<List<BannerInfo>?> = _bannerLiveData
|
||||
@@ -47,6 +47,8 @@ class HomeViewModel : BaseViewModel() {
|
||||
private val _tagLiveData = MutableLiveData<List<HomeTagInfo>>()
|
||||
val tagLiveData: LiveData<List<HomeTagInfo>> = _tagLiveData
|
||||
|
||||
val homeTagLiveData: MutableLiveData<List<HomeTagInfo>> = MutableLiveData<List<HomeTagInfo>>()
|
||||
|
||||
private val _emptyLiveData = MutableLiveData<Boolean>()
|
||||
val emptyLiveData: LiveData<Boolean> = _emptyLiveData
|
||||
|
||||
@@ -62,13 +64,14 @@ class HomeViewModel : BaseViewModel() {
|
||||
private val _newFriendLiveData = MutableLiveData<ListResult<UserInfo>>()
|
||||
val newFriendLiveData: LiveData<ListResult<UserInfo>> = _newFriendLiveData
|
||||
|
||||
fun getHomeTabName() {
|
||||
fun getHomeTabName(tabId: Int, pageNum: Int) {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
_tabHomeLiveData.value = null
|
||||
_tabHomeLiveData.value = ListResult.failed(pageNum)
|
||||
},
|
||||
block = {
|
||||
_tabHomeLiveData.value = HomeModel.getHomeTabHome()
|
||||
val result = HomeModel.getHomeTabHome(tabId, pageNum, 20)
|
||||
_tabHomeLiveData.value = ListResult.success(result, pageNum)
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -122,6 +125,12 @@ class HomeViewModel : BaseViewModel() {
|
||||
)
|
||||
}
|
||||
|
||||
fun getHomeTagInfo() {
|
||||
safeLaunch {
|
||||
homeTagLiveData.value = HomeModel.getNewHomeTag()
|
||||
}
|
||||
}
|
||||
|
||||
fun getTagInfo() {
|
||||
safeLaunch {
|
||||
_tagLiveData.value = HomeModel.getHomeTag()
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
@@ -87,10 +87,6 @@ class RoomNewFriendsAdapter :
|
||||
}
|
||||
}
|
||||
|
||||
helper.getView<View>(R.id.iv_avatar).setOnClickListener {
|
||||
UserInfoActivity.Companion.start(mContext, item.uid)
|
||||
}
|
||||
|
||||
val tvNickname = helper.getView<TextView>(R.id.tv_nickname)
|
||||
tvNickname.text = item.nick
|
||||
|
||||
|
@@ -17,6 +17,7 @@ import com.yizhuan.erban.home.HomeViewModel
|
||||
import com.yizhuan.erban.home.adapter.HomeChatAdapter
|
||||
import com.yizhuan.erban.home.adapter.RoomNewFriendsAdapter
|
||||
import com.yizhuan.erban.home.helper.OpenRoomHelper
|
||||
import com.yizhuan.erban.ui.user.activity.UserInfoActivity
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||
import com.yizhuan.xchat_android_core.home.event.RefreshHomeDataEvent
|
||||
@@ -116,6 +117,11 @@ class AccompanyFragment : BaseViewBindingFragment<FragmentAccompanyBinding>() {
|
||||
|
||||
private fun initHotRoomTab() {
|
||||
roomNewFriendsAdapter = RoomNewFriendsAdapter()
|
||||
roomNewFriendsAdapter.setOnItemClickListener { adapter, view, position ->
|
||||
(adapter.getItem(position) as? UserInfo)?.let {
|
||||
UserInfoActivity.Companion.start(context, it.uid)
|
||||
}
|
||||
}
|
||||
rvDelegate = RVDelegate.Builder<UserInfo>()
|
||||
.setAdapter(roomNewFriendsAdapter)
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
|
@@ -40,20 +40,22 @@ import com.zhpan.bannerview.BannerViewPager
|
||||
class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClickListener,
|
||||
MainIndicatorAdapter.OnItemSelectListener {
|
||||
|
||||
private val mFragments = mutableListOf<Class<out Fragment>>()
|
||||
private val mTabInfoList = mutableListOf<HomeTagInfo>()
|
||||
private val TAB_ID_RECOMMEND = Int.MAX_VALUE - 1
|
||||
|
||||
private val TAB_ID_ACCOMPANY = Int.MAX_VALUE - 2
|
||||
|
||||
private val tabList = mutableListOf<HomeTagInfo>()
|
||||
private val tabTitleList = mutableListOf<String>()
|
||||
private val homeViewModel: HomeViewModel by activityViewModels()
|
||||
|
||||
private var mBanner: BannerViewPager<BannerInfo>? = null
|
||||
|
||||
companion object {
|
||||
private const val TAG = "HomeFragment"
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
mBanner = view?.findViewById(R.id.banner)
|
||||
initTitleTab()
|
||||
initTab()
|
||||
initListener()
|
||||
homeViewModel.homeTagLiveData.observe(this) {
|
||||
loadTabList(transformTabList(it))
|
||||
}
|
||||
homeViewModel.bannerLiveData.observe(this) {
|
||||
it?.let {
|
||||
if (ListUtils.isListEmpty(it)) {
|
||||
@@ -71,7 +73,10 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
ReportManager.get().reportEvent(
|
||||
IReportConstants.MODULE_HOMEPAGE_CLICK, mapOf(
|
||||
Pair(IReportConstants.HOMEPAGE_TYPE, IReportConstants.SIX),
|
||||
Pair(IReportConstants.MODULE, IReportConstants.PEKO_HOMEPAGE)
|
||||
Pair(
|
||||
IReportConstants.MODULE,
|
||||
IReportConstants.PEKO_HOMEPAGE
|
||||
)
|
||||
)
|
||||
)
|
||||
CommonJumpHelper.bannerJump(context, it[position])
|
||||
@@ -83,7 +88,7 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
}
|
||||
homeViewModel.currentResourceLiveData.observe(this) {
|
||||
it?.let {
|
||||
if(it.size != 2){
|
||||
if (it.size != 2) {
|
||||
binding.csResource.visibility = View.GONE
|
||||
return@observe
|
||||
}
|
||||
@@ -99,10 +104,12 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
it[i].resourceType == 5 -> {
|
||||
CommonWebViewActivity.start(context, it[i].resourceContent)
|
||||
}
|
||||
|
||||
i == 3 -> {
|
||||
dialogManager.showProgressDialog(mContext)
|
||||
homeViewModel.getHomeChatPick()
|
||||
}
|
||||
|
||||
else -> {
|
||||
dialogManager.showProgressDialog(mContext)
|
||||
homeViewModel.getResourceJumpInfo(it[i].id)
|
||||
@@ -131,6 +138,7 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
}
|
||||
}
|
||||
}
|
||||
homeViewModel.getHomeTagInfo()
|
||||
homeViewModel.getBannerInfo()
|
||||
homeViewModel.getCurrentResourceInfo()
|
||||
}
|
||||
@@ -157,6 +165,7 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
DemoCache.saveAnchorCardView(1)
|
||||
}
|
||||
}
|
||||
|
||||
R.id.iv_ranking -> {
|
||||
//首页_排行榜
|
||||
ReportManager.get().reportEvent(
|
||||
@@ -167,6 +176,7 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
)
|
||||
CommonWebViewActivity.start(mContext, UriProvider.getRanking())
|
||||
}
|
||||
|
||||
R.id.iv_my_room -> {
|
||||
//首页_创建房间
|
||||
ReportManager.get().reportEvent(
|
||||
@@ -180,63 +190,100 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化推荐
|
||||
*/
|
||||
private fun initTitleTab() {
|
||||
mTabInfoList.add(
|
||||
HomeTagInfo(
|
||||
6,
|
||||
ResUtil.getString(R.string.home_fragment_homefragment_04),
|
||||
0
|
||||
)
|
||||
)
|
||||
mTabInfoList.add(
|
||||
HomeTagInfo(
|
||||
7,
|
||||
ResUtil.getString(R.string.home_fragment_homefragment_07),
|
||||
0
|
||||
)
|
||||
)
|
||||
mFragments.add(RecommendFragment::class.java)
|
||||
mFragments.add(AccompanyFragment::class.java)
|
||||
|
||||
val commonNavigator = CommonNavigator(context)
|
||||
commonNavigator.setTitleWrapContent(false)
|
||||
commonNavigator.titleMargin = ScreenUtil.dip2px(2.0F)
|
||||
commonNavigator.setTitleGravity(Gravity.CENTER_VERTICAL)
|
||||
val magicIndicatorAdapter = MainIndicatorAdapter(context, mTabInfoList.map { it.name })
|
||||
magicIndicatorAdapter.setOnItemSelectListener(this)
|
||||
commonNavigator.adapter = magicIndicatorAdapter
|
||||
binding.magicIndicator.navigator = commonNavigator
|
||||
binding.viewPager.adapter =
|
||||
object : FragmentStateAdapter(childFragmentManager, lifecycle) {
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
return mFragments[position].newInstance()
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return mFragments.size
|
||||
}
|
||||
|
||||
}
|
||||
ViewPagerHelper.bind(binding.magicIndicator, binding.viewPager)
|
||||
binding.viewPager.offscreenPageLimit = 1
|
||||
}
|
||||
|
||||
override fun onItemSelect(position: Int, view: TextView?) {
|
||||
binding.viewPager.currentItem = position
|
||||
//点击顶部tab上报
|
||||
val map = HashMap<String, Any>(3)
|
||||
map[IReportConstants.HOMEPAGE_TAB] = mTabInfoList[position].id
|
||||
map[IReportConstants.HOMEPAGE_TAB] = tabList[position].id
|
||||
map[IReportConstants.MODULE] = IReportConstants.PEKO_HOMEPAGE
|
||||
ReportManager.get().reportEvent(IReportConstants.TAB_HOMEPAGE_CLICK, map)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
mTabInfoList.clear()
|
||||
mFragments.clear()
|
||||
tabList.clear()
|
||||
tabTitleList.clear()
|
||||
}
|
||||
|
||||
private fun initTab() {
|
||||
val commonNavigator = CommonNavigator(context)
|
||||
commonNavigator.setTitleWrapContent(false)
|
||||
commonNavigator.titleMargin = ScreenUtil.dip2px(2.0F)
|
||||
commonNavigator.setTitleGravity(Gravity.CENTER_VERTICAL)
|
||||
val magicIndicatorAdapter = MainIndicatorAdapter(context, tabTitleList)
|
||||
magicIndicatorAdapter.setOnItemSelectListener(this)
|
||||
commonNavigator.adapter = magicIndicatorAdapter
|
||||
binding.magicIndicator.navigator = commonNavigator
|
||||
binding.viewPager.adapter =
|
||||
object : FragmentStateAdapter(childFragmentManager, lifecycle) {
|
||||
override fun getItemId(position: Int): Long {
|
||||
return tabList[position].id.toLong()
|
||||
}
|
||||
|
||||
override fun containsItem(itemId: Long): Boolean {
|
||||
return tabList.firstOrNull { it.id.toLong() == itemId } != null
|
||||
}
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
val itemId = getItemId(position)
|
||||
return when (itemId) {
|
||||
TAB_ID_RECOMMEND.toLong() -> {
|
||||
RecommendFragment()
|
||||
}
|
||||
|
||||
TAB_ID_ACCOMPANY.toLong() -> {
|
||||
AccompanyFragment()
|
||||
}
|
||||
|
||||
else -> {
|
||||
HomeTabFragment.newInstance(itemId.toInt())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return tabList.size
|
||||
}
|
||||
}
|
||||
ViewPagerHelper.bind(binding.magicIndicator, binding.viewPager)
|
||||
loadTabList(transformTabList(emptyList()))
|
||||
}
|
||||
|
||||
private fun transformTabList(list: List<HomeTagInfo>): List<HomeTagInfo> {
|
||||
val finalList = ArrayList<HomeTagInfo>()
|
||||
finalList.add(
|
||||
HomeTagInfo(
|
||||
TAB_ID_RECOMMEND,
|
||||
ResUtil.getString(R.string.home_fragment_homefragment_04),
|
||||
0
|
||||
)
|
||||
)
|
||||
finalList.addAll(list)
|
||||
finalList.add(
|
||||
HomeTagInfo(
|
||||
TAB_ID_ACCOMPANY,
|
||||
ResUtil.getString(R.string.home_fragment_homefragment_07),
|
||||
0
|
||||
)
|
||||
)
|
||||
return finalList
|
||||
}
|
||||
|
||||
private fun loadTabList(list: List<HomeTagInfo>) {
|
||||
// 预防脏数据导致fragment复用问题
|
||||
val newList = list.distinctBy {
|
||||
it.id
|
||||
}
|
||||
val currentListId = tabList.joinToString { it.id.toString() }
|
||||
val newListId = newList.joinToString { it.id.toString() }
|
||||
if (currentListId == newListId) {
|
||||
return
|
||||
}
|
||||
tabList.clear()
|
||||
tabList.addAll(newList)
|
||||
tabTitleList.clear()
|
||||
tabTitleList.addAll(tabList.map { it.name })
|
||||
binding.magicIndicator.navigator.notifyDataSetChanged()
|
||||
binding.viewPager.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
}
|
@@ -0,0 +1,141 @@
|
||||
package com.yizhuan.erban.home.fragment
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.yizhuan.erban.application.IReportConstants
|
||||
import com.yizhuan.erban.application.ReportManager
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
||||
import com.yizhuan.erban.base.BaseViewBindingFragment
|
||||
import com.yizhuan.erban.common.EmptyViewHelper
|
||||
import com.yizhuan.erban.databinding.FragmentRecommendBinding
|
||||
import com.yizhuan.erban.home.HomeViewModel
|
||||
import com.yizhuan.erban.home.adapter.HomeHotAdapter
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||
import com.yizhuan.xchat_android_core.home.event.RefreshHomeDataEvent
|
||||
import com.yizhuan.xchat_android_core.room.event.RoomShieldEvent
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* Peko首页
|
||||
*/
|
||||
class HomeTabFragment : BaseViewBindingFragment<FragmentRecommendBinding>() {
|
||||
|
||||
private lateinit var roomHotAdapter: HomeHotAdapter
|
||||
|
||||
private lateinit var rvDelegate: RVDelegate<HomeRoomInfo>
|
||||
|
||||
private val homeViewModel: HomeViewModel by viewModels()
|
||||
|
||||
//是否需要刷新接口进行屏蔽房间操作
|
||||
private var isShield = false
|
||||
|
||||
private var pageNum = 1
|
||||
private var tabId: Int? = null
|
||||
companion object {
|
||||
fun newInstance(tabId: Int): HomeTabFragment {
|
||||
return HomeTabFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putInt("tabId", tabId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
override fun init() {
|
||||
tabId = arguments?.getInt("tabId")
|
||||
initRefreshView()
|
||||
initHotRoomTab()
|
||||
}
|
||||
|
||||
private fun initRefreshView() {
|
||||
binding.refreshLayout.setOnRefreshListener {
|
||||
loadData(true)
|
||||
}
|
||||
binding.refreshLayout.isEnableLoadmore = false
|
||||
binding.refreshLayout.isEnableOverScrollBounce = false
|
||||
}
|
||||
|
||||
private fun initHotRoomTab() {
|
||||
roomHotAdapter = HomeHotAdapter()
|
||||
roomHotAdapter.onItemClickListener =
|
||||
BaseQuickAdapter.OnItemClickListener { _: BaseQuickAdapter<*, *>?, _: View?, position: Int ->
|
||||
val homePlayInfo: HomeRoomInfo? = roomHotAdapter.getItem(position)
|
||||
if (homePlayInfo != null) {
|
||||
//首页_房间派对
|
||||
ReportManager.get().reportEvent(
|
||||
IReportConstants.MODULE_HOMEPAGE_CLICK, mapOf(
|
||||
Pair(IReportConstants.HOMEPAGE_TYPE, IReportConstants.TEN),
|
||||
Pair(IReportConstants.MODULE, IReportConstants.PEKO_HOMEPAGE)
|
||||
)
|
||||
)
|
||||
AVRoomActivity.start(mContext, homePlayInfo.uid)
|
||||
}
|
||||
}
|
||||
rvDelegate = RVDelegate.Builder<HomeRoomInfo>()
|
||||
.setPageSize(20)
|
||||
.setAdapter(roomHotAdapter)
|
||||
.setRecyclerView(binding.mRecyclerRoom)
|
||||
.setEmptyView(EmptyViewHelper.createEmptyTextViewHeight(context, "暂无數據"))
|
||||
.setLayoutManager(GridLayoutManager(mContext, 2))
|
||||
.build()
|
||||
|
||||
roomHotAdapter.setOnLoadMoreListener({
|
||||
loadData(false)
|
||||
}, binding.mRecyclerRoom)
|
||||
|
||||
homeViewModel.tabHomeLiveData.observe(this) {
|
||||
binding.refreshLayout.finishRefresh()
|
||||
rvDelegate.loadData(it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLazyLoad() {
|
||||
super.onLazyLoad()
|
||||
loadData(true)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (isShield) {
|
||||
loadData(true)
|
||||
isShield = false
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadData(isRefresh: Boolean) {
|
||||
if (isRefresh) {
|
||||
pageNum = 1
|
||||
} else {
|
||||
pageNum++
|
||||
}
|
||||
homeViewModel.getHomeTabName(tabId ?: 0, pageNum)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onRefreshHomeDataEvent(event: RefreshHomeDataEvent?) {
|
||||
if (isResumed) {
|
||||
loadData(true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
EventBus.getDefault().register(this)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onRoomShieldEvent(event: RoomShieldEvent?) {
|
||||
isShield = true
|
||||
}
|
||||
|
||||
}
|
@@ -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?.url)
|
||||
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>
|
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#4D4D4D" />
|
||||
<corners android:radius="8dp" />
|
||||
</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_99727272_7dp.xml
Normal file
7
app/src/main/res/drawable/shape_99727272_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="#99727272" />
|
||||
<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_99727272_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>
|
68
app/src/main/res/layout/room_gameplay_list_widget.xml
Normal file
68
app/src/main/res/layout/room_gameplay_list_widget.xml
Normal file
@@ -0,0 +1,68 @@
|
||||
<?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:id="@+id/layout_content"
|
||||
android:layout_width="@dimen/dp_180"
|
||||
android:layout_height="@dimen/dp_124"
|
||||
app:cardBackgroundColor="@color/transparent"
|
||||
app:cardCornerRadius="@dimen/dp_12"
|
||||
app:cardElevation="0px"
|
||||
app:cardMaxElevation="0px"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.github.mmin18.widget.RealtimeBlurView
|
||||
android:id="@+id/blur_view_icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:realtimeBlurRadius="15dp"
|
||||
app:realtimeDownsampleFactor="4"
|
||||
app:realtimeOverlayColor="#50000000" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/room_gameplay_bg" />
|
||||
|
||||
<com.yizhuan.erban.avroom.gameplay.GameplayRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginVertical="@dimen/dp_4"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="@dimen/dp_4"
|
||||
android:fadeScrollbars="false"
|
||||
android:scrollbarSize="3dp"
|
||||
android:scrollbarStyle="outsideOverlay"
|
||||
android:scrollbarThumbVertical="@drawable/room_gameplay_bg_scrollbar_thumb"
|
||||
android:scrollbars="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="3" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<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_right"
|
||||
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>
|
61
app/src/main/res/layout/room_gameplay_widget.xml
Normal file
61
app/src/main/res/layout/room_gameplay_widget.xml
Normal file
@@ -0,0 +1,61 @@
|
||||
<?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:id="@+id/layout_content"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_66"
|
||||
app:cardBackgroundColor="@color/transparent"
|
||||
app:cardCornerRadius="@dimen/dp_12"
|
||||
app:cardElevation="0px"
|
||||
app:cardMaxElevation="0px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<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" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@drawable/default_cover" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<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>
|
@@ -4250,6 +4250,8 @@
|
||||
<string name="layout_activity_single_room_income_02">01月01日</string>
|
||||
<string name="layout_activity_single_room_income_03">01月01日</string>
|
||||
<string name="layout_activity_single_room_income_04">排名</string>
|
||||
<string name="layout_activity_single_room_income_09">個人信息</string>
|
||||
<string name="layout_activity_single_room_income_10">直播時長</string>
|
||||
<string name="layout_activity_single_room_income_05">頭像</string>
|
||||
<string name="layout_activity_single_room_income_06">昵稱</string>
|
||||
<string name="layout_activity_single_room_income_07">主播(鉆石)</string>
|
||||
@@ -4983,6 +4985,8 @@
|
||||
<string name="room">房間</string>
|
||||
<string name="congratulation">恭喜</string>
|
||||
<string name="in_the_star_kitchen_draw">在星級厨房抽中</string>
|
||||
<string name="guardian_planet_msg_1">在守護星球中成功擊敗怪獸,獲得</string>
|
||||
<string name="guardian_planet_msg_2">鉆石獎勵!</string>
|
||||
<string name="times_reward_get">倍獎勵,獲得</string>
|
||||
<string name="diamond_point">鉆石!</string>
|
||||
<string name="free_gift">免費禮物</string>
|
||||
|
@@ -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>-->
|
||||
|
@@ -23,7 +23,7 @@ public class SingleRoomIncomeAdapter extends BaseQuickAdapter<SingleRoomIncomeIn
|
||||
helper.setText(R.id.tv_author_income, formatGoldNun(item.getAnchorDiamondNum()))
|
||||
.setText(R.id.tv_room_income, formatGoldNun(item.getRoomDiamondNum()))
|
||||
.setText(R.id.tv_user_id, "ID:" + item.getErbanNo())
|
||||
.setText(R.id.tv_hall_number, String.valueOf(helper.getLayoutPosition() + 1))
|
||||
.setText(R.id.tv_time, item.getTimeStr())
|
||||
.setText(R.id.tv_user_name, item.getNick());
|
||||
ImageLoadUtils.loadImage(mContext, item.getAvatar(), helper.getView(R.id.iv_hall_avatar));
|
||||
}
|
||||
|
@@ -113,68 +113,53 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="33dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:background="@color/color_F5F5F5"
|
||||
android:background="#F1F2F2"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="375">
|
||||
|
||||
<TextView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/layout_activity_single_room_income_04"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="13dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/layout_activity_single_room_income_05"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="13dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:text="@string/layout_activity_single_room_income_06"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="13dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
android:paddingStart="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="136"
|
||||
android:gravity="center_vertical|start"
|
||||
android:text="@string/layout_activity_single_room_income_09"
|
||||
android:textColor="#A7A7A8"
|
||||
android:textSize="13dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_author_income"
|
||||
android:layout_width="80dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="81"
|
||||
android:gravity="center"
|
||||
android:text="@string/layout_activity_single_room_income_07"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
android:textColor="#A7A7A8"
|
||||
android:textSize="13dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_income"
|
||||
android:layout_width="80dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="81"
|
||||
android:gravity="center"
|
||||
android:text="@string/layout_activity_single_room_income_08"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="12sp" />
|
||||
android:textColor="#A7A7A8"
|
||||
android:textSize="13dp" />
|
||||
|
||||
<View
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="77"
|
||||
android:gravity="center"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="@string/layout_activity_single_room_income_10"
|
||||
android:textColor="#A7A7A8"
|
||||
android:textSize="13dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -2,94 +2,96 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="75dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bottom_line"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hall_number"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="1"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_hall_avatar"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@drawable/default_cover" />
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="375">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="14sp"
|
||||
tools:text="@string/layout_item_single_room_income_01" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:fontFamily="@string/sans_serif"
|
||||
android:textColor="@color/color_666666"
|
||||
android:textSize="14sp"
|
||||
tools:text="ID:666666" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="136"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_hall_avatar"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginStart="17dp"
|
||||
android:src="@drawable/default_cover" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:textColor="#FF1F1B4F"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="@string/layout_item_single_room_income_01" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="@string/sans_serif"
|
||||
android:lines="1"
|
||||
android:textColor="#8A8CAB"
|
||||
android:textSize="11sp"
|
||||
tools:text="ID:666666" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_author_income"
|
||||
android:layout_width="80dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="81"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textColor="#1F1B4F"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="123456789" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_income"
|
||||
android:layout_width="80dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="81"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textColor="#1F1B4F"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="1234" />
|
||||
|
||||
<View
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="77"
|
||||
android:gravity="center"
|
||||
android:paddingEnd="5dp"
|
||||
android:textColor="#1F1B4F"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="1234" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -97,8 +99,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="#FFF6F7F9" />
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:background="#F1F2F2" />
|
||||
|
||||
</FrameLayout>
|
@@ -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="6dp"
|
||||
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,26 @@
|
||||
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" />
|
||||
|
||||
<com.yizhuan.erban.avroom.gameplay.RoomGameplayListWidget
|
||||
android:id="@+id/gameplay_list_widget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignEnd="@id/gameplay_widget"
|
||||
android:layout_alignBottom="@id/gameplay_widget"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -315,7 +282,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 +321,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: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_toTopOf="@id/gameplay_widget"
|
||||
app:layout_constraintEnd_toEndOf="@id/gameplay_widget"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.yizhuan.erban.avroom.widget.MessageView
|
||||
@@ -259,18 +217,38 @@
|
||||
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" />
|
||||
|
||||
<com.yizhuan.erban.avroom.gameplay.RoomGameplayListWidget
|
||||
android:id="@+id/gameplay_list_widget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/gameplay_widget"
|
||||
app:layout_constraintEnd_toEndOf="@id/gameplay_widget"
|
||||
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
|
||||
*/
|
||||
@@ -31,6 +31,10 @@ public class BannerInfo implements Parcelable, Serializable {
|
||||
* routerhandler跳转规则
|
||||
*/
|
||||
public final static transient int SKIP_TYPE_ROUTER = 5;
|
||||
/**
|
||||
* 房间用户资料卡
|
||||
*/
|
||||
public final static transient int SKIP_TYPE_ROOM_USER_CARD = 6;
|
||||
|
||||
/*
|
||||
bannerId:1 //id
|
||||
@@ -103,4 +107,5 @@ public class BannerInfo implements Parcelable, Serializable {
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,20 @@
|
||||
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
|
||||
|
||||
@Deprecated("SkipType==5时用到该值,后台讲这种已经没用到了")
|
||||
fun getRouterType(): String?
|
||||
|
||||
@Deprecated("SkipType==5时用到该值,后台讲这种已经没用到了")
|
||||
fun getRouterValue(): String?
|
||||
}
|
@@ -98,12 +98,10 @@ object HomeModel : BaseModel() {
|
||||
/**
|
||||
* 获取首页推荐房间
|
||||
*/
|
||||
suspend fun getHomeTabHome(): List<HomeTabMapInfo>? =
|
||||
suspend fun getHomeTabHome(tabId: Int, pageNum: Int, pageSize: Int): List<HomeRoomInfo>? =
|
||||
launchRequest {
|
||||
api.apiHomeTabHome(
|
||||
"", AuthModel.get().currentUid.toString(),
|
||||
CommunityConstant.VERSION_VALID_TYPE,
|
||||
AuthModel.get().ticket
|
||||
tabId, pageNum, pageSize
|
||||
)
|
||||
}
|
||||
|
||||
@@ -178,6 +176,11 @@ object HomeModel : BaseModel() {
|
||||
}
|
||||
|
||||
|
||||
suspend fun getNewHomeTag(): List<HomeTagInfo>? =
|
||||
launchRequest {
|
||||
api.getNewHomeTag()
|
||||
}
|
||||
|
||||
suspend fun getHomeTag(): List<HomeTagInfo>? =
|
||||
launchRequest {
|
||||
api.getHomeTag()
|
||||
@@ -294,11 +297,10 @@ object HomeModel : BaseModel() {
|
||||
*/
|
||||
@GET("/home/tab/homeV2")
|
||||
suspend fun apiHomeTabHome(
|
||||
@Query("tabId") tabId: String,
|
||||
@Query("uid") uid: String,
|
||||
@Query("types") types: String,
|
||||
@Query("ticket") ticket: String
|
||||
): ServiceResult<List<HomeTabMapInfo>>
|
||||
@Query("tabId") tabId: Int,
|
||||
@Query("pageNum") page: Int,
|
||||
@Query("pageSize") pageSize: Int
|
||||
): ServiceResult<List<HomeRoomInfo>>
|
||||
|
||||
/**
|
||||
* 首页Banner
|
||||
@@ -380,6 +382,14 @@ object HomeModel : BaseModel() {
|
||||
@Query("pageSize") pageSize: Int
|
||||
): ServiceResult<List<HomeRoomInfo>>
|
||||
|
||||
/**
|
||||
* 首页 Tag List
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/home/tag")
|
||||
suspend fun getNewHomeTag(): ServiceResult<List<HomeTagInfo>>
|
||||
|
||||
/**
|
||||
* 首页派对 Tag List
|
||||
*
|
||||
|
@@ -1001,6 +1001,22 @@ public final class IMNetEaseManager {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_GUARDIAN_PLANET:
|
||||
switch (second){
|
||||
case CUSTOM_MSG_SUB_GUARDIAN_PLANET_ROOM:
|
||||
case CUSTOM_MSG_SUB_GUARDIAN_PLANET_ALL_ROOM:
|
||||
addMessages(msg);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_ROOM_TEMPLATE:
|
||||
switch (second){
|
||||
case CUSTOM_MSG_ROOM_TEMPLATE_SUB_ROOM:
|
||||
case CUSTOM_MSG_ROOM_TEMPLATE_SUB_ALL_ROOM:
|
||||
addMessages(msg);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_RADISH:
|
||||
RoomBoxPrizeAttachment boxPrizeAttachment = ((RoomBoxPrizeAttachment) msg.getAttachment());
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
@@ -2087,6 +2103,9 @@ public final class IMNetEaseManager {
|
||||
PkModel.get().syncPkList(userInfo, chatRoomMember.getGroupType());
|
||||
noticePKInfo();
|
||||
|
||||
int oldMicPosition = AvRoomDataManager.get().getMicPosition(AuthModel.get().getCurrentUid());
|
||||
boolean oldIsOnMic = AvRoomDataManager.get().isOwnerOnMic();
|
||||
|
||||
int size = mMicQueueMemberMap.size();
|
||||
if (size > 0) {
|
||||
for (int j = 0; j < size; j++) {
|
||||
@@ -2130,9 +2149,16 @@ public final class IMNetEaseManager {
|
||||
//開麥
|
||||
AudioEngineManager.get().setRole(Constants.CLIENT_ROLE_BROADCASTER);
|
||||
if (!roomQueueInfo.mChatRoomMember.isNoProhibitMic()) {
|
||||
AudioEngineManager.get().setMute(roomQueueInfo.mRoomMicInfo.isMicMute() || AvRoomDataManager.get().mIsNeedOpenMic);
|
||||
//默認閉麥去掉聲音采集
|
||||
AudioEngineManager.get().stopLocalAudio();
|
||||
/*
|
||||
修复相亲房自动闭麦bug
|
||||
原因:相亲房的某些麦位状态更新,走的是上麦通道,导致默认闭麦了
|
||||
临时解决:若是相亲房且之前在麦或麦位没变化->不做闭麦操作
|
||||
*/
|
||||
if (!AvRoomDataManager.get().isDatingMode() || (AvRoomDataManager.get().isDatingMode() && (!oldIsOnMic || oldMicPosition != micPosition))) {
|
||||
AudioEngineManager.get().setMute(roomQueueInfo.mRoomMicInfo.isMicMute() || AvRoomDataManager.get().mIsNeedOpenMic);
|
||||
// 默認閉麥去掉聲音采集upMicroQueue
|
||||
AudioEngineManager.get().stopLocalAudio();
|
||||
}
|
||||
}
|
||||
}
|
||||
noticeUpMic(Integer.parseInt(key), chatRoomMember.getAccount());
|
||||
|
@@ -169,11 +169,17 @@ public class EngineEventHandler extends IRtcEngineEventHandler {
|
||||
@Override
|
||||
public void onAudioMixingFinished() {//伴奏播放已结束回调
|
||||
super.onAudioMixingFinished();
|
||||
IMNetEaseManager.get().getChatRoomEventObservable().onNext(
|
||||
new RoomEvent().setEvent(RoomEvent.METHOD_ON_AUDIO_MIXING_FINISHED)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAudioMixingStateChanged(int state, int reasonCode) {
|
||||
super.onAudioMixingStateChanged(state, reasonCode);
|
||||
if (state == Constants.AUDIO_MIXING_STATE_STOPPED && reasonCode == Constants.AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED) {
|
||||
IMNetEaseManager.get().getChatRoomEventObservable().onNext(
|
||||
new RoomEvent().setEvent(RoomEvent.METHOD_ON_AUDIO_MIXING_FINISHED)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteAudioStateChanged(int i, int i1, int i2, int i3) {
|
||||
|
@@ -0,0 +1,23 @@
|
||||
package com.yizhuan.xchat_android_core.bean
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/22 18:36
|
||||
* Desc:
|
||||
**/
|
||||
class I18N : HashMap<String, String>(), Serializable {
|
||||
/**
|
||||
* 获取优先显示文本
|
||||
*/
|
||||
fun getFirstText(): String? {
|
||||
// 目前应用只支持繁体,后续支持其他语言,这里需要调整
|
||||
val content = get("zh-TW")
|
||||
return if (content.isNullOrEmpty()) {
|
||||
this.values.firstOrNull()
|
||||
} else {
|
||||
content
|
||||
}
|
||||
}
|
||||
}
|
@@ -23,6 +23,7 @@ import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUS
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GROUP_CHAT_ROOM_NOTIFY;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GROUP_CHAT_TOPIC;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GROUP_ROOM_JOIN_NOTICE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GUARDIAN_PLANET;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_COMMON_SYSTEM_MSG;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_KICK_MIC;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_LUCKY_MONEY;
|
||||
@@ -613,6 +614,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
|
||||
case CUSTOM_MSG_RADISH:
|
||||
attachment = new RoomBoxPrizeAttachment(CUSTOM_MSG_RADISH, second);
|
||||
break;
|
||||
case CUSTOM_MSG_GUARDIAN_PLANET:
|
||||
attachment = new GuardianPlanetAttachment(CUSTOM_MSG_GUARDIAN_PLANET, second);
|
||||
break;
|
||||
case CUSTOM_MSG_DRAW_GIFT_EFFECT:
|
||||
if (second == CUSTOM_MSG_SUB_TYPE_DRAW_GIFT_EFFECT) {
|
||||
attachment = new DrawGiftAttachment(first, second);
|
||||
@@ -655,6 +659,12 @@ public class CustomAttachParser implements MsgAttachmentParser {
|
||||
attachment = new RoomAlbumAttachment();
|
||||
}
|
||||
break;
|
||||
case CustomAttachment.CUSTOM_MSG_ROOM_TEMPLATE:
|
||||
if (second == CustomAttachment.CUSTOM_MSG_ROOM_TEMPLATE_SUB_ROOM
|
||||
|| second == CustomAttachment.CUSTOM_MSG_ROOM_TEMPLATE_SUB_ALL_ROOM) {
|
||||
attachment = new TemplateMessageAttachment(first, second);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LogUtils.e(ResUtil.getString(R.string.custom_bean_customattachparser_01) + first + " second=" + second);
|
||||
break;
|
||||
|
@@ -140,6 +140,11 @@ public class CustomAttachment implements MsgAttachment {
|
||||
public static final int CUSTOM_MSG_SUB_BOX_ALL_ROOM = 983;//所有房间可见
|
||||
public static final int CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY = 984;//所有房间可见+小秘书
|
||||
public static final int CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY_BY_SVGA = 985;//所有房间可见+小秘书+高大上的SVGA
|
||||
|
||||
//守护星球
|
||||
public static final int CUSTOM_MSG_GUARDIAN_PLANET = 102;
|
||||
public static final int CUSTOM_MSG_SUB_GUARDIAN_PLANET_ROOM = 1021;//单房间
|
||||
public static final int CUSTOM_MSG_SUB_GUARDIAN_PLANET_ALL_ROOM = 1022;//全部房间
|
||||
//KTV
|
||||
public static final int CUSTOM_MSG_KTV = 27;
|
||||
public static final int CUSTOM_MSG_SUB_KTV_ADD = 271;
|
||||
@@ -480,6 +485,10 @@ public class CustomAttachment implements MsgAttachment {
|
||||
public static final int CUSTOM_MSG_ROOM_ALBUM = 101;
|
||||
public static final int CUSTOM_MSG_ROOM_ALBUM_SUB = 1011;
|
||||
|
||||
// 模版消息
|
||||
public static final int CUSTOM_MSG_ROOM_TEMPLATE = 103;
|
||||
public static final int CUSTOM_MSG_ROOM_TEMPLATE_SUB_ROOM = 1031;
|
||||
public static final int CUSTOM_MSG_ROOM_TEMPLATE_SUB_ALL_ROOM = 1032;
|
||||
|
||||
/**
|
||||
* 自定义消息附件的类型,根据该字段区分不同的自定义消息
|
||||
|
@@ -0,0 +1,54 @@
|
||||
package com.yizhuan.xchat_android_core.im.custom.bean;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/02/21.
|
||||
*/
|
||||
|
||||
public class GuardianPlanetAttachment extends CustomAttachment {
|
||||
private long uid;
|
||||
private String nick;
|
||||
private long diamonds;
|
||||
|
||||
public GuardianPlanetAttachment(int first, int second) {
|
||||
super(first, second);
|
||||
}
|
||||
|
||||
public long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public long getDiamonds() {
|
||||
return diamonds;
|
||||
}
|
||||
|
||||
public void setDiamonds(long diamonds) {
|
||||
this.diamonds = diamonds;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void parseData(JSONObject jsonObject) {
|
||||
if (jsonObject.containsKey("uid")) {
|
||||
uid = jsonObject.getLongValue("uid");
|
||||
}
|
||||
if (jsonObject.containsKey("nick")) {
|
||||
nick = jsonObject.getString("nick");
|
||||
}
|
||||
if (jsonObject.containsKey("diamonds")) {
|
||||
diamonds = jsonObject.getLongValue("diamonds");
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,132 @@
|
||||
package com.yizhuan.xchat_android_core.im.custom.bean
|
||||
|
||||
import com.chuhai.utils.StringUtils
|
||||
import com.yizhuan.xchat_android_core.bean.I18N
|
||||
import com.yizhuan.xchat_android_core.home.bean.IRouterData
|
||||
import java.io.Serializable
|
||||
import java.util.regex.Pattern
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/22 18:51
|
||||
* Desc:
|
||||
**/
|
||||
data class TemplateMessage(
|
||||
var template: I18N? = null,
|
||||
var textColor: String? = null,
|
||||
val contents: List<Content>? = null
|
||||
) : Serializable {
|
||||
|
||||
private val nodeList: List<TemplateNode>? = null
|
||||
|
||||
fun getNodeList(): List<TemplateNode> {
|
||||
var nodeList = this.nodeList
|
||||
if (nodeList == null) {
|
||||
nodeList = parseNodes()
|
||||
}
|
||||
return nodeList
|
||||
}
|
||||
|
||||
// 转化为方便渲染的节点列表
|
||||
private fun parseNodes(): List<TemplateNode> {
|
||||
val templateText = template?.getFirstText()
|
||||
val contentList = this.contents
|
||||
val defTextColor = this.textColor
|
||||
if (templateText.isNullOrEmpty()) {
|
||||
return emptyList()
|
||||
}
|
||||
if (contentList.isNullOrEmpty()) {
|
||||
return listOf(
|
||||
TemplateNode.NormalNode(
|
||||
text = templateText,
|
||||
textColor = defTextColor
|
||||
)
|
||||
)
|
||||
}
|
||||
val list = ArrayList<TemplateNode>()
|
||||
StringUtils.split(
|
||||
content = templateText,
|
||||
pattern = Pattern.compile("\\{.+?\\}"),
|
||||
onNormalNode = {
|
||||
list.add(
|
||||
TemplateNode.NormalNode(
|
||||
text = it,
|
||||
textColor = defTextColor
|
||||
)
|
||||
)
|
||||
},
|
||||
onMatchNode = { text ->
|
||||
val content = contentList.firstOrNull {
|
||||
"{${it.key}}" == text
|
||||
}
|
||||
if (content?.type == Content.TEXT && content.textColor.isNullOrEmpty()) {
|
||||
// 默认文本色
|
||||
content.textColor = textColor
|
||||
}
|
||||
if (content != null) {
|
||||
list.add(
|
||||
TemplateNode.SpecialNode(
|
||||
content = content
|
||||
)
|
||||
)
|
||||
}
|
||||
})
|
||||
return list
|
||||
}
|
||||
|
||||
data class Content(
|
||||
/**
|
||||
* 公共字段
|
||||
*/
|
||||
val key: String? = null,
|
||||
// TEXT,IMAGE
|
||||
val type: String? = null,
|
||||
val skipType: Int? = null,
|
||||
val skipContent: String? = null,
|
||||
|
||||
/**
|
||||
* 文本相关字段(type=TEXT)
|
||||
*/
|
||||
val text: I18N? = null,
|
||||
var textColor: String? = null,
|
||||
|
||||
/**
|
||||
* 图片相关字段(type=IMAGE)
|
||||
*/
|
||||
val image: String? = null,
|
||||
val width: Int? = null,
|
||||
val height: Int? = null
|
||||
) : Serializable, IRouterData {
|
||||
|
||||
override fun getSkipType(): Int {
|
||||
return skipType ?: 0
|
||||
}
|
||||
|
||||
override fun getRouterType(): String? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getRouterValue(): String? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getSkipUri(): String? {
|
||||
return skipContent
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TEXT = "TEXT"
|
||||
const val IMAGE = "IMAGE"
|
||||
}
|
||||
}
|
||||
|
||||
interface TemplateNode : Serializable {
|
||||
data class NormalNode(
|
||||
var text: String,
|
||||
var textColor: String? = null
|
||||
) : TemplateNode
|
||||
|
||||
data class SpecialNode(
|
||||
var content: Content
|
||||
) : TemplateNode
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
package com.yizhuan.xchat_android_core.im.custom.bean
|
||||
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import com.google.gson.Gson
|
||||
|
||||
/**
|
||||
* Created by Max on 2024/2/22 17:28
|
||||
* Desc:
|
||||
**/
|
||||
class TemplateMessageAttachment : CustomAttachment {
|
||||
|
||||
constructor() : super()
|
||||
constructor(first: Int, second: Int) : super(first, second)
|
||||
|
||||
private var templateMessage: TemplateMessage? = null
|
||||
|
||||
fun getTemplateMessage() = templateMessage
|
||||
|
||||
override fun parseData(data: JSONObject?) {
|
||||
super.parseData(data)
|
||||
if (data != null) {
|
||||
try {
|
||||
templateMessage = Gson().fromJson<TemplateMessage>(
|
||||
data.toJSONString(),
|
||||
TemplateMessage::class.java
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -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
|
||||
}
|
||||
}
|
@@ -19,4 +19,6 @@ interface RoomView {
|
||||
fun getRoomContext(): RoomContext? {
|
||||
return RoomContext.get()
|
||||
}
|
||||
|
||||
fun findWidget(name: String): RoomWidget?
|
||||
}
|
@@ -12,4 +12,23 @@ public class SingleRoomIncomeInfo implements Serializable {
|
||||
private String avatar;
|
||||
private double roomDiamondNum;
|
||||
private double anchorDiamondNum;
|
||||
private long timeDuration;
|
||||
private String timeDurationStr;
|
||||
|
||||
public String getTimeStr() {
|
||||
if (timeDurationStr != null) {
|
||||
return timeDurationStr;
|
||||
}
|
||||
long h = timeDuration / 60;
|
||||
StringBuilder timeStrBuffer = new StringBuilder();
|
||||
if (h > 0) {
|
||||
timeStrBuffer.append(h);
|
||||
timeStrBuffer.append("h");
|
||||
}
|
||||
long m = timeDuration % 60;
|
||||
timeStrBuffer.append(m);
|
||||
timeStrBuffer.append("min");
|
||||
timeDurationStr = timeStrBuffer.toString();
|
||||
return timeDurationStr;
|
||||
}
|
||||
}
|
||||
|
@@ -31,8 +31,8 @@ COMPILE_SDK_VERSION=33
|
||||
MIN_SDK_VERSION=21
|
||||
TARGET_SDK_VERSION=33
|
||||
|
||||
version_name=2.5.0
|
||||
version_code=2500
|
||||
version_name=2.6.1
|
||||
version_code=2601
|
||||
|
||||
#systemProp.https.proxyHost=127.0.0.1
|
||||
#systemProp.https.proxyPort=7890
|
@@ -0,0 +1,64 @@
|
||||
package com.chuhai.utils
|
||||
|
||||
import java.util.regex.Pattern
|
||||
|
||||
/**
|
||||
* Created by Max on 2/10/21 4:56 PM
|
||||
* Desc:字符串工具
|
||||
*/
|
||||
object StringUtils {
|
||||
|
||||
/**
|
||||
* 拆分字符串(根据匹配规则,按顺序拆分出来)
|
||||
* @param pattern 匹配节点的规则模式
|
||||
* @param onNormalNode<节点内容> 普通节点
|
||||
* @param onMatchNode<节点内容> 匹配节点
|
||||
*/
|
||||
fun split(
|
||||
content: String,
|
||||
pattern: Pattern,
|
||||
onNormalNode: (String) -> Unit,
|
||||
onMatchNode: (String) -> Unit,
|
||||
) {
|
||||
try {
|
||||
if (content.isEmpty()) {
|
||||
onNormalNode.invoke(content)
|
||||
return
|
||||
}
|
||||
val matcher = pattern.matcher(content)
|
||||
// 最后一个匹配项的结束位置
|
||||
var lastItemEnd = 0
|
||||
var noMatch = true
|
||||
while (matcher.find()) {
|
||||
noMatch = false
|
||||
// 匹配元素的开启位置
|
||||
val start = matcher.start()
|
||||
// 匹配元素的结束位置
|
||||
val end = matcher.end()
|
||||
// 匹配元素的文本
|
||||
val text = matcher.group()
|
||||
// 匹配元素的对应索引
|
||||
// logD("split() start:$start ,end:$end ,text:$text")
|
||||
if (start > lastItemEnd) {
|
||||
// 普通节点
|
||||
val nodeContent = content.substring(lastItemEnd, start)
|
||||
onNormalNode.invoke(nodeContent)
|
||||
}
|
||||
// 匹配节点显示内容
|
||||
onMatchNode.invoke(text)
|
||||
lastItemEnd = end
|
||||
}
|
||||
if (lastItemEnd > 0 && lastItemEnd < content.length) {
|
||||
// 最后的匹配项不是尾部(追加最后的尾部)
|
||||
val nodeContent = content.substring(lastItemEnd, content.length)
|
||||
onNormalNode.invoke(nodeContent)
|
||||
}
|
||||
if (noMatch) {
|
||||
// 无匹配
|
||||
onNormalNode.invoke(content)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user