Browse Source

fix : receiver tostring

tongmengxiao 6 tháng trước cách đây
mục cha
commit
aabc4843c4

+ 6 - 0
room/src/main/java/com/swago/room/giftdandao/GiftDanDaoView.kt

@@ -321,6 +321,7 @@ class GiftDanDaoView : FrameLayout {
             }
             imageViewData[0].setImageResource(R.mipmap.ic_dan_dao_x)
             llNum.addView(imageViewData[0])
+            llNum.layoutDirection = View.LAYOUT_DIRECTION_LTR
             giftCount.toString().toCharArray().forEachIndexed {  index,char ->
                 when(char){
                     '0' -> {
@@ -402,6 +403,11 @@ class GiftDanDaoView : FrameLayout {
             it.decodeFromAssets(path,object:SVGAParser.ParseCompletion{
                 override fun onComplete(videoItem: SVGAVideoEntity) {
                     binding?.apply {
+                        if (isDevicesRtl){
+                            svgaImageView.scaleX = -1f
+                        } else {
+                            svgaImageView.scaleX = 1f
+                        }
                         val drawable = SVGADrawable(videoItem)
                         svgaImageView.setImageDrawable(drawable)
                         svgaImageView.loops = 99999

+ 1 - 1
room/src/main/java/com/swago/room/vm/MsgVm.kt

@@ -687,7 +687,7 @@ class MsgVm(application: Application) : AbsMsgVm(application) {
                                 imGiftModel.senderAvatar = it.senderAvatar
                                 imGiftModel.isCombo = it.isCombo
                                 imGiftModel.senderCode = it.senderCode
-                                imGiftModel.receiverUserId = receiverUserId
+                                imGiftModel.receiverUserId = receiverUserId.toString()
                                 showGiftDanDao?.invoke(imGiftModel)
                             } else {
                                 if (it.giftType == 1 || it.giftType == 5){

+ 16 - 14
room/src/main/res/layout/view_item_gift.xml

@@ -107,7 +107,7 @@
                 android:id="@+id/tvNum"
                 android:textSize="18dp"
                 android:textColor="#fff"
-                android:text="x123456789 "
+                android:text="x123456789"
                 android:visibility="invisible"
                 tools:visibility="visible"
                 android:textStyle="bold|italic"
@@ -116,22 +116,24 @@
                 app:layout_constraintBottom_toBottomOf="@+id/ll_count"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"/>
-        </androidx.constraintlayout.widget.ConstraintLayout>
 
 
+            <LinearLayout
+                android:id="@+id/llNum"
+                android:layout_marginStart="5dp"
+                android:orientation="horizontal"
+                android:visibility="invisible"
+                tools:visibility="visible"
+                app:layout_constraintLeft_toRightOf="@+id/ivGiftIcon"
+                app:layout_constraintTop_toTopOf="@+id/ll_count"
+                app:layout_constraintBottom_toBottomOf="@+id/ll_count"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content">
+
+            </LinearLayout>
+
+        </androidx.constraintlayout.widget.ConstraintLayout>
 
-        <LinearLayout
-            android:id="@+id/llNum"
-            android:layout_marginStart="5dp"
-            android:orientation="horizontal"
-            android:visibility="invisible"
-            tools:visibility="visible"
-            app:layout_constraintTop_toTopOf="@+id/clContainer"
-            app:layout_constraintStart_toEndOf="@+id/ll_count"
-            app:layout_constraintBottom_toBottomOf="@+id/clContainer"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content">
-        </LinearLayout>
 
     </androidx.constraintlayout.widget.ConstraintLayout>