honghengqiang 3 年之前
父節點
當前提交
f81f2a009d

二進制
app/debug/com.swago.app-debug-1.0.8.6.apk


+ 0 - 18
app/debug/output-metadata.json

@@ -1,18 +0,0 @@
-{
-  "version": 2,
-  "artifactType": {
-    "type": "APK",
-    "kind": "Directory"
-  },
-  "applicationId": "com.swago.app",
-  "variantName": "debug",
-  "elements": [
-    {
-      "type": "SINGLE",
-      "filters": [],
-      "versionCode": 1086,
-      "versionName": "1.0.8.6",
-      "outputFile": "com.swago.app-debug-1.0.8.6.apk"
-    }
-  ]
-}

+ 31 - 16
room/src/main/java/com/swago/room/giftdandao/GiftDanDaoView.kt

@@ -25,27 +25,27 @@ import com.swago.room.databinding.ViewItemGiftBinding
 class GiftDanDaoView : FrameLayout {
 
     var isBusy = false
-    private var binding : ViewItemGiftBinding? = null
+    private var binding: ViewItemGiftBinding? = null
 
 
-    var imCurrentGiftModel:IMGiftModel? = null
+    var imCurrentGiftModel: IMGiftModel? = null
 
-    constructor(context: Context) : super(context){
+    constructor(context: Context) : super(context) {
         initView(context)
     }
 
-    constructor(context: Context, mAttributeSet: AttributeSet?) : super(context, mAttributeSet){
+    constructor(context: Context, mAttributeSet: AttributeSet?) : super(context, mAttributeSet) {
         initView(context)
     }
 
-    private var vibrator:Vibrator? = null
+    private var vibrator: Vibrator? = null
 
     private fun initView(context: Context) {
         vibrator = context.getSystemService(Service.VIBRATOR_SERVICE) as Vibrator
         binding = ViewItemGiftBinding.inflate(LayoutInflater.from(context), this, true)
     }
 
-    fun addData(imGiftModel: IMGiftModel){
+    fun addData(imGiftModel: IMGiftModel) {
         isBusy = true
         binding?.apply {
             Glide.with(ivAvatar.context)
@@ -60,12 +60,20 @@ class GiftDanDaoView : FrameLayout {
                 .into(ivGiftIcon)
 
             tvSenderName.text = imGiftModel.senderName
-            tvSenderTo.text = AppContext.getContext().resources.getString(R.string.send_to).format(imGiftModel.receiverName)
+            if (!tvSenderName.isSelected) {
+                tvSenderName.isSelected = true
+            }
+
+            tvSenderTo.text = AppContext.getContext().resources.getString(R.string.send_to)
+                .format(imGiftModel.receiverName)
+            if (!tvSenderTo.isSelected) {
+                tvSenderTo.isSelected = true
+            }
             tvNum.text = "x${imGiftModel.giftNum}"
             clItemGift.visibility = View.VISIBLE
-            if (imCurrentGiftModel!=null&&imGiftModel.isCombo==1){
+            if (imCurrentGiftModel != null && imGiftModel.isCombo == 1) {
 
-            }else{
+            } else {
                 //执行进场动画
                 giftEnterAnimator.start()
             }
@@ -73,9 +81,9 @@ class GiftDanDaoView : FrameLayout {
 
             clItemGift.removeCallbacks(showRunnable)
             clItemGift.postDelayed(showRunnable, 3000)
-            
-            if (imGiftModel.multiple!=0){
-                when(imGiftModel.multiple){
+
+            if (imGiftModel.multiple != 0) {
+                when (imGiftModel.multiple) {
                     in 1..100 -> {
                         iv.setImageResource(R.mipmap.win_100_prize)
                     }
@@ -91,7 +99,9 @@ class GiftDanDaoView : FrameLayout {
                     }
                 }
                 clWinPrize.visibility = View.VISIBLE
-                tvWinPrize.text = AppContext.getContext().resources.getString(R.string.win_num_prize).format(imGiftModel.multiple)
+                tvWinPrize.text =
+                    AppContext.getContext().resources.getString(R.string.win_num_prize)
+                        .format(imGiftModel.multiple)
                 clWinPrize.removeCallbacks(winPrizeRunnable)
                 clWinPrize.postDelayed(winPrizeRunnable, 1500)
             }
@@ -102,7 +112,12 @@ class GiftDanDaoView : FrameLayout {
 
 
     private val giftEnterAnimator by lazy {
-        val tx = ObjectAnimator.ofFloat(binding!!.clItemGift, "translationX", -binding!!.clItemGift.width.toFloat(), 0f)
+        val tx = ObjectAnimator.ofFloat(
+            binding!!.clItemGift,
+            "translationX",
+            -binding!!.clItemGift.width.toFloat(),
+            0f
+        )
         val ap = ObjectAnimator.ofFloat(binding!!.clItemGift, "alpha", 0.5f, 1f)
         tx.interpolator = DecelerateInterpolator()
         tx.duration = 400
@@ -127,7 +142,7 @@ class GiftDanDaoView : FrameLayout {
         Runnable {
             vibrator?.cancel()
             binding!!.clWinPrize.visibility = View.INVISIBLE
-            binding!!.tvWinPrize.text=""
+            binding!!.tvWinPrize.text = ""
         }
     }
 
@@ -135,7 +150,7 @@ class GiftDanDaoView : FrameLayout {
     fun clear() {
         vibrator?.cancel()
         isBusy = false
-        imCurrentGiftModel=null
+        imCurrentGiftModel = null
         binding?.apply {
             clWinPrize.visibility = View.INVISIBLE
             clItemGift.visibility = View.INVISIBLE

+ 6 - 2
room/src/main/res/layout/layout_user_header_view.xml

@@ -128,6 +128,8 @@
         android:layout_marginTop="10dp"
         android:paddingStart="8dp"
         android:paddingEnd="8dp"
+        android:paddingTop="2dp"
+        android:paddingBottom="2dp"
         android:background="@drawable/shape_20000000_41"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content">
@@ -147,7 +149,7 @@
             android:maxLines="1"
             android:gravity="center"
             android:layout_width="wrap_content"
-            android:layout_height="24dp"/>
+            android:layout_height="wrap_content"/>
 
     </LinearLayout>
 
@@ -161,6 +163,8 @@
         android:layout_marginTop="10dp"
         android:paddingStart="8dp"
         android:paddingEnd="8dp"
+        android:paddingTop="2dp"
+        android:paddingBottom="2dp"
         android:background="@drawable/shape_20000000_41"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content">
@@ -180,7 +184,7 @@
             android:maxLines="1"
             android:gravity="center"
             android:layout_width="wrap_content"
-            android:layout_height="24dp"/>
+            android:layout_height="wrap_content"/>
 
     </LinearLayout>
 

+ 9 - 5
room/src/main/res/layout/view_item_gift.xml

@@ -33,13 +33,15 @@
             android:textSize="14dp"
             android:textColor="#fff"
             android:text = "Swago"
-            android:maxWidth="80dp"
-            android:maxLines="1"
+            android:ellipsize="marquee"
+            android:marqueeRepeatLimit="marquee_forever"
+            android:scrollHorizontally="true"
+            android:singleLine="true"
             android:layout_marginStart="5dp"
             app:layout_constraintStart_toEndOf="@+id/ivAvatar"
             android:layout_marginTop="2dp"
             app:layout_constraintTop_toTopOf="parent"
-            android:layout_width="wrap_content"
+            android:layout_width="80dp"
             android:layout_height="wrap_content"/>
 
 
@@ -48,8 +50,10 @@
             android:textSize="11dp"
             android:textColor="#fff"
             tools:text="ddffdsf"
-            android:maxLines="1"
-            android:ellipsize="end"
+            android:ellipsize="marquee"
+            android:marqueeRepeatLimit="marquee_forever"
+            android:scrollHorizontally="true"
+            android:singleLine="true"
             android:layout_marginStart="5dp"
             app:layout_constraintStart_toEndOf="@+id/ivAvatar"
             android:layout_marginBottom="2dp"