Merge branch 'v2.2.0/float_gift' into v2.2.0/test

# Conflicts:
#	app/src/main/java/com/yizhuan/erban/ui/widget/dialog/AllServiceGiftLevelDialog.kt
#	app/src/main/res/layout/dialog_gift_all_service_level.xml
#	app/src/main/res/values/colors.xml
#	app/src/main/res/values/strings.xml
This commit is contained in:
Max
2023-10-28 12:56:42 +08:00
5 changed files with 176 additions and 8 deletions

View File

@@ -37,6 +37,7 @@ import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import java.io.File
import kotlin.random.Random
/**
* 设置页
@@ -217,7 +218,7 @@ class SettingActivity : BaseViewBindingActivity<ActivitySettingBinding>(), View.
private fun debug() {
// RedPackageOpenDialog2().show(this)
val json = "{\"first\":3,\"second\":32,\"data\":{\"recvUserUid\":2735,\"recvUserAvatar\":\"https://img.pekolive.com/default_avatar.png\",\"recvUserNick\":\"66丢丢丢丢丢多多多的hhhh\",\"sendUserNick\":\"11的ass\",\"sendUserAvatar\":\"http://beta.img.pekolive.com/Fk7aur-1RBqKXC-qqBwMTjivZ3lV?imageslim\",\"sendUserUid\":2737,\"giftUrl\":\"http://beta.img.pekolive.com/Fn6h_gPFD5MwA-Ql_kcWqNpKp0JM?imageslim\",\"giftName\":\"幽靈糖果\",\"giftId\":2075,\"giftNum\":10239,\"giftGolds\":33440,\"notifyStaySecond\":5,\"isHomeShow\":true,\"isSkipRoom\":true,\"isFullScreen\":false,\"isSendMsg\":false,\"roomUid\":2737,\"roomErbanNo\":11,\"roomTitle\":\"11的工会经费吃不吃女家具v家\",\"levelNum\":2}}"
val json = "{\"first\":3,\"second\":32,\"data\":{\"recvUserUid\":2735,\"recvUserAvatar\":\"https://img.pekolive.com/default_avatar.png\",\"recvUserNick\":\"66丢丢丢丢丢多多多的hhhh\",\"sendUserNick\":\"11的ass\",\"sendUserAvatar\":\"http://beta.img.pekolive.com/Fk7aur-1RBqKXC-qqBwMTjivZ3lV?imageslim\",\"sendUserUid\":2737,\"giftUrl\":\"http://beta.img.pekolive.com/Fn6h_gPFD5MwA-Ql_kcWqNpKp0JM?imageslim\",\"giftName\":\"幽靈糖果\",\"giftId\":2075,\"giftNum\":${Random.nextInt(1,1000)},\"giftGolds\":33440,\"notifyStaySecond\":5,\"isHomeShow\":true,\"isSkipRoom\":true,\"isFullScreen\":false,\"isSendMsg\":false,\"roomUid\":2737,\"roomErbanNo\":11,\"roomTitle\":\"11的工会\",\"levelNum\":${Random.nextInt(1,4)}}}"
onReceivedNimBroadcastMessage(json)
}
}

View File

@@ -17,6 +17,7 @@ import com.chuhai.utils.ktx.toStringRes
import com.chuhai.utils.spannable.SpannableTextBuilder
import com.yizhuan.erban.R
import com.yizhuan.erban.avroom.activity.AVRoomActivity
import com.yizhuan.erban.databinding.DialogGiftAllServiceLevel2Binding
import com.yizhuan.erban.databinding.DialogGiftAllServiceLevelBinding
import com.yizhuan.erban.public_chat_hall.activity.PublicChatHallHomeActivity
import com.yizhuan.xchat_android_core.initial.InitialModel
@@ -33,7 +34,7 @@ import java.util.concurrent.TimeUnit
class AllServiceGiftLevelDialog : BaseDialog {
private var data: AllServiceGiftProtocol.DataBean? = null
private var binding: DialogGiftAllServiceLevelBinding? = null
private var binding: DialogGiftAllServiceLevel2Binding? = null
private var disposable: Disposable? = null
@@ -51,7 +52,7 @@ class AllServiceGiftLevelDialog : BaseDialog {
super.onCreate(savedInstanceState)
requestWindowFeature(Window.FEATURE_NO_TITLE)
val inflate =
LayoutInflater.from(context).inflate(R.layout.dialog_gift_all_service_level, null)
LayoutInflater.from(context).inflate(R.layout.dialog_gift_all_service_level2, null)
setContentView(inflate.rootView)
setCancelable(true)
setCanceledOnTouchOutside(true)
@@ -84,7 +85,7 @@ class AllServiceGiftLevelDialog : BaseDialog {
private fun init(
data: AllServiceGiftProtocol.DataBean,
binding: DialogGiftAllServiceLevelBinding
binding: DialogGiftAllServiceLevel2Binding
) {
binding.tvRoomGo.singleClick {
if (data.roomUid == JavaUtil.str2long(InitialModel.get().publicChatHallUid)) {

View File

@@ -16,7 +16,7 @@
android:layout_height="69dp"
android:background="@drawable/all_service_gift_bg_1">
<com.yizhuan.erban.common.widget.CircleImageView
<ImageView
android:id="@+id/iv_avatar_bg"
android:layout_width="88dp"
android:layout_height="69dp"
@@ -47,7 +47,6 @@
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center_vertical"
android:includeFontPadding="false"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
@@ -73,8 +72,11 @@
android:textSize="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/tv_room_go"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/iv_room"
app:layout_constraintTop_toBottomOf="@id/tv_message"
app:layout_constraintWidth_default="wrap"
tools:text="XXXXXXXX" />
<TextView
@@ -91,6 +93,7 @@
android:textSize="10dp"
app:layout_constraintBottom_toBottomOf="@id/tv_room_name"
app:layout_constraintEnd_toStartOf="@id/iv_gift"
app:layout_constraintStart_toEndOf="@id/tv_room_name"
app:layout_constraintTop_toTopOf="@id/tv_room_name" />
@@ -130,7 +133,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="X100000000000000" />
tools:text="X1000" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="giftBean"
type="com.yizhuan.xchat_android_core.noble.AllServiceGiftProtocol.DataBean" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_root"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/all_service_gift_bg_1"
app:layout_constraintDimensionRatio="h,375:69"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_avatar_bg"
android:layout_width="0dp"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="@id/iv_avatar"
app:layout_constraintDimensionRatio="w,89:69"
app:layout_constraintEnd_toEndOf="@id/iv_avatar"
app:layout_constraintStart_toStartOf="@id/iv_avatar"
app:layout_constraintTop_toTopOf="@id/iv_avatar"
tools:background="@color/black" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/line_content_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.0586" />
<com.yizhuan.erban.common.widget.CircleImageView
android:id="@+id/iv_avatar"
avatarUrl="@{giftBean.sendUserAvatar}"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="w,1:1"
app:layout_constraintHeight_percent="0.6376"
app:layout_constraintStart_toStartOf="@id/line_content_start"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/default_avatar" />
<TextView
android:id="@+id/tv_message"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginEnd="4.5dp"
android:layout_marginBottom="5dp"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:includeFontPadding="false"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="14dp"
app:layout_constraintBottom_toTopOf="@id/tv_room_name"
app:layout_constraintEnd_toStartOf="@id/iv_gift"
app:layout_constraintStart_toEndOf="@id/iv_avatar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="XXX 送给 XXX XXXX" />
<TextView
android:id="@+id/tv_room_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="2.5dp"
android:layout_marginEnd="4.5dp"
android:includeFontPadding="false"
android:singleLine="true"
android:text="@{giftBean.roomTitle}"
android:textColor="@color/white"
android:textSize="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/tv_room_go"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/iv_room"
app:layout_constraintTop_toBottomOf="@id/tv_message"
app:layout_constraintWidth_default="wrap"
tools:text="X11111111111111111" />
<TextView
android:id="@+id/tv_room_go"
android:layout_width="wrap_content"
android:layout_height="19dp"
android:layout_marginEnd="2dp"
android:background="@drawable/all_service_gift_bg_room_go1"
android:gravity="center"
android:paddingHorizontal="7.5dp"
android:singleLine="true"
android:text="@string/all_service_gift_room_go"
android:textColor="@color/white"
android:textSize="10dp"
app:layout_constraintBottom_toBottomOf="@id/tv_room_name"
app:layout_constraintEnd_toStartOf="@id/iv_gift"
app:layout_constraintStart_toEndOf="@id/tv_room_name"
app:layout_constraintTop_toTopOf="@id/tv_room_name" />
<ImageView
android:id="@+id/iv_room"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@drawable/all_service_gift_ic_room"
app:layout_constraintBottom_toBottomOf="@id/tv_room_name"
app:layout_constraintStart_toStartOf="@id/tv_message"
app:layout_constraintTop_toTopOf="@id/tv_room_name" />
<ImageView
android:id="@+id/iv_gift"
nomalUrl="@{giftBean.giftUrl}"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="2dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="w,1:1"
app:layout_constraintEnd_toStartOf="@id/tv_count"
app:layout_constraintHeight_percent="0.9275"
app:layout_constraintTop_toTopOf="parent"
tools:background="@color/black" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/line_content_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.9413" />
<TextView
android:id="@+id/tv_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxWidth="180dp"
android:singleLine="true"
android:text="@{`X` + giftBean.giftNum}"
android:textColor="@color/color_FFE468"
android:textSize="16dp"
android:textStyle="italic|bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/line_content_end"
app:layout_constraintTop_toTopOf="parent"
tools:text="X10000" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -5182,6 +5182,5 @@
<string name="red_package_open_tips_msg_end">可搶紅包</string>
<string name="red_package_result_empty_tips">搶完了,下次早點來哦~</string>
<string name="red_package_disabled_tips">該紅包已失效</string>
</resources>