Explorar el Código

feat: 头像框

tongmengxiao hace 4 meses
padre
commit
419ce5c3dd

BIN
baseswago/src/main/assets/avatar.svga


+ 2 - 0
baseswago/src/main/java/com/swago/baseswago/constant/UrlConstant.kt

@@ -91,4 +91,6 @@ object UrlConstant {
     var lottieResourcePath =
         AppContext.getContext().getExternalFilesDir("")?.absolutePath + File.separator + "lottie"
     var lottieDownloadUrl = ""
+    var specialResourcePath =
+        AppContext.getContext().getExternalFilesDir("")?.absolutePath + File.separator + "swagoFile"
 }

+ 3 - 0
baseswago/src/main/java/com/swago/baseswago/model/mine/StoreProductModel.kt

@@ -10,6 +10,7 @@ data class StoreProductModel(
 data class StoreItemBean (
     val product_name: String?,
     val product_url: String?,
+    val product_svg_url: String?,
     val product_category: Int,
     val product_coin: Long,
     val expire_at: Long,
@@ -17,6 +18,7 @@ data class StoreItemBean (
     var product_status: Int
 ) :Parcelable{
     constructor(parcel: Parcel) : this(
+        parcel.readString(),
         parcel.readString(),
         parcel.readString(),
         parcel.readInt(),
@@ -29,6 +31,7 @@ data class StoreItemBean (
     override fun writeToParcel(parcel: Parcel, flags: Int) {
         parcel.writeString(product_name)
         parcel.writeString(product_url)
+        parcel.writeString(product_svg_url)
         parcel.writeInt(product_category)
         parcel.writeLong(product_coin)
         parcel.writeLong(expire_at)

+ 33 - 2
baseswago/src/main/java/com/swago/baseswago/util/BitmapUtils.kt

@@ -8,6 +8,11 @@ import android.graphics.drawable.Drawable
 import com.bumptech.glide.Glide
 import com.bumptech.glide.request.target.CustomTarget
 import com.bumptech.glide.request.transition.Transition
+import com.swago.baseswago.constant.UrlConstant
+import com.swago.baseswago.inter.ApiManager
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
 import java.io.File
 import java.io.FileOutputStream
 import java.io.IOException
@@ -35,8 +40,7 @@ object BitmapUtils {
             .load(url)
             .into(object : CustomTarget<Bitmap>() {
                 override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
-                    val path = "${AppContext.getContext().getExternalFilesDir(null)!!.path}/swagoFile"
-                    val pathFile = File("$path/${url.substring(url.lastIndexOf("/"))}")
+                    val pathFile = File("${UrlConstant.specialResourcePath}/${url.substring(url.lastIndexOf("/"))}")
                     var outputStream: FileOutputStream? = null
                     try {
                         outputStream = FileOutputStream(pathFile)
@@ -54,4 +58,31 @@ object BitmapUtils {
                 }
             })
     }
+
+     fun downLoadLottie(downloadUrl: String, name: String) {
+         val pathFile = File(UrlConstant.specialResourcePath)
+         pathFile.mkdirs()
+        GlobalScope.launch {
+            try {
+                val responseBody = ApiManager.homeApi.downFile(downloadUrl)
+                dowload(AppContext.getContext(), responseBody) {
+                    hasSelfPath = {
+                        UrlConstant.specialResourcePath
+                    }
+                    setFileName = {
+                        File.separator + name
+                    }
+                    success {
+                        LogUtil.d("资源","下载成功")
+                    }
+                    error {
+                        LogUtil.d("资源","下载失败")
+                    }
+
+                }.startDowload()
+            } catch (e: Exception) {
+                LogUtil.d("资源","下载失败")
+            }
+        }
+    }
 }

+ 30 - 12
baseswago/src/main/res/layout/dialog_person_data.xml

@@ -340,15 +340,36 @@
 
         </androidx.constraintlayout.widget.ConstraintLayout>
 
-
-        <de.hdodenhof.circleimageview.CircleImageView
-            android:id="@+id/ivAvatar"
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/clAvatar"
             android:layout_width="80dp"
             android:layout_height="80dp"
-            android:src="@mipmap/default_avatar"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
+            app:layout_constraintTop_toTopOf="parent" >
+            <de.hdodenhof.circleimageview.CircleImageView
+                android:id="@+id/ivAvatar"
+                android:layout_width="60dp"
+                android:layout_height="60dp"
+                android:src="@mipmap/default_avatar"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintBottom_toBottomOf="parent"/>
+
+            <com.opensource.svgaplayer.SVGAImageView
+                android:id="@+id/svgAvatar"
+                android:layout_width="80dp"
+                android:layout_height="80dp"
+                android:visibility="visible"
+                app:source="avatar.svga"
+                app:autoPlay="true"
+                app:loopCount="0"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintBottom_toBottomOf="parent"/>
+        </androidx.constraintlayout.widget.ConstraintLayout>
 
         <ImageView
             android:id="@+id/ivSex"
@@ -357,8 +378,8 @@
             android:layout_marginStart="10dp"
             android:layout_marginTop="5dp"
             tools:src="@mipmap/info_female"
-            app:layout_constraintBottom_toBottomOf="@+id/ivAvatar"
-            app:layout_constraintEnd_toEndOf="@+id/ivAvatar" />
+            app:layout_constraintBottom_toBottomOf="@+id/clAvatar"
+            app:layout_constraintEnd_toEndOf="@+id/clAvatar" />
 
 
         <ImageView
@@ -367,13 +388,10 @@
             android:layout_height="wrap_content"
             android:src="@mipmap/onlive"
             android:visibility="gone"
-            app:layout_constraintBottom_toBottomOf="@+id/ivAvatar"
-            app:layout_constraintStart_toStartOf="@+id/ivAvatar"
+            app:layout_constraintBottom_toBottomOf="@+id/clAvatar"
+            app:layout_constraintStart_toStartOf="@+id/clAvatar"
             tools:visibility="visible" />
 
-
-
-
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 36 - 14
home/src/main/res/layout/fragment_mine.xml

@@ -19,7 +19,7 @@
         android:layout_marginEnd="16dp"
         android:src="@mipmap/bg_edit"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/ivAvatar" />
+        app:layout_constraintTop_toTopOf="@+id/clAvatar" />
 
     <com.swago.baseswago.cusview.MediumTextView
         android:id="@+id/tvEdit"
@@ -37,16 +37,38 @@
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/ivEditBg" />
 
-
-    <de.hdodenhof.circleimageview.CircleImageView
-        android:id="@+id/ivAvatar"
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/clAvatar"
         android:layout_width="50dp"
         android:layout_height="50dp"
         android:layout_marginStart="16dp"
         android:layout_marginTop="66dp"
-        android:src="@mipmap/default_avatar"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
+        app:layout_constraintTop_toTopOf="parent" >
+        <de.hdodenhof.circleimageview.CircleImageView
+            android:id="@+id/ivAvatar"
+            android:layout_width="40dp"
+            android:layout_height="40dp"
+            android:src="@mipmap/default_avatar"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"/>
+
+        <com.opensource.svgaplayer.SVGAImageView
+            android:id="@+id/svgAvatar"
+            android:layout_width="50dp"
+            android:layout_height="50dp"
+            android:visibility="visible"
+            app:source="avatar.svga"
+            app:autoPlay="true"
+            app:loopCount="0"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"/>
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
 
     <com.swago.baseswago.cusview.BoldTextView
         android:id="@+id/tvName"
@@ -57,8 +79,8 @@
         android:maxLines="1"
         android:textColor="#435568"
         android:textSize="20dp"
-        app:layout_constraintStart_toEndOf="@+id/ivAvatar"
-        app:layout_constraintTop_toTopOf="@+id/ivAvatar"
+        app:layout_constraintStart_toEndOf="@+id/clAvatar"
+        app:layout_constraintTop_toTopOf="@+id/clAvatar"
         tools:text="NickName" />
 
     <com.swago.baseswago.cusview.SwagoLevelView
@@ -145,8 +167,8 @@
         android:maxLines="1"
         android:textColor="#868686"
         android:textSize="12dp"
-        app:layout_constraintBottom_toBottomOf="@+id/ivAvatar"
-        app:layout_constraintStart_toEndOf="@+id/ivAvatar"
+        app:layout_constraintBottom_toBottomOf="@+id/clAvatar"
+        app:layout_constraintStart_toEndOf="@+id/clAvatar"
         tools:text="ID:12030747" />
 
 
@@ -160,7 +182,7 @@
         app:layout_constraintEnd_toStartOf="@+id/llFans"
         app:layout_constraintHorizontal_chainStyle="spread"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/ivAvatar">
+        app:layout_constraintTop_toBottomOf="@+id/clAvatar">
 
         <com.swago.baseswago.cusview.MediumTextView
             android:id="@+id/tvFollowNum"
@@ -189,7 +211,7 @@
         android:orientation="vertical"
         app:layout_constraintEnd_toStartOf="@+id/llCoin"
         app:layout_constraintStart_toEndOf="@+id/llFollow"
-        app:layout_constraintTop_toBottomOf="@+id/ivAvatar">
+        app:layout_constraintTop_toBottomOf="@+id/clAvatar">
 
         <com.swago.baseswago.cusview.MediumTextView
             android:id="@+id/tvFansNum"
@@ -218,7 +240,7 @@
         android:orientation="vertical"
         app:layout_constraintEnd_toStartOf="@+id/llDiamonds"
         app:layout_constraintStart_toEndOf="@+id/llFans"
-        app:layout_constraintTop_toBottomOf="@+id/ivAvatar">
+        app:layout_constraintTop_toBottomOf="@+id/clAvatar">
 
         <com.swago.baseswago.cusview.MediumTextView
             android:id="@+id/tvCoin"
@@ -247,7 +269,7 @@
         android:orientation="vertical"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toEndOf="@+id/llCoin"
-        app:layout_constraintTop_toBottomOf="@+id/ivAvatar">
+        app:layout_constraintTop_toBottomOf="@+id/clAvatar">
 
         <com.swago.baseswago.cusview.MediumTextView
             android:id="@+id/tvDiamonds"

+ 2 - 2
room/src/main/java/com/swago/room/adapter/RoomChatAdapter.kt

@@ -53,7 +53,7 @@ class RoomChatAdapter :
         BitmapUtils.getBitmapFromPath(UserInfo.getUserInfo()?.badge_special)
     }
     private val bubbleChat by lazy {
-        BitmapDrawable(mContext.resources , BitmapUtils.getBitmapFromPath(UserInfo.getUserInfo()?.badge_special))
+       BitmapUtils.getBitmapFromPath(UserInfo.getUserInfo()?.chat_special)
     }
     private val userid by lazy {
         UserInfo.getUserInfo()?.id
@@ -457,7 +457,7 @@ class RoomChatAdapter :
                 }
             }
             if (bubbleChat != null && item.getSenderId() == userid){
-                tvContent.background = bubbleChat
+                tvContent.background =  BitmapDrawable(mContext.resources , bubbleChat)
             }
             tvContent.movementMethod = LinkMovementMethod.getInstance()
             tvContent.highlightColor = Color.TRANSPARENT

+ 31 - 8
room/src/main/res/layout/item_audio_seat.xml

@@ -6,17 +6,40 @@
     tools:background="#000"
     xmlns:app="http://schemas.android.com/apk/res-auto">
 
-    <com.swago.baseswago.cusview.SwagoImageView
-        android:id="@+id/ivImageView"
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/clAvatar"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        android:layout_width="68dp"
-        android:layout_height="68dp"/>
+        app:layout_constraintTop_toTopOf="parent">
+        <com.swago.baseswago.cusview.SwagoImageView
+            android:id="@+id/ivImageView"
+            android:layout_width="68dp"
+            android:layout_height="68dp"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"/>
+
+        <com.opensource.svgaplayer.SVGAImageView
+            android:id="@+id/svgAvatar"
+            android:layout_width="68dp"
+            android:layout_height="68dp"
+            android:visibility="visible"
+            app:source="avatar.svga"
+            app:autoPlay="true"
+            app:loopCount="0"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"/>
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
 
     <ImageView
         android:id="@+id/ivAudioState"
-        app:layout_constraintEnd_toEndOf="@+id/ivImageView"
-        app:layout_constraintBottom_toBottomOf="@+id/ivImageView"
+        app:layout_constraintEnd_toEndOf="@+id/clAvatar"
+        app:layout_constraintBottom_toBottomOf="@+id/clAvatar"
         android:src="@mipmap/live_mute"
         android:visibility="invisible"
         tools:visibility="visible"
@@ -34,7 +57,7 @@
         android:ellipsize="end"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/ivImageView"
+        app:layout_constraintTop_toBottomOf="@+id/clAvatar"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
 

+ 34 - 9
room/src/main/res/layout/item_dialog_audience.xml

@@ -5,18 +5,43 @@
     xmlns:tools="http://schemas.android.com/tools"
     xmlns:app="http://schemas.android.com/apk/res-auto">
 
-    <de.hdodenhof.circleimageview.CircleImageView
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/clAvatar"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
-        android:layout_marginStart="16dp"
-        android:id="@+id/ivAvatar"
-        android:layout_width="50dp"
-        android:layout_height="50dp"/>
+        android:layout_marginStart="16dp">
+
+        <de.hdodenhof.circleimageview.CircleImageView
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            android:id="@+id/ivAvatar"
+            android:layout_width="40dp"
+            android:layout_height="40dp"/>
+
+        <com.opensource.svgaplayer.SVGAImageView
+            android:id="@+id/svgAvatar"
+            android:layout_width="50dp"
+            android:layout_height="50dp"
+            android:visibility="visible"
+            app:source="avatar.svga"
+            app:autoPlay="true"
+            app:loopCount="0"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"/>
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+
 
     <com.swago.baseswago.cusview.MediumTextView
         android:id="@+id/tvName"
-        app:layout_constraintStart_toEndOf="@+id/ivAvatar"
+        app:layout_constraintStart_toEndOf="@+id/clAvatar"
         android:layout_marginStart="8dp"
         android:layout_marginTop="4dp"
         android:textSize="18dp"
@@ -24,15 +49,15 @@
         tools:text="Chridfsfdsfdfs"
         android:maxLines="1"
         android:maxWidth="150dp"
-        app:layout_constraintTop_toTopOf="@+id/ivAvatar"
+        app:layout_constraintTop_toTopOf="@+id/clAvatar"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
 
     <com.swago.baseswago.cusview.SwagoLevelView
         android:id="@+id/tvLevel"
         android:layout_marginStart="8dp"
-        app:layout_constraintStart_toEndOf="@+id/ivAvatar"
-        app:layout_constraintBottom_toBottomOf="@+id/ivAvatar"
+        app:layout_constraintStart_toEndOf="@+id/clAvatar"
+        app:layout_constraintBottom_toBottomOf="@+id/clAvatar"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
 

+ 19 - 2
room/src/main/res/layout/item_room_user.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="40dp"
     android:layout_height="30dp">
 
@@ -7,7 +8,23 @@
         android:id="@+id/ivAvatar"
         android:layout_marginStart="5dp"
         android:layout_marginEnd="5dp"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"/>
+        android:layout_width="22dp"
+        android:layout_height="22dp"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"/>
 
+    <com.opensource.svgaplayer.SVGAImageView
+        android:id="@+id/svgAvatar"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
+        android:visibility="visible"
+        app:source="avatar.svga"
+        app:autoPlay="true"
+        app:loopCount="0"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"/>
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 31 - 8
room/src/main/res/layout/layout_user_header_view.xml

@@ -18,19 +18,42 @@
         android:background="@drawable/shape_20000000_41"
         android:layout_height="34dp">
 
-        <de.hdodenhof.circleimageview.CircleImageView
-            android:id="@+id/ivAvatar"
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/clAvatar"
+            android:layout_width="30dp"
+            android:layout_height="30dp"
             android:layout_marginStart="2dp"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent"
-            android:layout_width="30dp"
-            android:layout_height="30dp"/>
+            app:layout_constraintBottom_toBottomOf="parent">
+
+            <de.hdodenhof.circleimageview.CircleImageView
+                android:id="@+id/ivAvatar"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                android:layout_width="22dp"
+                android:layout_height="22dp"/>
+            <com.opensource.svgaplayer.SVGAImageView
+                android:id="@+id/svgAvatar"
+                android:layout_width="30dp"
+                android:layout_height="30dp"
+                android:visibility="visible"
+                app:source="avatar.svga"
+                app:autoPlay="true"
+                app:loopCount="0"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintBottom_toBottomOf="parent"/>
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
 
         <LinearLayout
             android:id="@+id/ll"
             android:orientation="vertical"
-            app:layout_constraintStart_toEndOf="@+id/ivAvatar"
+            app:layout_constraintStart_toEndOf="@+id/clAvatar"
             android:layout_width="wrap_content"
             android:layout_height="match_parent">
 
@@ -45,7 +68,7 @@
                 android:maxLines="1"
                 android:maxWidth="120dp"
                 app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toEndOf="@+id/ivAvatar"
+                app:layout_constraintStart_toEndOf="@+id/clAvatar"
                 tools:text="NickNamed"
                 app:layout_constraintHorizontal_bias="0"
                 android:layout_width="wrap_content"
@@ -61,7 +84,7 @@
                 android:layout_marginEnd="8dp"
                 android:maxWidth="120dp"
                 app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toEndOf="@+id/ivAvatar"
+                app:layout_constraintStart_toEndOf="@+id/clAvatar"
                 app:layout_constraintHorizontal_bias="0"
                 tools:text="ID:dddddddddd"
                 android:maxLines="1"

BIN
user/src/main/assets/jojo_audio.svga


+ 2 - 14
user/src/main/java/com/swago/user/store/StoreBuyDialog.kt

@@ -48,7 +48,8 @@ class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
         storeBean?.let {
             binding.tvName.text = it.product_name
             binding.tvCoin.text = "${it.product_coin}"
-//            binding.ivIcon.loadUrl(AppContext.getContext(),it.product_url?:"")
+            binding.ivIcon.visibility = if (it.product_url?.endsWith("svga") == true) View.GONE else View.VISIBLE
+            binding.ivIcon.loadUrl(AppContext.getContext(),it.product_url?:"")
             svgaParser?.let { svgaParser ->
                 svgaParser.decodeFromURL(URL(it.product_url), object : SVGAParser.ParseCompletion{
                     override fun onComplete(videoItem: SVGAVideoEntity) {
@@ -64,19 +65,6 @@ class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
 
             }
         }
-        svgaParser?.let {
-            it.decodeFromAssets("jojo_audio.svga",object : SVGAParser.ParseCompletion{
-                override fun onComplete(videoItem: SVGAVideoEntity) {
-                    val drawable = SVGADrawable(videoItem)
-                    binding.svgContent.setImageDrawable(drawable)
-                    binding.svgContent.startAnimation()
-                }
-
-                override fun onError() {
-
-                }
-            })
-        }
     }
 
     override fun initLiveData() {

+ 4 - 4
user/src/main/java/com/swago/user/store/StoreListActivity.kt

@@ -222,6 +222,7 @@ class StoreListActivity : BaseXActivity<ActivityStoreListBinding>() {
         binding.clEnterMore.setOnClickListener {
             if (type == 2)
                 return@setOnClickListener
+            isEnterExpanded = !isEnterExpanded
             if (isEnterExpanded) {
                 enterAdapter.setNewData(enterList)
                 binding.tvEnterMore.text = "Show Less"
@@ -231,12 +232,12 @@ class StoreListActivity : BaseXActivity<ActivityStoreListBinding>() {
                 binding.tvEnterMore.text = "Show More"
                 binding.ivEnterMore.setImageResource(R.mipmap.ic_show_more)
             }
-            isEnterExpanded = !isEnterExpanded
         }
 
         binding.clAvatarMore.setOnClickListener {
             if (type == 2)
                 return@setOnClickListener
+            isAvatarExpanded = !isAvatarExpanded
             if (isAvatarExpanded) {
                 avatarAdapter.setNewData(avatarList)
                 binding.tvAvatarMore.text = "Show Less"
@@ -246,12 +247,12 @@ class StoreListActivity : BaseXActivity<ActivityStoreListBinding>() {
                 binding.tvAvatarMore.text = "Show More"
                 binding.ivAvatarMore.setImageResource(R.mipmap.ic_show_more)
             }
-            isAvatarExpanded = !isAvatarExpanded
         }
 
         binding.clBadgeMore.setOnClickListener {
             if (type == 2)
                 return@setOnClickListener
+            isBadgeExpanded = !isBadgeExpanded
             if (isBadgeExpanded) {
                 badgeAdapter.setNewData(badgeList)
                 binding.tvBadgeMore.text = "Show Less"
@@ -261,12 +262,12 @@ class StoreListActivity : BaseXActivity<ActivityStoreListBinding>() {
                 binding.tvBadgeMore.text = "Show More"
                 binding.ivBadgeMore.setImageResource(R.mipmap.ic_show_more)
             }
-            isBadgeExpanded = !isBadgeExpanded
         }
 
         binding.clBubbleMore.setOnClickListener {
             if (type == 2)
                 return@setOnClickListener
+            isBubbleExpanded = !isBubbleExpanded
             if (isBubbleExpanded) {
                 bubbleAdapter.setNewData(bubbleList)
                 binding.tvBubbleMore.text = "Show Less"
@@ -276,7 +277,6 @@ class StoreListActivity : BaseXActivity<ActivityStoreListBinding>() {
                 binding.tvBubbleMore.text = "Show More"
                 binding.ivBubbleMore.setImageResource(R.mipmap.ic_show_more)
             }
-            isBubbleExpanded = !isBubbleExpanded
         }
         enterAdapter.setOnItemClickListener { _, _, position ->
             if (type == 1){

+ 1 - 0
user/src/main/res/layout/dialog_store_detail.xml

@@ -40,6 +40,7 @@
                 android:maxWidth="120dp"
                 android:textColor="#ffffff"
                 android:textSize="16sp"
+                android:layout_marginTop="@dimen/dp_4"
                 app:layout_constraintEnd_toEndOf="parent"
                 app:layout_constraintStart_toStartOf="parent"
                 app:layout_constraintTop_toBottomOf="@+id/ivIcon"