feat:调整首页派对-礼物消息-房间上锁的处理
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package com.nnbc123.app.home.adapter
|
package com.nnbc123.app.home.adapter
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
import androidx.core.view.isVisible
|
||||||
import com.nnbc123.app.R
|
import com.nnbc123.app.R
|
||||||
import com.nnbc123.app.ui.utils.load
|
import com.nnbc123.app.ui.utils.load
|
||||||
import com.nnbc123.app.ui.utils.loadAvatar
|
import com.nnbc123.app.ui.utils.loadAvatar
|
||||||
@@ -14,6 +16,8 @@ import com.zhpan.bannerview.BaseViewHolder
|
|||||||
* Desc:
|
* Desc:
|
||||||
**/
|
**/
|
||||||
class HomePartyMessageAdapter : BaseBannerAdapter<GiftServiceMsgVo>() {
|
class HomePartyMessageAdapter : BaseBannerAdapter<GiftServiceMsgVo>() {
|
||||||
|
|
||||||
|
var clickListener: ((GiftServiceMsgVo) -> Unit)? = null
|
||||||
override fun bindData(
|
override fun bindData(
|
||||||
holder: BaseViewHolder<GiftServiceMsgVo>,
|
holder: BaseViewHolder<GiftServiceMsgVo>,
|
||||||
item: GiftServiceMsgVo,
|
item: GiftServiceMsgVo,
|
||||||
@@ -27,6 +31,11 @@ class HomePartyMessageAdapter : BaseBannerAdapter<GiftServiceMsgVo>() {
|
|||||||
holder.findViewById<ImageView>(R.id.iv_avatar_send).loadAvatar(item.senderAvatar)
|
holder.findViewById<ImageView>(R.id.iv_avatar_send).loadAvatar(item.senderAvatar)
|
||||||
holder.findViewById<ImageView>(R.id.iv_avatar_receiver).loadAvatar(item.receiverAvatar)
|
holder.findViewById<ImageView>(R.id.iv_avatar_receiver).loadAvatar(item.receiverAvatar)
|
||||||
holder.findViewById<ImageView>(R.id.iv_gift).load(item.giftPicUrl)
|
holder.findViewById<ImageView>(R.id.iv_gift).load(item.giftPicUrl)
|
||||||
|
val arrowView = holder.findViewById<View>(R.id.iv_arrow)
|
||||||
|
arrowView.isVisible = !item.isLock
|
||||||
|
arrowView.setOnClickListener {
|
||||||
|
clickListener?.invoke(item)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getLayoutId(viewType: Int): Int {
|
override fun getLayoutId(viewType: Int): Int {
|
||||||
|
@@ -85,20 +85,18 @@ class PartyFragment : BaseBindingFragment<HomePartyFragmentBinding>() {
|
|||||||
|
|
||||||
private fun initHotMessage() {
|
private fun initHotMessage() {
|
||||||
val adapter = HomePartyMessageAdapter()
|
val adapter = HomePartyMessageAdapter()
|
||||||
mBinding.hotMessage.apply {
|
adapter.clickListener = {
|
||||||
setOrientation(ViewPager2.ORIENTATION_VERTICAL)
|
|
||||||
setAdapter(adapter)
|
|
||||||
registerLifecycleObserver(lifecycle)
|
|
||||||
setUserInputEnabled(false)
|
|
||||||
setOnPageClickListener { _, position ->
|
|
||||||
adapter.getItem(position)?.let {
|
|
||||||
StatisticManager.Instance().onEvent(
|
StatisticManager.Instance().onEvent(
|
||||||
StatisticsProtocol.EVENT_HOMEPAGE_INFORM_CLICK,
|
StatisticsProtocol.EVENT_HOMEPAGE_INFORM_CLICK,
|
||||||
it.roomUid.toString()
|
it.roomUid.toString()
|
||||||
)
|
)
|
||||||
AVRoomActivity.start(mContext, it.roomUid)
|
AVRoomActivity.start(mContext, it.roomUid)
|
||||||
}
|
}
|
||||||
}
|
mBinding.hotMessage.apply {
|
||||||
|
setOrientation(ViewPager2.ORIENTATION_VERTICAL)
|
||||||
|
setAdapter(adapter)
|
||||||
|
registerLifecycleObserver(lifecycle)
|
||||||
|
setUserInputEnabled(false)
|
||||||
}.create()
|
}.create()
|
||||||
viewModel.giftServiceLiveData.observe(viewLifecycleOwner) {
|
viewModel.giftServiceLiveData.observe(viewLifecycleOwner) {
|
||||||
if (it.isSuccess && !it.data.isNullOrEmpty()) {
|
if (it.isSuccess && !it.data.isNullOrEmpty()) {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 124 KiB |
BIN
app/src/main/res/drawable-xxhdpi/home_bg_match.webp
Normal file
BIN
app/src/main/res/drawable-xxhdpi/home_bg_match.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
@@ -104,16 +104,20 @@
|
|||||||
app:layout_constraintEnd_toStartOf="@id/iv_arrow"
|
app:layout_constraintEnd_toStartOf="@id/iv_arrow"
|
||||||
app:layout_constraintStart_toEndOf="@id/iv_gift"
|
app:layout_constraintStart_toEndOf="@id/iv_gift"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:text="x11" />
|
app:layout_goneMarginEnd="@dimen/dp_12"
|
||||||
|
tools:text="x1111111111" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_arrow"
|
android:id="@+id/iv_arrow"
|
||||||
android:layout_width="@dimen/dp_12"
|
android:layout_width="@dimen/dp_22"
|
||||||
android:layout_height="@dimen/dp_12"
|
android:layout_height="@dimen/dp_22"
|
||||||
android:layout_marginEnd="@dimen/dp_12"
|
android:layout_marginEnd="@dimen/dp_7"
|
||||||
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/home_ic_hot_message_arrow"
|
android:src="@drawable/home_ic_hot_message_arrow"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -14,6 +14,15 @@ public class GiftServiceMsgVo {
|
|||||||
private String giftName;
|
private String giftName;
|
||||||
private int giftNum;
|
private int giftNum;
|
||||||
private String giftPicUrl;
|
private String giftPicUrl;
|
||||||
|
private boolean lock;
|
||||||
|
|
||||||
|
public boolean isLock() {
|
||||||
|
return lock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLock(boolean lock) {
|
||||||
|
this.lock = lock;
|
||||||
|
}
|
||||||
|
|
||||||
public long getRoomUid() {
|
public long getRoomUid() {
|
||||||
return roomUid;
|
return roomUid;
|
||||||
|
Reference in New Issue
Block a user