新用户打招呼弹窗bugfix
This commit is contained in:
@@ -3,7 +3,9 @@ package com.mango.moshen.home.dialog
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.widget.FrameLayout
|
||||
import com.mango.moshen.avroom.activity.AVRoomActivity
|
||||
import com.mango.moshen.base.BaseDialog
|
||||
import com.mango.moshen.databinding.DialogNewUserHelloBinding
|
||||
@@ -11,6 +13,8 @@ import com.mango.moshen.ui.utils.load
|
||||
import com.mango.core.channel_page.bean.NewUserHelloInfo
|
||||
import com.mango.core.statistic.StatisticManager
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol
|
||||
import com.mango.core.user.bean.UserInfo
|
||||
import com.mango.core.user.bean.UserInfoSkillEntity
|
||||
import com.mango.core.utils.subAndReplaceDot
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.audio.helper.AudioPlayerHelper
|
||||
@@ -42,9 +46,21 @@ class NewUserHelloDialog : BaseDialog<DialogNewUserHelloBinding>() {
|
||||
|
||||
@SuppressLint("CheckResult", "SetTextI18n")
|
||||
override fun init() {
|
||||
binding.ivAvatar.load(newUserHelloInfo.sayHelloUserAvatar)
|
||||
binding.ivAvatar.load(newUserHelloInfo.sayHelloUserAvatar, 19f)
|
||||
binding.tvNick.text = newUserHelloInfo.sayHelloUserNickname.subAndReplaceDot(8)
|
||||
binding.tvContent.text = newUserHelloInfo.sayHelloMsg
|
||||
|
||||
binding.tvNick.setCompoundDrawablesRelativeWithIntrinsicBounds(
|
||||
0,
|
||||
0,
|
||||
if (newUserHelloInfo.gender == UserInfo.GENDER_MALE) {
|
||||
R.drawable.ic_gender_male
|
||||
} else {
|
||||
R.drawable.ic_gender_female
|
||||
},
|
||||
0
|
||||
)
|
||||
|
||||
binding.ivGoRoom.setOnClickListener {
|
||||
AVRoomActivity.startForFromType(
|
||||
requireContext(),
|
||||
@@ -59,15 +75,24 @@ class NewUserHelloDialog : BaseDialog<DialogNewUserHelloBinding>() {
|
||||
)
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
binding.llAudio.setOnClickListener { toggleAudio(newUserHelloInfo.voiceCard?.propVals) }
|
||||
initVoiceShow(newUserHelloInfo.voiceCard)
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.EVENT_SAYHI_POP_VOICE_CLICK, "打招呼弹窗播放声音秀点击"
|
||||
)
|
||||
}
|
||||
|
||||
private fun initVoiceShow(skillEntity: UserInfoSkillEntity?) {
|
||||
if (skillEntity != null) {
|
||||
binding.llAudio.visibility = View.VISIBLE
|
||||
binding.llAudio.setOnClickListener { toggleAudio(skillEntity.propVals) }
|
||||
} else {
|
||||
binding.llAudio.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
private fun toggleAudio(list: List<String>?) {
|
||||
if (list.isNullOrEmpty()) return
|
||||
val url: String? = list.findLast { it == "http" }
|
||||
val url: String? = list.findLast { it.contains("http") }
|
||||
if (TextUtils.isEmpty(url)) return
|
||||
if (!audioPlaying) {
|
||||
playAudio(url)
|
||||
|
||||
@@ -85,8 +85,10 @@
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:gravity="center"
|
||||
android:drawableEnd="@drawable/ic_gender_female"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:drawablePadding="5dp"
|
||||
tools:text="魔力可可鸭魔力可..." />
|
||||
|
||||
<TextView
|
||||
@@ -96,9 +98,10 @@
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:maxLines="2"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="欢迎来到魔力,Ta已经等待你很久啦,快来一起玩吧~"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="欢迎来到魔力,Ta已经等待你很久啦Ta已经等待你很久啦Ta已经等待你很久啦,快来一起玩吧~"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
@@ -11,5 +11,6 @@ data class NewUserHelloInfo(
|
||||
val sayHelloUserAvatar: String = "",
|
||||
val sayHelloUserErbanNo: Int = 0,
|
||||
val sayHelloUserNickname: String = "",
|
||||
val gender: Int = 0,
|
||||
val voiceCard: UserInfoSkillEntity? = null
|
||||
) : Serializable
|
||||
Reference in New Issue
Block a user