1
0

7 کامیت‌ها 85e5f5556f ... fb64531e2b

نویسنده SHA1 پیام تاریخ
  tongmengxiao fb64531e2b feat: 商城 装扮api 6 ماه پیش
  tongmengxiao 5fa042159f feat: version 6115 6 ماه پیش
  tongmengxiao 6ef61d92a1 feat: unzip 6 ماه پیش
  tongmengxiao 86bf774852 feat: 美颜参数 6 ماه پیش
  tongmengxiao b2336887ce feat: 本地化 6 ماه پیش
  tongmengxiao ff6bdcd436 feat: 私信个人信息&mine scoll 6 ماه پیش
  tongmengxiao 9e6e94462e feat: 直播音乐 6 ماه پیش
47فایلهای تغییر یافته به همراه1595 افزوده شده و 477 حذف شده
  1. 2 2
      app/build.gradle
  2. 2 0
      app/src/main/java/com/swago/app/SwagoApp.kt
  3. 1 0
      baseswago/build.gradle
  4. 10 0
      baseswago/src/main/java/com/swago/baseswago/inter/UserApi.kt
  5. 50 0
      baseswago/src/main/java/com/swago/baseswago/model/mine/StoreProductModel.kt
  6. 45 0
      baseswago/src/main/java/com/swago/baseswago/util/FileUtil.kt
  7. 1 1
      baseswago/src/main/java/com/swago/baseswago/util/SwagoInfo.kt
  8. 5 0
      baseswago/src/main/res/drawable/shape_8c25cb_top_bottom_one_4.xml
  9. 9 0
      baseswago/src/main/res/values-ar/strings.xml
  10. 9 0
      baseswago/src/main/res/values-in/strings.xml
  11. 9 1
      baseswago/src/main/res/values-ms/strings.xml
  12. 9 0
      baseswago/src/main/res/values-zh/strings.xml
  13. 9 0
      baseswago/src/main/res/values/strings.xml
  14. 1 0
      build.gradle
  15. 19 6
      home/src/main/java/com/swago/home/ChatDetailActivity.kt
  16. 2 2
      home/src/main/java/com/swago/home/MineFragment.kt
  17. 109 97
      home/src/main/res/layout/fragment_mine.xml
  18. 6 1
      room/build.gradle
  19. BIN
      room/src/main/assets/music.svga
  20. 3 3
      room/src/main/java/com/swago/room/anchor/AnchorRoomActivity.kt
  21. 10 0
      room/src/main/java/com/swago/room/database/DBHelper.kt
  22. 18 0
      room/src/main/java/com/swago/room/database/DBManager.kt
  23. 96 0
      room/src/main/java/com/swago/room/database/DaoMaster.java
  24. 48 0
      room/src/main/java/com/swago/room/database/DaoSession.java
  25. 153 0
      room/src/main/java/com/swago/room/database/MusicModelDao.java
  26. 18 5
      room/src/main/java/com/swago/room/music/LocalMusicActivity.kt
  27. 3 3
      room/src/main/java/com/swago/room/music/LocalMusicAdapter.kt
  28. 137 0
      room/src/main/java/com/swago/room/music/MusicModel.java
  29. 0 44
      room/src/main/java/com/swago/room/music/MusicModel.kt
  30. 1 15
      room/src/main/java/com/swago/room/music/MusicVm.kt
  31. 12 3
      room/src/main/java/com/swago/room/music/MyMusicAdapter.kt
  32. 84 71
      room/src/main/java/com/swago/room/music/MyMusicDialog.kt
  33. 50 45
      room/src/main/res/layout/activity_anchor_room.xml
  34. 2 2
      room/src/main/res/layout/activity_local_music.xml
  35. 64 36
      room/src/main/res/layout/dialog_my_music.xml
  36. 2 1
      room/src/main/res/layout/item_my_music.xml
  37. BIN
      room/src/main/res/mipmap-xxhdpi/beauty_filter.png
  38. 23 8
      user/src/main/java/com/swago/user/store/StoreBuyDialog.kt
  39. 14 3
      user/src/main/java/com/swago/user/store/StoreItemAdapter.kt
  40. 244 14
      user/src/main/java/com/swago/user/store/StoreListActivity.kt
  41. 0 6
      user/src/main/java/com/swago/user/store/StoreListBean.kt
  42. 0 39
      user/src/main/java/com/swago/user/store/StoreTypeAdapter.kt
  43. 54 0
      user/src/main/java/com/swago/user/vm/StoreVm.kt
  44. 247 10
      user/src/main/res/layout/activity_store_list.xml
  45. 2 1
      user/src/main/res/layout/dialog_store_detail.xml
  46. 12 1
      user/src/main/res/layout/item_store.xml
  47. 0 57
      user/src/main/res/layout/item_type_store.xml

+ 2 - 2
app/build.gradle

@@ -15,8 +15,8 @@ android {
         applicationId "com.swago.app"
         minSdkVersion 21
         targetSdkVersion 33
-        versionCode 6114
-        versionName "6.1.1.4"
+        versionCode 6115
+        versionName "6.1.1.5"
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 

+ 2 - 0
app/src/main/java/com/swago/app/SwagoApp.kt

@@ -20,6 +20,7 @@ import com.swago.baseswago.util.SwagoInfo
 import com.swago.baseswago.util.UserInfo
 import com.swago.lib_beauty.FuBeautyManager
 import com.swago.lib_beauty.IOperateCallback
+import com.swago.room.database.DBManager
 import com.tencent.qcloud.tim.uikit.TUIKit
 import com.tencent.qcloud.tim.uikit.TUIKitImpl
 import com.tencent.qcloud.tim.uikit.base.IMEventListener
@@ -39,6 +40,7 @@ class SwagoApp : Application() {
     override fun onCreate() {
         super.onCreate()
         AppContext.setContext(this)
+        DBManager.init(this)
         if (BuildConfig.DEBUG) {
             ARouter.openLog()
             ARouter.openDebug()

+ 1 - 0
baseswago/build.gradle

@@ -135,5 +135,6 @@ dependencies {
     api 'com.duolingo.open:rtl-viewpager:2.0.0'
     //lottie
     api 'com.airbnb.android:lottie:4.0.0'
+    api  'org.greenrobot:greendao:3.3.0' // 添加库
 
 }

+ 10 - 0
baseswago/src/main/java/com/swago/baseswago/inter/UserApi.kt

@@ -156,4 +156,14 @@ interface UserApi {
     @POST("/v1/user/accept/bind")
     suspend fun acceptBind(@Field("log_id")log_id:Int, @Field("bind_type")bind_type:Int, @Field("broadcast_level")broadcast_level:Int):Any
 
+    //商城列表
+    @POST("/v1/user/coin/product/list")
+    suspend fun getProductList(): StoreProductModel
+
+    @FormUrlEncoded
+    @POST("/v1/user/buy/product")
+    suspend fun buyProduct(@Field("product_id") product_id: Long):Any
+
+    @POST("/v1/user/exist/product/list")
+    suspend fun exitProductList():StoreProductModel
 }

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

@@ -0,0 +1,50 @@
+package com.swago.baseswago.model.mine
+
+import android.os.Parcel
+import android.os.Parcelable
+
+data class StoreProductModel(
+    val list: List<StoreItemBean>?
+)
+
+data class StoreItemBean (
+    val product_name: String?,
+    val product_url: String?,
+    val product_category: Int,
+    val product_coin: Long,
+    val id: Long,
+    val product_status: Int
+) :Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readInt(),
+        parcel.readLong(),
+        parcel.readLong(),
+        parcel.readInt()
+    )
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(product_name)
+        parcel.writeString(product_url)
+        parcel.writeInt(product_category)
+        parcel.writeLong(product_coin)
+        parcel.writeLong(id)
+        parcel.writeInt(product_status)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<StoreItemBean> {
+        override fun createFromParcel(parcel: Parcel): StoreItemBean {
+            return StoreItemBean(parcel)
+        }
+
+        override fun newArray(size: Int): Array<StoreItemBean?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 45 - 0
baseswago/src/main/java/com/swago/baseswago/util/FileUtil.kt

@@ -6,6 +6,7 @@ import java.lang.Exception
 import java.util.*
 import java.util.zip.ZipEntry
 import java.util.zip.ZipFile
+import java.util.zip.ZipInputStream
 
 /**
  *@date 2022/2/12 11:44
@@ -80,7 +81,51 @@ object FileUtil {
 
 
     }
+    fun upZipFile(zipInputStream: InputStream, zipUpPath: String) {
+        val buf = ByteArray(1024)
+        val zis = ZipInputStream(BufferedInputStream(zipInputStream))
 
+        try {
+            val zipUpFile = File(zipUpPath)
+            if (!zipUpFile.exists()) {
+                zipUpFile.mkdirs()
+            }
+
+            var ze: ZipEntry? = zis.nextEntry
+            while (ze != null) {
+                if (ze.isDirectory) {
+                    val tempPath = ze.name
+                    var dirstr = zipUpPath + tempPath
+                    dirstr = String(dirstr.toByteArray(charset("8859_1")))
+                    val f = File(dirstr)
+                    f.mkdir()
+                } else {
+                    val tempPath = ze.name
+                    val os: OutputStream = BufferedOutputStream(FileOutputStream(getRealFileName(zipUpPath, tempPath)))
+                    var readLen: Int
+                    try {
+                        while (zis.read(buf).also { readLen = it } != -1) {
+                            os.write(buf, 0, readLen)
+                        }
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                    } finally {
+                        try {
+                            os.close()
+                        } catch (e: IOException) {
+                            e.printStackTrace()
+                        }
+                    }
+                }
+                ze = zis.nextEntry
+            }
+            zis.closeEntry()
+            zis.close()
+            zipInputStream.close()
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    }
 
     private fun getRealFileName(baseDir: String, absFileName: String): File {
         val dirs = absFileName.split("/").toTypedArray()

+ 1 - 1
baseswago/src/main/java/com/swago/baseswago/util/SwagoInfo.kt

@@ -14,7 +14,7 @@ import java.util.*
  *description:
  */
 object SwagoInfo {
-    var key = "bGtobGtqc3V0Z3JnaGtzamRxeWxrb3NoZ2R0YmZnZGU="
+    var key = "bGtobGtqc3NoYWtkaXNiZGRxeWxrb3NoZ2R0YmZnZGU="
     private var versionCode = ""
     private var languageCode = "en"
     var languageId = 0

+ 5 - 0
baseswago/src/main/res/drawable/shape_8c25cb_top_bottom_one_4.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#8C25CB"/>
+    <corners android:topLeftRadius="4dp"  android:bottomRightRadius="4dp"/>
+</shape>

+ 9 - 0
baseswago/src/main/res/values-ar/strings.xml

@@ -331,4 +331,13 @@
     <string name="Password_rooms_do_not_count_as_hours">أوقات غرفة القفل لم يتم احتسابها في المدة</string>
     <string name="clear_cache">مسح ذاكرة التخزين المؤقت</string>
     <string name="clear_cache_success">مسح ذاكرة التخزين المؤقت بنجاح</string>
+    <string name="my_music">موسيقاي</string>
+    <string name="add_music">إضافة الموسيقى</string>
+    <string name="select_all">اختر الكل</string>
+    <string name="add_to_my_music">أضف إلى موسيقاي</string>
+    <string name="sure_delete_this_music">هل أنت متأكد أنك تريد حذف هذه الموسيقى؟</string>
+    <string name="dress_up">إرتد ملابس</string>
+    <string name="mall">مجمع تجاري</string>
+    <string name="buy_it_now">اشتر الآن</string>
+    <string name="beauty_filter">الجمال والمرشحات</string>
 </resources>

+ 9 - 0
baseswago/src/main/res/values-in/strings.xml

@@ -343,4 +343,13 @@
     <string name="Password_rooms_do_not_count_as_hours">Ruang kata sandi tidak tambah durasi</string>
     <string name="clear_cache">Bersihkan cache</string>
     <string name="clear_cache_success">Hapus sukses</string>
+    <string name="my_music">Musik Saya</string>
+    <string name="add_music">Tambahkan musik</string>
+    <string name="select_all">Pilih semua</string>
+    <string name="add_to_my_music">Tambahkan ke musik saya</string>
+    <string name="sure_delete_this_music">Anda yakin ingin menghapus musik ini?</string>
+    <string name="dress_up">Berpakaian</string>
+    <string name="mall">Toko</string>
+    <string name="buy_it_now">Beli sekarang</string>
+    <string name="beauty_filter">kecantikan&amp;filter</string>
 </resources>

+ 9 - 1
baseswago/src/main/res/values-ms/strings.xml

@@ -343,5 +343,13 @@
     <string name="Password_rooms_do_not_count_as_hours">Ruang kata sandi tidak tambah durasi</string>
     <string name="clear_cache">Bersihkan cache</string>
     <string name="clear_cache_success">Hapus sukses</string>
-
+    <string name="my_music">Musik Saya</string>
+    <string name="add_music">Tambahkan musik</string>
+    <string name="select_all">Pilih semua</string>
+    <string name="add_to_my_music">Tambahkan ke musik saya</string>
+    <string name="sure_delete_this_music">Anda yakin ingin menghapus musik ini?</string>
+    <string name="dress_up">Berpakaian</string>
+    <string name="mall">Toko</string>
+    <string name="buy_it_now">Beli sekarang</string>
+    <string name="beauty_filter">kecantikan&amp;filter</string>
 </resources>

+ 9 - 0
baseswago/src/main/res/values-zh/strings.xml

@@ -331,4 +331,13 @@
     <string name="Password_rooms_do_not_count_as_hours">密码房不计入时长</string>
     <string name="clear_cache">清除缓存</string>
     <string name="clear_cache_success">清除成功</string>
+    <string name="my_music">我的音乐</string>
+    <string name="add_music">添加音乐</string>
+    <string name="select_all">全选</string>
+    <string name="add_to_my_music">添加到我的音乐</string>
+    <string name="sure_delete_this_music">您确定要删除这段音乐吗?</string>
+    <string name="dress_up">装扮</string>
+    <string name="mall">商城</string>
+    <string name="buy_it_now">立即购买</string>
+    <string name="beauty_filter">美颜&amp;滤镜</string>
 </resources>

+ 9 - 0
baseswago/src/main/res/values/strings.xml

@@ -363,4 +363,13 @@
     <string name="Password_rooms_do_not_count_as_hours">Lock room times didn\'t count into</string>
     <string name="clear_cache">clear cache</string>
     <string name="clear_cache_success">Clearance successful</string>
+    <string name="my_music">My music</string>
+    <string name="add_music">Add music</string>
+    <string name="select_all">Select all</string>
+    <string name="add_to_my_music">Add to my music</string>
+    <string name="sure_delete_this_music">Are you sure you want to delete this music?</string>
+    <string name="dress_up">Dress up</string>
+    <string name="mall">Mall</string>
+    <string name="buy_it_now">Buy it now</string>
+    <string name="beauty_filter">beauty&amp;filter</string>
 </resources>

+ 1 - 0
build.gradle

@@ -23,6 +23,7 @@ buildscript {
         classpath 'com.google.gms:google-services:4.3.10'
         classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
         classpath 'com.google.firebase:perf-plugin:1.4.1'
+        classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0' // 添加插件 更好支持GreenDao
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
     }

+ 19 - 6
home/src/main/java/com/swago/home/ChatDetailActivity.kt

@@ -88,12 +88,25 @@ class ChatDetailActivity  : BaseXActivity<ActivityChatDetailBinding>() {
             }
 
             override fun onUserIconClick(view: View?, position: Int, messageInfo: MessageInfo?) {
-                UserInfo.getUserInfo()?.let {
-                    PersonDataDFragment.newInstance(it.id,
-                        isAnchor = false,
-                        inRoom = false,
-                        isMessage = true
-                    ).show(supportFragmentManager,"PersonDataDFragment")
+                when(view?.id){
+                    R.id.left_user_icon_view ->{
+                        messageInfo?.let {
+                            PersonDataDFragment.newInstance(messageInfo.fromUser,
+                                isAnchor = false,
+                                inRoom = false,
+                                isMessage = true
+                            ).show(supportFragmentManager,"PersonDataDFragment")
+                        }
+                    }
+                    R.id.right_user_icon_view ->{
+                        UserInfo.getUserInfo()?.let {
+                            PersonDataDFragment.newInstance(it.id,
+                                isAnchor = false,
+                                inRoom = false,
+                                isMessage = true
+                            ).show(supportFragmentManager,"PersonDataDFragment")
+                        }
+                    }
                 }
             }
         })

+ 2 - 2
home/src/main/java/com/swago/home/MineFragment.kt

@@ -158,13 +158,13 @@ class MineFragment : BaseXFragment<FragmentMineBinding>() {
 
         binding.tvXStore.setOnClickListener(object :NoDoubleClickListener(){
             override fun onClick() {
-                ARouter.getInstance().build(ARouteConstant.User.storeList).navigation()
+                ARouter.getInstance().build(ARouteConstant.User.storeList).withInt("type",1).navigation()
             }
         })
 
         binding.tvXoutfit.setOnClickListener(object :NoDoubleClickListener(){
             override fun onClick() {
-                ARouter.getInstance().build(ARouteConstant.User.storeList).navigation()
+                ARouter.getInstance().build(ARouteConstant.User.storeList).withInt("type",2).navigation()
             }
         })
 

+ 109 - 97
home/src/main/res/layout/fragment_mine.xml

@@ -286,6 +286,7 @@
             android:text="@string/level"
             android:textColor="#131B23"
             android:textSize="12dp"
+            android:gravity="center"
             android:layout_marginTop="12dp"
             app:layout_constraintEnd_toStartOf="@+id/tvXTopUp"
             app:layout_constraintStart_toStartOf="parent"
@@ -300,6 +301,7 @@
             android:text="@string/top_up"
             android:textColor="#131B23"
             android:textSize="12dp"
+            android:gravity="center"
             android:layout_marginTop="12dp"
             app:layout_constraintEnd_toStartOf="@+id/tvXWithdrawal"
             app:layout_constraintStart_toEndOf="@+id/tvXLevel"
@@ -314,6 +316,7 @@
             android:text="@string/withdrawal"
             android:textColor="#131B23"
             android:textSize="12dp"
+            android:gravity="center"
             android:layout_marginTop="12dp"
             android:visibility="gone"
             app:layout_constraintEnd_toStartOf="@+id/tvXTaskCenter"
@@ -329,6 +332,7 @@
             android:text="@string/task_center"
             android:textColor="#131B23"
             android:textSize="12dp"
+            android:gravity="center"
             android:layout_marginTop="12dp"
             app:layout_constraintStart_toEndOf="@+id/tvXWithdrawal"
             app:layout_constraintEnd_toStartOf="@+id/tvXStore"
@@ -340,10 +344,11 @@
             android:layout_height="wrap_content"
             android:drawableTop="@mipmap/icon_my_store"
             android:drawablePadding="2dp"
-            android:text="@string/task_center"
+            android:text="@string/mall"
             android:textColor="#131B23"
             android:textSize="12dp"
             android:layout_marginTop="12dp"
+            android:gravity="center"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toEndOf="@+id/tvXTaskCenter"
             app:layout_constraintTop_toTopOf="parent" />
@@ -354,9 +359,10 @@
             android:layout_height="wrap_content"
             android:drawableTop="@mipmap/icon_my_outfit"
             android:drawablePadding="2dp"
-            android:text="@string/level"
+            android:text="@string/dress_up"
             android:textColor="#131B23"
             android:textSize="12dp"
+            android:gravity="center"
             android:layout_marginTop="12dp"
             android:layout_marginBottom="12dp"
             app:layout_constraintBottom_toBottomOf="parent"
@@ -366,107 +372,113 @@
 
     </androidx.constraintlayout.widget.ConstraintLayout>
 
-
-    <LinearLayout
+    <ScrollView
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        android:layout_marginTop="20dp"
-        android:orientation="vertical"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/frameLayout">
-
-        <com.swago.baseswago.cusview.MediumTextView
-            android:id="@+id/tvBlackList"
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:drawableStart="@mipmap/icon_mine_black"
-            android:drawableEnd="@mipmap/more_small"
-            android:drawablePadding="5dp"
-            android:gravity="center_vertical"
-            android:paddingStart="20dp"
-            android:paddingEnd="20dp"
-            android:text="@string/blacklist"
-            android:textColor="#000"
-            android:textSize="16dp" />
+            android:layout_height="0dp"
+            android:layout_marginTop="20dp"
+            android:orientation="vertical">
+
+            <com.swago.baseswago.cusview.MediumTextView
+                android:id="@+id/tvBlackList"
+                android:layout_width="match_parent"
+                android:layout_height="50dp"
+                android:drawableStart="@mipmap/icon_mine_black"
+                android:drawableEnd="@mipmap/more_small"
+                android:drawablePadding="5dp"
+                android:gravity="center_vertical"
+                android:paddingStart="20dp"
+                android:paddingEnd="20dp"
+                android:text="@string/blacklist"
+                android:textColor="#000"
+                android:textSize="16dp" />
+
+
+            <com.swago.baseswago.cusview.MediumTextView
+                android:id="@+id/tvRoomManager"
+                android:layout_width="match_parent"
+                android:layout_height="50dp"
+                android:visibility="gone"
+                tools:visibility="visible"
+                android:drawableStart="@mipmap/icon_mine_room_manager"
+                android:drawableEnd="@mipmap/more_small"
+                android:drawablePadding="5dp"
+                android:gravity="center_vertical"
+                android:paddingStart="20dp"
+                android:paddingEnd="20dp"
+                android:text="@string/room_manager"
+                android:textColor="#000"
+                android:textSize="16dp" />
+
+            <com.swago.baseswago.cusview.MediumTextView
+                android:id="@+id/tvCustomService"
+                android:layout_width="match_parent"
+                android:layout_height="50dp"
+                android:drawableStart="@mipmap/icon_mine_custom"
+                android:drawableEnd="@mipmap/more_small"
+                android:drawablePadding="5dp"
+                android:gravity="center_vertical"
+                android:paddingStart="20dp"
+                android:paddingEnd="20dp"
+                android:text="@string/contact_service"
+                android:textColor="#000"
+                android:textSize="16dp" />
+
+            <com.swago.baseswago.cusview.MediumTextView
+                android:id="@+id/tvFamily"
+                android:layout_width="match_parent"
+                android:layout_height="50dp"
+                android:drawableStart="@mipmap/icon_family"
+                android:drawableEnd="@mipmap/more_small"
+                android:drawablePadding="5dp"
+                android:gravity="center_vertical"
+                android:paddingStart="20dp"
+                android:paddingEnd="20dp"
+                android:visibility="gone"
+                tools:visibility="visible"
+                android:text="@string/family_menu"
+                android:textColor="#000"
+                android:textSize="16dp" />
+
+            <com.swago.baseswago.cusview.MediumTextView
+                android:id="@+id/tvModifyPassword"
+                android:layout_width="match_parent"
+                android:layout_height="50dp"
+                android:drawableStart="@mipmap/ic_modify_pwd"
+                android:drawableEnd="@mipmap/more_small"
+                android:drawablePadding="5dp"
+                android:gravity="center_vertical"
+                android:paddingStart="20dp"
+                android:paddingEnd="20dp"
+                android:text="@string/change_password"
+                android:visibility="gone"
+                tools:visibility="visible"
+                android:textColor="#000"
+                android:textSize="16dp" />
+
+            <com.swago.baseswago.cusview.MediumTextView
+                android:id="@+id/tvSetting"
+                android:layout_width="match_parent"
+                android:layout_height="50dp"
+                android:drawableStart="@mipmap/icon_mine_setting"
+                android:drawableEnd="@mipmap/more_small"
+                android:drawablePadding="5dp"
+                android:gravity="center_vertical"
+                android:paddingStart="20dp"
+                android:paddingEnd="20dp"
+                android:layout_marginBottom="10dp"
+                android:text="@string/app_settings"
+                android:textColor="#000"
+                android:textSize="16dp" />
+
+
+        </LinearLayout>
+    </ScrollView>
 
 
-        <com.swago.baseswago.cusview.MediumTextView
-            android:id="@+id/tvRoomManager"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:visibility="gone"
-            tools:visibility="visible"
-            android:drawableStart="@mipmap/icon_mine_room_manager"
-            android:drawableEnd="@mipmap/more_small"
-            android:drawablePadding="5dp"
-            android:gravity="center_vertical"
-            android:paddingStart="20dp"
-            android:paddingEnd="20dp"
-            android:text="@string/room_manager"
-            android:textColor="#000"
-            android:textSize="16dp" />
-
-        <com.swago.baseswago.cusview.MediumTextView
-            android:id="@+id/tvCustomService"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:drawableStart="@mipmap/icon_mine_custom"
-            android:drawableEnd="@mipmap/more_small"
-            android:drawablePadding="5dp"
-            android:gravity="center_vertical"
-            android:paddingStart="20dp"
-            android:paddingEnd="20dp"
-            android:text="@string/contact_service"
-            android:textColor="#000"
-            android:textSize="16dp" />
-
-        <com.swago.baseswago.cusview.MediumTextView
-            android:id="@+id/tvFamily"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:drawableStart="@mipmap/icon_family"
-            android:drawableEnd="@mipmap/more_small"
-            android:drawablePadding="5dp"
-            android:gravity="center_vertical"
-            android:paddingStart="20dp"
-            android:paddingEnd="20dp"
-            android:visibility="gone"
-            tools:visibility="visible"
-            android:text="@string/family_menu"
-            android:textColor="#000"
-            android:textSize="16dp" />
-
-        <com.swago.baseswago.cusview.MediumTextView
-            android:id="@+id/tvModifyPassword"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:drawableStart="@mipmap/ic_modify_pwd"
-            android:drawableEnd="@mipmap/more_small"
-            android:drawablePadding="5dp"
-            android:gravity="center_vertical"
-            android:paddingStart="20dp"
-            android:paddingEnd="20dp"
-            android:text="@string/change_password"
-            android:visibility="gone"
-            tools:visibility="visible"
-            android:textColor="#000"
-            android:textSize="16dp" />
-
-        <com.swago.baseswago.cusview.MediumTextView
-            android:id="@+id/tvSetting"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:drawableStart="@mipmap/icon_mine_setting"
-            android:drawableEnd="@mipmap/more_small"
-            android:drawablePadding="5dp"
-            android:gravity="center_vertical"
-            android:paddingStart="20dp"
-            android:paddingEnd="20dp"
-            android:text="@string/app_settings"
-            android:textColor="#000"
-            android:textSize="16dp" />
-
-
-    </LinearLayout>
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 6 - 1
room/build.gradle

@@ -2,6 +2,7 @@ plugins {
     id 'com.android.library'
     id 'kotlin-android'
     id 'kotlin-kapt'
+    id 'org.greenrobot.greendao'
 }
 
 android {
@@ -40,7 +41,11 @@ android {
         viewBinding = true
     }
 }
-
+greendao {
+    schemaVersion 1
+    targetGenDir 'src/main/java'
+    daoPackage 'com.swago.room.database'
+}
 dependencies {
 
     implementation 'androidx.core:core-ktx:1.5.0'

BIN
room/src/main/assets/music.svga


+ 3 - 3
room/src/main/java/com/swago/room/anchor/AnchorRoomActivity.kt

@@ -192,7 +192,7 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
             }
         })
 
-        binding.ivBeauty.setOnClickListener(object : NoDoubleClickListener() {
+        binding.tvBeauty.setOnClickListener(object : NoDoubleClickListener() {
             override fun onClick() {
                 BeautyDialogFragment().show(supportFragmentManager, "BeautyDialogFragment")
             }
@@ -205,7 +205,7 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
                 roomType = RoomType.VIDEO
                 binding.viewAudio.visibility = View.INVISIBLE
                 binding.viewVideo.visibility = View.VISIBLE
-                binding.ivBeauty.visibility = View.VISIBLE
+                binding.tvBeauty.visibility = View.VISIBLE
                 binding.tvVideo.setTextColor(ContextCompat.getColor(AppContext.getContext(),R.color._ffffff))
                 binding.tvAudio.setTextColor(ContextCompat.getColor(AppContext.getContext(),R.color._d4ffffff))
                 UserInfo.getUserInfo()?.let {
@@ -233,7 +233,7 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
                 roomType = RoomType.AUDIO
                 binding.viewAudio.visibility = View.VISIBLE
                 binding.viewVideo.visibility = View.INVISIBLE
-                binding.ivBeauty.visibility = View.GONE
+                binding.tvBeauty.visibility = View.GONE
                 binding.tvVideo.setTextColor(ContextCompat.getColor(AppContext.getContext(),R.color._d4ffffff))
                 binding.tvAudio.setTextColor(ContextCompat.getColor(AppContext.getContext(),R.color._ffffff))
                 AgoraManager.stopPreviewAndRemoveLocalView(binding.flLocal)

+ 10 - 0
room/src/main/java/com/swago/room/database/DBHelper.kt

@@ -0,0 +1,10 @@
+package com.swago.room.database
+
+import com.swago.room.music.MusicModel
+
+object DBHelper {
+    private val daoSession = DBManager.getDaoSession()
+    fun getMusicModel() : MusicModelDao?{
+        return daoSession?.musicModelDao
+    }
+}

+ 18 - 0
room/src/main/java/com/swago/room/database/DBManager.kt

@@ -0,0 +1,18 @@
+package com.swago.room.database
+
+import android.content.Context
+
+object DBManager {
+    private var daoSession: DaoSession? = null
+
+    fun init(context: Context) {
+        val helper = DaoMaster.DevOpenHelper(context, "meliv_db")
+        val db = helper.writableDb
+        val daoMaster = DaoMaster(db)
+        daoSession = daoMaster.newSession()
+    }
+
+    fun getDaoSession(): DaoSession? {
+        return daoSession
+    }
+}

+ 96 - 0
room/src/main/java/com/swago/room/database/DaoMaster.java

@@ -0,0 +1,96 @@
+package com.swago.room.database;
+
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteDatabase.CursorFactory;
+import android.util.Log;
+
+import org.greenrobot.greendao.AbstractDaoMaster;
+import org.greenrobot.greendao.database.StandardDatabase;
+import org.greenrobot.greendao.database.Database;
+import org.greenrobot.greendao.database.DatabaseOpenHelper;
+import org.greenrobot.greendao.identityscope.IdentityScopeType;
+
+
+// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
+/**
+ * Master of DAO (schema version 1): knows all DAOs.
+ */
+public class DaoMaster extends AbstractDaoMaster {
+    public static final int SCHEMA_VERSION = 1;
+
+    /** Creates underlying database table using DAOs. */
+    public static void createAllTables(Database db, boolean ifNotExists) {
+        MusicModelDao.createTable(db, ifNotExists);
+    }
+
+    /** Drops underlying database table using DAOs. */
+    public static void dropAllTables(Database db, boolean ifExists) {
+        MusicModelDao.dropTable(db, ifExists);
+    }
+
+    /**
+     * WARNING: Drops all table on Upgrade! Use only during development.
+     * Convenience method using a {@link DevOpenHelper}.
+     */
+    public static DaoSession newDevSession(Context context, String name) {
+        Database db = new DevOpenHelper(context, name).getWritableDb();
+        DaoMaster daoMaster = new DaoMaster(db);
+        return daoMaster.newSession();
+    }
+
+    public DaoMaster(SQLiteDatabase db) {
+        this(new StandardDatabase(db));
+    }
+
+    public DaoMaster(Database db) {
+        super(db, SCHEMA_VERSION);
+        registerDaoClass(MusicModelDao.class);
+    }
+
+    public DaoSession newSession() {
+        return new DaoSession(db, IdentityScopeType.Session, daoConfigMap);
+    }
+
+    public DaoSession newSession(IdentityScopeType type) {
+        return new DaoSession(db, type, daoConfigMap);
+    }
+
+    /**
+     * Calls {@link #createAllTables(Database, boolean)} in {@link #onCreate(Database)} -
+     */
+    public static abstract class OpenHelper extends DatabaseOpenHelper {
+        public OpenHelper(Context context, String name) {
+            super(context, name, SCHEMA_VERSION);
+        }
+
+        public OpenHelper(Context context, String name, CursorFactory factory) {
+            super(context, name, factory, SCHEMA_VERSION);
+        }
+
+        @Override
+        public void onCreate(Database db) {
+            Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION);
+            createAllTables(db, false);
+        }
+    }
+
+    /** WARNING: Drops all table on Upgrade! Use only during development. */
+    public static class DevOpenHelper extends OpenHelper {
+        public DevOpenHelper(Context context, String name) {
+            super(context, name);
+        }
+
+        public DevOpenHelper(Context context, String name, CursorFactory factory) {
+            super(context, name, factory);
+        }
+
+        @Override
+        public void onUpgrade(Database db, int oldVersion, int newVersion) {
+            Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables");
+            dropAllTables(db, true);
+            onCreate(db);
+        }
+    }
+
+}

+ 48 - 0
room/src/main/java/com/swago/room/database/DaoSession.java

@@ -0,0 +1,48 @@
+package com.swago.room.database;
+
+import java.util.Map;
+
+import org.greenrobot.greendao.AbstractDao;
+import org.greenrobot.greendao.AbstractDaoSession;
+import org.greenrobot.greendao.database.Database;
+import org.greenrobot.greendao.identityscope.IdentityScopeType;
+import org.greenrobot.greendao.internal.DaoConfig;
+
+import com.swago.room.music.MusicModel;
+
+import com.swago.room.database.MusicModelDao;
+
+// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
+
+/**
+ * {@inheritDoc}
+ * 
+ * @see org.greenrobot.greendao.AbstractDaoSession
+ */
+public class DaoSession extends AbstractDaoSession {
+
+    private final DaoConfig musicModelDaoConfig;
+
+    private final MusicModelDao musicModelDao;
+
+    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
+            daoConfigMap) {
+        super(db);
+
+        musicModelDaoConfig = daoConfigMap.get(MusicModelDao.class).clone();
+        musicModelDaoConfig.initIdentityScope(type);
+
+        musicModelDao = new MusicModelDao(musicModelDaoConfig, this);
+
+        registerDao(MusicModel.class, musicModelDao);
+    }
+    
+    public void clear() {
+        musicModelDaoConfig.clearIdentityScope();
+    }
+
+    public MusicModelDao getMusicModelDao() {
+        return musicModelDao;
+    }
+
+}

+ 153 - 0
room/src/main/java/com/swago/room/database/MusicModelDao.java

@@ -0,0 +1,153 @@
+package com.swago.room.database;
+
+import android.database.Cursor;
+import android.database.sqlite.SQLiteStatement;
+
+import org.greenrobot.greendao.AbstractDao;
+import org.greenrobot.greendao.Property;
+import org.greenrobot.greendao.internal.DaoConfig;
+import org.greenrobot.greendao.database.Database;
+import org.greenrobot.greendao.database.DatabaseStatement;
+
+import com.swago.room.music.MusicModel;
+
+// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
+/** 
+ * DAO for table "MUSIC_MODEL".
+*/
+public class MusicModelDao extends AbstractDao<MusicModel, Long> {
+
+    public static final String TABLENAME = "MUSIC_MODEL";
+
+    /**
+     * Properties of entity MusicModel.<br/>
+     * Can be used for QueryBuilder and for referencing column names.
+     */
+    public static class Properties {
+        public final static Property Id = new Property(0, long.class, "id", true, "_id");
+        public final static Property Title = new Property(1, String.class, "title", false, "TITLE");
+        public final static Property Data = new Property(2, String.class, "data", false, "DATA");
+        public final static Property Duration = new Property(3, long.class, "duration", false, "DURATION");
+        public final static Property IsSelect = new Property(4, boolean.class, "isSelect", false, "IS_SELECT");
+        public final static Property IsPlaying = new Property(5, boolean.class, "isPlaying", false, "IS_PLAYING");
+    }
+
+
+    public MusicModelDao(DaoConfig config) {
+        super(config);
+    }
+    
+    public MusicModelDao(DaoConfig config, DaoSession daoSession) {
+        super(config, daoSession);
+    }
+
+    /** Creates the underlying database table. */
+    public static void createTable(Database db, boolean ifNotExists) {
+        String constraint = ifNotExists? "IF NOT EXISTS ": "";
+        db.execSQL("CREATE TABLE " + constraint + "\"MUSIC_MODEL\" (" + //
+                "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ," + // 0: id
+                "\"TITLE\" TEXT," + // 1: title
+                "\"DATA\" TEXT," + // 2: data
+                "\"DURATION\" INTEGER NOT NULL ," + // 3: duration
+                "\"IS_SELECT\" INTEGER NOT NULL ," + // 4: isSelect
+                "\"IS_PLAYING\" INTEGER NOT NULL );"); // 5: isPlaying
+    }
+
+    /** Drops the underlying database table. */
+    public static void dropTable(Database db, boolean ifExists) {
+        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MUSIC_MODEL\"";
+        db.execSQL(sql);
+    }
+
+    @Override
+    protected final void bindValues(DatabaseStatement stmt, MusicModel entity) {
+        stmt.clearBindings();
+        stmt.bindLong(1, entity.getId());
+ 
+        String title = entity.getTitle();
+        if (title != null) {
+            stmt.bindString(2, title);
+        }
+ 
+        String data = entity.getData();
+        if (data != null) {
+            stmt.bindString(3, data);
+        }
+        stmt.bindLong(4, entity.getDuration());
+        stmt.bindLong(5, entity.getIsSelect() ? 1L: 0L);
+        stmt.bindLong(6, entity.getIsPlaying() ? 1L: 0L);
+    }
+
+    @Override
+    protected final void bindValues(SQLiteStatement stmt, MusicModel entity) {
+        stmt.clearBindings();
+        stmt.bindLong(1, entity.getId());
+ 
+        String title = entity.getTitle();
+        if (title != null) {
+            stmt.bindString(2, title);
+        }
+ 
+        String data = entity.getData();
+        if (data != null) {
+            stmt.bindString(3, data);
+        }
+        stmt.bindLong(4, entity.getDuration());
+        stmt.bindLong(5, entity.getIsSelect() ? 1L: 0L);
+        stmt.bindLong(6, entity.getIsPlaying() ? 1L: 0L);
+    }
+
+    @Override
+    public Long readKey(Cursor cursor, int offset) {
+        return cursor.getLong(offset + 0);
+    }    
+
+    @Override
+    public MusicModel readEntity(Cursor cursor, int offset) {
+        MusicModel entity = new MusicModel( //
+            cursor.getLong(offset + 0), // id
+            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // title
+            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // data
+            cursor.getLong(offset + 3), // duration
+            cursor.getShort(offset + 4) != 0, // isSelect
+            cursor.getShort(offset + 5) != 0 // isPlaying
+        );
+        return entity;
+    }
+     
+    @Override
+    public void readEntity(Cursor cursor, MusicModel entity, int offset) {
+        entity.setId(cursor.getLong(offset + 0));
+        entity.setTitle(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
+        entity.setData(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
+        entity.setDuration(cursor.getLong(offset + 3));
+        entity.setIsSelect(cursor.getShort(offset + 4) != 0);
+        entity.setIsPlaying(cursor.getShort(offset + 5) != 0);
+     }
+    
+    @Override
+    protected final Long updateKeyAfterInsert(MusicModel entity, long rowId) {
+        entity.setId(rowId);
+        return rowId;
+    }
+    
+    @Override
+    public Long getKey(MusicModel entity) {
+        if(entity != null) {
+            return entity.getId();
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public boolean hasKey(MusicModel entity) {
+        throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
+    }
+
+    @Override
+    protected final boolean isEntityUpdateable() {
+        return true;
+    }
+    
+}

+ 18 - 5
room/src/main/java/com/swago/room/music/LocalMusicActivity.kt

@@ -10,16 +10,17 @@ import com.swago.baseswago.activity.BaseXActivity
 import com.swago.baseswago.constant.ARouteConstant
 import com.swago.baseswago.util.AppContext
 import com.swago.room.R
+import com.swago.room.database.DBHelper
 import com.swago.room.databinding.ActivityLocalMusicBinding
+import com.zy.multistatepage.state.EmptyState
+import com.zy.multistatepage.state.ErrorState
+import com.zy.multistatepage.state.LoadingState
+import com.zy.multistatepage.state.SuccessState
 
 @Route(path = ARouteConstant.Room.musicList)
 class LocalMusicActivity : BaseXActivity<ActivityLocalMusicBinding>() {
     private val musicVm by viewModels<MusicVm>()
 
-    @Autowired
-    @JvmField
-    var data: ArrayList<MusicModel>? = null
-
     val adapter : LocalMusicAdapter by lazy {
         LocalMusicAdapter()
     }
@@ -32,6 +33,7 @@ class LocalMusicActivity : BaseXActivity<ActivityLocalMusicBinding>() {
         get() = LinearLayoutManager(this)
 
     override fun loadData() {
+        multiStateContainer.show<LoadingState>()
         musicVm.loadMediaItems()
     }
 
@@ -45,7 +47,16 @@ class LocalMusicActivity : BaseXActivity<ActivityLocalMusicBinding>() {
 
     override fun initLiveData() {
         musicVm.musicListData.observe(this){
-            adapter.setNewData(it)
+            if (it == null) {
+                multiStateContainer.show<ErrorState>()
+            } else {
+                if (it.isEmpty()) {
+                    multiStateContainer.show<EmptyState>()
+                } else {
+                    multiStateContainer.show<SuccessState>()
+                    adapter.setNewData(it)
+                }
+            }
         }
 
         binding.cbSelect.setOnCheckedChangeListener { _, isChecked ->
@@ -61,6 +72,8 @@ class LocalMusicActivity : BaseXActivity<ActivityLocalMusicBinding>() {
             if (selectMusicData.size == 0){
                 return@setOnClickListener
             }
+            DBHelper.getMusicModel()?.insertOrReplaceInTx(selectMusicData)
+            finish()
         }
 
         adapter.isSelectFun = {

+ 3 - 3
room/src/main/java/com/swago/room/music/LocalMusicAdapter.kt

@@ -12,7 +12,7 @@ class LocalMusicAdapter :  BaseQuickAdapter<MusicModel, BaseViewHolder>(R.layout
 
     fun setSelectAll(isSelect : Boolean){
         data.forEachIndexed { index, musicModel ->
-            data[index].isSelect = isSelect
+            data[index].setSelect(isSelect)
         }
         notifyDataSetChanged()
     }
@@ -21,9 +21,9 @@ class LocalMusicAdapter :  BaseQuickAdapter<MusicModel, BaseViewHolder>(R.layout
             itemView.findViewById<BoldTextView>(R.id.tvTitle).text = item.title
             itemView.findViewById<MediumTextView>(R.id.tvDuration).text = String.format("%02d:%02d", item.duration / 60000, (item.duration % 60000) / 1000)
             val checkBox = itemView.findViewById<CheckBox>(R.id.cbCheck)
-            checkBox.isChecked = item.isSelect
+            checkBox.isChecked = item.getIsSelect()
             checkBox.setOnCheckedChangeListener { _, isChecked ->
-                item.isSelect = isChecked
+                item.setSelect(isChecked)
                isSelectFun?.invoke(item , isChecked)
             }
         }

+ 137 - 0
room/src/main/java/com/swago/room/music/MusicModel.java

@@ -0,0 +1,137 @@
+package com.swago.room.music;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import androidx.annotation.NonNull;
+
+import org.greenrobot.greendao.annotation.Entity;
+import org.greenrobot.greendao.annotation.Generated;
+import org.greenrobot.greendao.annotation.Id;
+
+@Entity
+public class MusicModel implements Parcelable {
+    @Id(autoincrement = true)
+    private long id;
+    private String title;
+    private String data;
+    private long duration;
+    private boolean isSelect;
+    private boolean isPlaying;
+
+    protected MusicModel(Parcel in) {
+        id = in.readLong();
+        title = in.readString();
+        data = in.readString();
+        duration = in.readLong();
+        isSelect = in.readByte() != 0;
+        isPlaying = in.readByte() != 0;
+    }
+
+    @Generated(hash = 1804109021)
+    public MusicModel(long id, String title, String data, long duration,
+            boolean isSelect, boolean isPlaying) {
+        this.id = id;
+        this.title = title;
+        this.data = data;
+        this.duration = duration;
+        this.isSelect = isSelect;
+        this.isPlaying = isPlaying;
+    }
+
+    @Generated(hash = 70061797)
+    public MusicModel() {
+    }
+
+
+    public static final Creator<MusicModel> CREATOR = new Creator<MusicModel>() {
+        @Override
+        public MusicModel createFromParcel(Parcel in) {
+            return new MusicModel(in);
+        }
+
+        @Override
+        public MusicModel[] newArray(int size) {
+            return new MusicModel[size];
+        }
+    };
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getData() {
+        return data;
+    }
+
+    public void setData(String data) {
+        this.data = data;
+    }
+
+    public long getDuration() {
+        return duration;
+    }
+
+    public void setDuration(long duration) {
+        this.duration = duration;
+    }
+
+    public boolean isSelect() {
+        return isSelect;
+    }
+
+    public void setSelect(boolean select) {
+        isSelect = select;
+    }
+
+    public boolean isPlaying() {
+        return isPlaying;
+    }
+
+    public void setPlaying(boolean playing) {
+        isPlaying = playing;
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(@NonNull Parcel dest, int flags) {
+        dest.writeLong(id);
+        dest.writeString(title);
+        dest.writeString(data);
+        dest.writeLong(duration);
+        dest.writeByte((byte) (isSelect ? 1 : 0));
+        dest.writeByte((byte) (isPlaying ? 1 : 0));
+    }
+
+    public boolean getIsSelect() {
+        return this.isSelect;
+    }
+
+    public void setIsSelect(boolean isSelect) {
+        this.isSelect = isSelect;
+    }
+
+    public boolean getIsPlaying() {
+        return this.isPlaying;
+    }
+
+    public void setIsPlaying(boolean isPlaying) {
+        this.isPlaying = isPlaying;
+    }
+}

+ 0 - 44
room/src/main/java/com/swago/room/music/MusicModel.kt

@@ -1,44 +0,0 @@
-package com.swago.room.music
-
-import android.os.Parcel
-import android.os.Parcelable
-
-data class MusicModel(
-    val id: Long = 0,
-    val title: String? = null,
-    val data: String? =null,
-    val duration: Long = 0,
-    var isSelect: Boolean = false
-) : Parcelable{
-    constructor(parcel: Parcel) : this(
-        parcel.readLong(),
-        parcel.readString(),
-        parcel.readString(),
-        parcel.readLong(),
-        parcel.readByte() != 0.toByte()
-    ) {
-    }
-
-    override fun writeToParcel(parcel: Parcel, flags: Int) {
-        parcel.writeLong(id)
-        parcel.writeString(title)
-        parcel.writeString(data)
-        parcel.writeLong(duration)
-        parcel.writeByte(if (isSelect) 1 else 0)
-    }
-
-    override fun describeContents(): Int {
-        return 0
-    }
-
-    companion object CREATOR : Parcelable.Creator<MusicModel> {
-        override fun createFromParcel(parcel: Parcel): MusicModel {
-            return MusicModel(parcel)
-        }
-
-        override fun newArray(size: Int): Array<MusicModel?> {
-            return arrayOfNulls(size)
-        }
-    }
-
-}

+ 1 - 15
room/src/main/java/com/swago/room/music/MusicVm.kt

@@ -48,25 +48,11 @@ class MusicVm(application: Application) : BaseViewModel(application) {
                         val data = it.getString(dataColumn)
                         val duration = it.getLong(durationColumn)
                         LogUtil.d("musicDialog $id $title $data $duration")
-                        audioList.add(MusicModel(id,title,data,duration,false))
+                        audioList.add(MusicModel(id,title,data,duration,false,false))
                     }
                 }
                 musicListData.postValue(audioList)
             }
         }
     }
-
-    fun toggleSelection(item: MusicModel){
-        val updateList = musicListData.value?.map {
-            if (it.id == item.id) it.copy(isSelect = !it.isSelect) else it
-        }
-        musicListData.value = updateList
-    }
-
-    fun selectAll(isSelect: Boolean){
-        val updatedList = musicListData.value?.map {
-            it.copy(isSelect = isSelect)
-        }
-        musicListData.value = updatedList
-    }
 }

+ 12 - 3
room/src/main/java/com/swago/room/music/MyMusicAdapter.kt

@@ -1,7 +1,9 @@
 package com.swago.room.music
 
+import android.view.View
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.BaseViewHolder
+import com.opensource.svgaplayer.SVGAImageView
 import com.swago.baseswago.cusview.BoldTextView
 import com.swago.baseswago.cusview.MediumTextView
 import com.swago.room.R
@@ -10,10 +12,17 @@ class MyMusicAdapter :
     BaseQuickAdapter<MusicModel, BaseViewHolder>(R.layout.item_my_music, arrayListOf()) {
     override fun convert(helper: BaseViewHolder, item: MusicModel) {
         helper.apply {
-            itemView.findViewById<BoldTextView>(R.id.tvName).text = item.title
-            itemView.findViewById<MediumTextView>(R.id.tvDuration).text =
-                String.format("%02d:%02d", item.duration / 60000, (item.duration % 60000) / 1000)
+            setText(R.id.tvName , item.title)
+            setText(R.id.tvDuration, String.format("%02d:%02d", item.duration / 60000, (item.duration % 60000) / 1000))
             addOnClickListener(R.id.ivRecall)
+            val svgaImageView = itemView.findViewById<SVGAImageView>(R.id.svgaImageView)
+            if (item.getIsPlaying()){
+                svgaImageView.visibility = View.VISIBLE
+                svgaImageView.startAnimation()
+            } else {
+                svgaImageView.visibility = View.INVISIBLE
+                svgaImageView.stopAnimation()
+            }
         }
     }
 }

+ 84 - 71
room/src/main/java/com/swago/room/music/MyMusicDialog.kt

@@ -1,26 +1,32 @@
 package com.swago.room.music
 
-import android.content.Intent
 import android.os.Bundle
 import android.view.Gravity
 import android.view.View
-import androidx.appcompat.app.AppCompatActivity
 import androidx.fragment.app.viewModels
 import androidx.recyclerview.widget.LinearLayoutManager
 import androidx.recyclerview.widget.RecyclerView
 import com.alibaba.android.arouter.launcher.ARouter
-import com.chad.library.adapter.base.BaseQuickAdapter
 import com.swago.baseswago.agora.AgoraManager
 import com.swago.baseswago.constant.ARouteConstant
-import com.swago.baseswago.cusview.SwagoRecyclerView
-import com.swago.baseswago.dialog.BaseListDialogFragment
-import com.swago.baseswago.model.MomentModel
-import com.swago.baseswago.util.LogUtil
+import com.swago.baseswago.dialog.BaseXDFragment
+import com.swago.baseswago.dialog.ChoiceDialogFragment
+import com.swago.baseswago.util.AppContext
 import com.swago.room.R
+import com.swago.room.database.DBHelper
 import com.swago.room.databinding.DialogMyMusicBinding
 
-class MyMusicDialog : BaseListDialogFragment<DialogMyMusicBinding, MusicModel>() {
-    private val musicVm by viewModels<MusicVm>()
+class MyMusicDialog : BaseXDFragment<DialogMyMusicBinding>() {
+    val music_binding get() = binding
+    var isLocalCome = false
+    private val musicList by lazy {
+        ArrayList<MusicModel>()
+    }
+    private val adapter by lazy {
+        MyMusicAdapter()
+    }
+    val layoutManager: RecyclerView.LayoutManager
+        get() = LinearLayoutManager(activity)
 
     companion object {
         const val select_local_result = 10002
@@ -38,91 +44,98 @@ class MyMusicDialog : BaseListDialogFragment<DialogMyMusicBinding, MusicModel>()
         setDimAmount(0.5f)
     }
 
-
-    override val smartRecyclerView: SwagoRecyclerView<MusicModel> by lazy {
-        binding.swagoRv as SwagoRecyclerView<MusicModel>
-    }
-    override val adapter: BaseQuickAdapter<MusicModel, *> by lazy {
-        MyMusicAdapter()
-    }
-
-    override val layoutManager: RecyclerView.LayoutManager by lazy {
-        LinearLayoutManager(context)
-    }
-    override val loadData: (page: Int) -> Unit = {
-        musicVm.loadMediaItems()
-    }
-
-    override fun initViewData() {
-        binding.ivClose.setOnClickListener {
+    override fun initOther() {
+        music_binding.rvMusic.layoutManager = layoutManager
+        music_binding.rvMusic.adapter = adapter
+        music_binding.ivClose.setOnClickListener {
             dismissAllowingStateLoss()
         }
     }
 
     override fun initLiveData() {
-        musicVm.musicListData.observe(this) {
-            if (!it.isNullOrEmpty()){
-                binding.clAdd.visibility = View.VISIBLE
-                binding.clNoContent.visibility = View.GONE
-                smartRecyclerView.onFetchDataFinish(it, false)
-            } else {
-                binding.clAdd.visibility = View.GONE
-                binding.clNoContent.visibility = View.VISIBLE
-
-            }
-
+        val data = DBHelper.getMusicModel()?.loadAll()
+        if (!data.isNullOrEmpty()){
+            music_binding.clAdd.visibility = View.VISIBLE
+            music_binding.clNoContent.visibility = View.GONE
+            musicList.addAll(data)
+            adapter.setNewData(musicList)
+        } else {
+            music_binding.clAdd.visibility = View.GONE
+            music_binding.clNoContent.visibility = View.VISIBLE
         }
-        adapter.setOnItemClickListener { _, _, position ->
-            if (adapter.data.size > position){
-                AgoraManager.getRtcEngine()?.startAudioMixing(
-                    adapter.data[position].data,
-                    false,
-                    false,
-                    -1,
-                    0
-                )
-            }
-
-        }
-        binding.clAdd.setOnClickListener {
+        music_binding.clAdd.setOnClickListener {
+            isLocalCome = true
             ARouter.getInstance()
                 .build(ARouteConstant.Room.musicList)
-                .withParcelableArrayList("data",adapter.data as ArrayList<MusicModel>)
-                .navigation(activity, select_local_result)
+                .navigation()
         }
-        binding.clNoContent.setOnClickListener {
+        music_binding.clNoContent.setOnClickListener {
+            isLocalCome = true
             ARouter.getInstance()
                 .build(ARouteConstant.Room.musicList)
-                .withParcelableArrayList("data",adapter.data as ArrayList<MusicModel>)
-                .navigation(activity, select_local_result)
+                .navigation()
         }
 
         adapter.setOnItemChildClickListener { _, view, position ->
             when(view?.id){
                 R.id.ivRecall -> {
+                    ChoiceDialogFragment.newInstance(AppContext.getContext().getString(R.string.sure_delete_this_music),
+                        rightChoiceText = AppContext.getContext().getString(R.string.delete)).apply {
+                        this.sureFun = {
+                            DBHelper.getMusicModel()?.delete(adapter.data[position])
+                            musicList.remove(adapter.data[position])
+                            adapter.setNewData(musicList)
+                            if (adapter.data.isEmpty()){
+                                music_binding.clAdd.visibility = View.GONE
+                                music_binding.clNoContent.visibility = View.VISIBLE
+                            }
+                        }
+                    }.show(childFragmentManager,"ChoiceDialogFragment")
 
                 }
             }
-
         }
-    }
-
-    override fun loadMoreNeed(): Boolean {
-        return false
-    }
 
-    override fun refreshNeed(): Boolean {
-        return false
+        adapter.setOnItemClickListener { _, _, position ->
+            if (adapter.data[position].getIsPlaying()){
+                adapter.data[position].setIsPlaying(false)
+                adapter.notifyItemChanged(position)
+                AgoraManager.getRtcEngine()?.stopAudioMixing()
+                return@setOnItemClickListener
+            }
+            adapter.data.forEachIndexed { index, musicModel ->
+                if (musicModel.isPlaying()){
+                    adapter.data[index].setIsPlaying(false)
+                    adapter.notifyItemChanged(index)
+                    return@forEachIndexed
+                }
+            }
+            adapter.data[position].setIsPlaying(true)
+            AgoraManager.getRtcEngine()?.startAudioMixing(
+                adapter.data[position].data,
+                false,
+                false,
+                -1,
+                0
+            )
+            adapter.notifyItemChanged(position)
+        }
     }
 
-    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
-        super.onActivityResult(requestCode, resultCode, data)
-        if (resultCode == AppCompatActivity.RESULT_OK){
-            when(requestCode){
-                select_local_result -> {
-                   val  model = data?.getParcelableArrayExtra("data") as List<MusicModel>
-                    smartRecyclerView.onFetchDataFinish(model, false)
-                }
+    override fun onResume() {
+        super.onResume()
+        if (isLocalCome){
+            isLocalCome = false
+            val data = DBHelper.getMusicModel()?.loadAll()
+            if (!data.isNullOrEmpty()){
+                binding.clAdd.visibility = View.VISIBLE
+                binding.clNoContent.visibility = View.GONE
+                musicList.clear()
+                musicList.addAll(data)
+                adapter.setNewData(musicList)
+            } else {
+                binding.clAdd.visibility = View.GONE
+                binding.clNoContent.visibility = View.VISIBLE
             }
         }
     }

+ 50 - 45
room/src/main/res/layout/activity_anchor_room.xml

@@ -98,6 +98,53 @@
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent">
 
+            <TextView
+                android:id="@+id/tvBeauty"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="24dp"
+                android:drawableTop="@mipmap/beauty_filter"
+                android:drawablePadding="4dp"
+                android:text="@string/beauty_filter"
+                android:textColor="#ffffff"
+                android:layout_marginTop="3dp"
+                android:textSize="14dp"/>
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="16dp"
+                android:layout_marginStart="16dp"
+                android:layout_marginBottom="24dp">
+                <TextView
+                    android:id="@+id/tvWishGift"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:drawableTop="@mipmap/wish_gift"
+                    android:drawablePadding="4dp"
+                    android:text="@string/wish_gift"
+                    android:textColor="#ffffff"
+                    android:textSize="14dp"
+                    android:layout_marginTop="3dp"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintTop_toTopOf="@+id/tvNew"/>
+                <TextView
+                    android:id="@+id/tvNew"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:background="@drawable/shape_ff56b7_14"
+                    android:gravity="center"
+                    android:paddingStart="3dp"
+                    android:paddingEnd="3dp"
+                    android:text="New"
+                    android:textColor="#ffffff"
+                    android:textSize="10dp"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
             <CheckBox
                 android:id="@+id/cbPassword"
                 android:layout_width="wrap_content"
@@ -106,24 +153,12 @@
                 android:textColor="#ffffff"
                 android:textSize="14dp"
                 android:button="@null"
+                android:layout_marginTop="3dp"
                 android:text="@string/lock_room_off"
                 android:drawablePadding="4dp"
                 android:gravity="center_horizontal"
                 android:background="@android:color/transparent"
-                android:layout_marginBottom="24dp"
-                android:layout_marginEnd="@dimen/dp_10"/>
-
-            <TextView
-                android:id="@+id/tvWishGift"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginBottom="24dp"
-                android:drawableTop="@mipmap/wish_gift"
-                android:drawablePadding="4dp"
-                android:text="@string/wish_gift"
-                android:textColor="#ffffff"
-                android:textSize="14dp"
-                android:layout_marginStart="@dimen/dp_10"/>
+                android:layout_marginBottom="24dp"/>
 
         </LinearLayout>
 
@@ -165,22 +200,6 @@
 
         </LinearLayout>
 
-        <TextView
-            android:id="@+id/tvNew"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="-5dp"
-            android:layout_marginEnd="-5dp"
-            android:background="@drawable/shape_ff56b7_14"
-            android:gravity="center"
-            android:paddingStart="3dp"
-            android:paddingEnd="3dp"
-            android:text="New"
-            android:textColor="#ffffff"
-            android:textSize="10dp"
-            app:layout_constraintEnd_toEndOf="@+id/ll_change"
-            app:layout_constraintTop_toTopOf="@+id/ll_change" />
-
 
         <com.swago.baseswago.cusview.BoldTextView
             android:id="@+id/tvStartLive"
@@ -191,27 +210,13 @@
             android:background="@drawable/shape_ff56b7_37"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintEnd_toStartOf="@+id/ivBeauty"
+            app:layout_constraintEnd_toEndOf="parent"
             android:layout_marginStart="20dp"
             android:layout_marginEnd="20dp"
             android:layout_marginBottom="73dp"
             android:layout_width="0dp"
             android:layout_height="44dp"/>
 
-        <ImageView
-            android:id="@+id/ivBeauty"
-            app:layout_constraintStart_toEndOf="@+id/tvStartLive"
-            app:layout_constraintTop_toTopOf="@+id/tvStartLive"
-            app:layout_constraintBottom_toBottomOf="@+id/tvStartLive"
-            app:layout_constraintEnd_toEndOf="parent"
-            android:layout_marginEnd="24dp"
-            android:background="@drawable/shape_20000000_41"
-            android:padding="10dp"
-            android:visibility="visible"
-            android:src="@mipmap/icon_beauty"
-            android:layout_width="44dp"
-            android:layout_height="44dp"/>
-
 
         <LinearLayout
             android:id="@+id/llVideo"

+ 2 - 2
room/src/main/res/layout/activity_local_music.xml

@@ -19,7 +19,7 @@
         android:id="@+id/cbSelect"
         android:textSize="14dp"
         android:textColor="@drawable/local_select_music"
-        android:text="Select all"
+        android:text="@string/select_all"
         android:layout_marginEnd="20dp"
         android:padding="10dp"
         android:gravity="center"
@@ -48,7 +48,7 @@
         android:layout_marginEnd="17dp"
         android:layout_marginBottom="24dp"
         android:textColor="#fff"
-        android:text="Add to My Music"
+        android:text="@string/add_to_my_music"
         android:gravity="center"
         android:textSize="@dimen/sp_16"/>
 

+ 64 - 36
room/src/main/res/layout/dialog_my_music.xml

@@ -15,13 +15,12 @@
         android:layout_height="500dp"
         android:background="@drawable/shape_white_top_20">
 
-
         <TextView
             android:id="@+id/tvTitle"
             android:textSize="17dp"
             android:textColor="#131b23"
             android:layout_marginTop="14dp"
-            android:text="My Music"
+            android:text="@string/my_music"
             android:textStyle="bold"
             app:layout_constraintTop_toTopOf="parent"
             app:layout_constraintStart_toStartOf="parent"
@@ -40,8 +39,8 @@
             android:layout_width="24dp"
             android:layout_height="24dp"/>
 
-        <com.swago.baseswago.cusview.SwagoRecyclerView
-            android:id="@+id/swagoRv"
+        <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/rvMusic"
             android:layout_marginTop="18dp"
             app:layout_constraintTop_toBottomOf="@+id/tvTitle"
             app:layout_constraintBottom_toTopOf="@+id/cl_add"
@@ -82,38 +81,67 @@
                 app:layout_constraintBottom_toBottomOf="parent"/>
         </androidx.constraintlayout.widget.ConstraintLayout>
 
-        <androidx.constraintlayout.widget.ConstraintLayout
-            android:id="@+id/clNoContent"
-            android:layout_width="140dp"
-            android:layout_height="36dp"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            android:layout_marginBottom="80dp"
-            android:visibility="gone"
-            android:background="@drawable/shape_9b20fc_20">
-            <ImageView
-                android:layout_width="16dp"
-                android:layout_height="16dp"
-                app:layout_constraintTop_toTopOf="parent"
-                app:layout_constraintBottom_toBottomOf="parent"
-                android:background="@mipmap/ic_add_music"
-                android:layout_marginEnd="@dimen/dp_4"
-                app:layout_constraintRight_toLeftOf="@+id/tv_no_add"
-                />
-            <TextView
-                android:id="@+id/tv_no_add"
-                android:layout_width="wrap_content"
-                android:layout_height="36dp"
-                android:gravity="center"
-                android:text="Add Music"
-                android:textColor="#fff"
-                android:textSize="@dimen/sp_16"
-                android:layout_marginStart="@dimen/dp_10"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintBottom_toBottomOf="parent"/>
-        </androidx.constraintlayout.widget.ConstraintLayout>
+       <androidx.constraintlayout.widget.ConstraintLayout
+           android:id="@+id/clNoContent"
+           android:layout_width="wrap_content"
+           android:layout_height="wrap_content"
+           android:visibility="gone"
+           app:layout_constraintStart_toStartOf="parent"
+           app:layout_constraintEnd_toEndOf="parent"
+           app:layout_constraintTop_toTopOf="parent"
+           app:layout_constraintBottom_toBottomOf="parent">
+           <ImageView
+               android:id="@+id/iv_empty"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               app:layout_constraintStart_toStartOf="parent"
+               app:layout_constraintEnd_toEndOf="parent"
+               app:layout_constraintTop_toTopOf="parent"
+               android:src="@mipmap/state_error_empty"/>
+           <TextView
+               android:id="@+id/tv_empty"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               app:layout_constraintStart_toStartOf="parent"
+               app:layout_constraintEnd_toEndOf="parent"
+               app:layout_constraintTop_toBottomOf="@+id/iv_empty"
+               android:layout_marginTop="16dp"
+               android:text="@string/There_is_nothing_here"
+               android:textColor="#435568"
+               android:textSize="@dimen/sp_12"/>
+
+           <androidx.constraintlayout.widget.ConstraintLayout
+               android:layout_width="146dp"
+               android:layout_height="36dp"
+               app:layout_constraintStart_toStartOf="parent"
+               app:layout_constraintEnd_toEndOf="parent"
+               app:layout_constraintTop_toBottomOf="@+id/tv_empty"
+               android:layout_marginTop="27dp"
+               android:background="@drawable/shape_9b20fc_20">
+               <ImageView
+                   android:layout_width="16dp"
+                   android:layout_height="16dp"
+                   app:layout_constraintTop_toTopOf="parent"
+                   app:layout_constraintBottom_toBottomOf="parent"
+                   android:background="@mipmap/ic_add_music"
+                   android:layout_marginEnd="@dimen/dp_4"
+                   app:layout_constraintRight_toLeftOf="@+id/tv_no_add"
+                   />
+               <TextView
+                   android:id="@+id/tv_no_add"
+                   android:layout_width="wrap_content"
+                   android:layout_height="36dp"
+                   android:gravity="center"
+                   android:text="@string/add_music"
+                   android:textColor="#fff"
+                   android:textSize="@dimen/sp_16"
+                   android:layout_marginStart="@dimen/dp_10"
+                   app:layout_constraintEnd_toEndOf="parent"
+                   app:layout_constraintStart_toStartOf="parent"
+                   app:layout_constraintBottom_toBottomOf="parent"/>
+           </androidx.constraintlayout.widget.ConstraintLayout>
+
+       </androidx.constraintlayout.widget.ConstraintLayout>
 
     </androidx.constraintlayout.widget.ConstraintLayout>
 

+ 2 - 1
room/src/main/res/layout/item_my_music.xml

@@ -10,9 +10,10 @@
         android:id="@+id/svgaImageView"
         android:layout_height="18dp"
         android:layout_width="18dp"
-        app:source="cry.svga"
+        app:source="music.svga"
         app:autoPlay="true"
         app:loopCount="0"
+        android:visibility="invisible"
         android:background="#fff"
         android:layout_marginTop="-16dp"
         android:layout_marginStart="16dp"

BIN
room/src/main/res/mipmap-xxhdpi/beauty_filter.png


+ 23 - 8
user/src/main/java/com/swago/user/store/StoreBuyDialog.kt

@@ -3,18 +3,24 @@ package com.swago.user.store
 import android.os.Bundle
 import android.view.Gravity
 import android.view.View
+import androidx.activity.viewModels
+import androidx.fragment.app.viewModels
 import com.opensource.svgaplayer.SVGADrawable
 import com.opensource.svgaplayer.SVGAParser
 import com.opensource.svgaplayer.SVGAVideoEntity
 import com.swago.baseswago.dialog.BaseXDFragment
+import com.swago.baseswago.model.mine.StoreItemBean
+import com.swago.baseswago.util.NoDoubleClickListener
 import com.swago.user.databinding.DialogStoreDetailBinding
+import com.swago.user.vm.StoreVm
 import java.io.File
 import java.net.URL
 
 class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
+    private val storeVm by viewModels<StoreVm>()
 
     private var svgaParser: SVGAParser? = null
-    var svgaString: String ?= null
+    var storeBean: StoreItemBean ?= null
     init {
         setGravity(Gravity.BOTTOM)
         setDimAmount(0.5f)
@@ -22,10 +28,10 @@ class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
     }
 
     companion object{
-        fun newInstance(): StoreBuyDialog {
+        fun newInstance(bean: StoreItemBean): StoreBuyDialog {
             val dialog = StoreBuyDialog()
             val bundle = Bundle()
-//            bundle.putString("svgaString",svgaString)
+            bundle.putParcelable("data" , bean)
             dialog.arguments = bundle
             return dialog
         }
@@ -34,12 +40,14 @@ class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
 
     override fun initOther() {
         svgaParser = SVGAParser(activity)
-//        arguments?.let {
-//            svgaString = it.getString("svgaString")
-//        }
-        svgaString?.let {
+        arguments?.let {
+            storeBean = it.getParcelable("data")
+        }
+        storeBean?.let {
+            binding.tvName.text = it.product_name
+            binding.tvCoin.text = "${it.product_coin}"
             svgaParser?.let { svgaParser ->
-                svgaParser.decodeFromURL(URL(it), object : SVGAParser.ParseCompletion{
+                svgaParser.decodeFromURL(URL(it.product_url), object : SVGAParser.ParseCompletion{
                     override fun onComplete(videoItem: SVGAVideoEntity) {
                         val drawable = SVGADrawable(videoItem)
                         binding.svgContent.setImageDrawable(drawable)
@@ -69,6 +77,13 @@ class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
     }
 
     override fun initLiveData() {
+        binding.tvBuy.setOnClickListener(object: NoDoubleClickListener(){
+            override fun onClick() {
+                storeBean?.let {
+                    storeVm.buyProduct(it.id)
+                }
 
+            }
+        })
     }
 }

+ 14 - 3
user/src/main/java/com/swago/user/store/StoreItemAdapter.kt

@@ -1,14 +1,25 @@
 package com.swago.user.store
 
+import android.view.View
+import com.bumptech.glide.Glide
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.BaseViewHolder
+import com.swago.baseswago.model.mine.StoreItemBean
+import com.swago.loadUrl
 import com.swago.user.R
+import de.hdodenhof.circleimageview.CircleImageView
 
-class StoreItemAdapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_store, arrayListOf())  {
-    override fun convert(helper: BaseViewHolder?, item: String?) {
+class StoreItemAdapter(private val type: Int) : BaseQuickAdapter<StoreItemBean, BaseViewHolder>(R.layout.item_store, arrayListOf())  {
+
+    override fun convert(helper: BaseViewHolder?, item: StoreItemBean?) {
         helper?.apply {
+            setVisible(R.id.tvUsing , type != 1)
+            setVisible(R.id.tv_coin , type == 1)
+
             item?.let {
-                setText(R.id.tv_name ,item)
+                setText(R.id.tv_name ,item.product_name)
+                setText(R.id.tv_coin ,"${item.product_coin}")
+                itemView.findViewById<CircleImageView>(R.id.iv_svg).loadUrl(mContext,item.product_url?: "")
             }
 
         }

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

@@ -1,13 +1,25 @@
 package com.swago.user.store
 
 import android.graphics.Color
+import android.view.View
+import androidx.activity.viewModels
+import androidx.fragment.app.viewModels
+import androidx.recyclerview.widget.GridLayoutManager
 import androidx.recyclerview.widget.LinearLayoutManager
+import com.alibaba.android.arouter.facade.annotation.Autowired
 import com.alibaba.android.arouter.facade.annotation.Route
+import com.alibaba.android.arouter.launcher.ARouter
 import com.swago.baseswago.activity.BaseXActivity
 import com.swago.baseswago.constant.ARouteConstant
+import com.swago.baseswago.model.live.audio.PositionBean
+import com.swago.baseswago.model.mine.StoreItemBean
+import com.swago.baseswago.util.AppContext
 import com.swago.user.R
 import com.swago.user.databinding.ActivityStoreListBinding
+import com.swago.user.vm.StoreVm
 import com.swago.user.vm.TaskVm
+import com.zy.multistatepage.state.EmptyState
+import java.util.concurrent.CopyOnWriteArrayList
 
 /**
  *@date 2022/2/26 13:37
@@ -15,36 +27,254 @@ import com.swago.user.vm.TaskVm
  */
 @Route(path = ARouteConstant.User.storeList)
 class StoreListActivity : BaseXActivity<ActivityStoreListBinding>() {
+    private val storeVm by viewModels<StoreVm>()
 
-    val adapter by lazy {
-        StoreTypeAdapter()
+    @Autowired(required = true)
+    @JvmField
+    var type: Int = 1
+    /**
+     * 入场特效
+     * */
+    private val enterList by lazy {
+        ArrayList<StoreItemBean>()
     }
 
+    val enterAdapter by lazy {
+        StoreItemAdapter(type)
+    }
+
+    var isEnterExpanded: Boolean = false
+
+    /**
+     * 头像框
+     * */
+    private val avatarList by lazy {
+        ArrayList<StoreItemBean>()
+    }
+
+    private val avatarAdapter by lazy {
+        StoreItemAdapter(type)
+    }
+
+    var isAvatarExpanded: Boolean = false
+
+
+    /**
+     * 徽章
+     * */
+    private val badgeList by lazy {
+        ArrayList<StoreItemBean>()
+    }
+
+    private val badgeAdapter by lazy {
+        StoreItemAdapter(type)
+    }
+
+    var isBadgeExpanded: Boolean = false
+
+    /**
+     * 聊天气泡
+     * */
+    private val bubbleList by lazy {
+        ArrayList<StoreItemBean>()
+    }
+
+    private val bubbleAdapter by lazy {
+        StoreItemAdapter(type)
+    }
+
+    var isBubbleExpanded: Boolean = false
+
     override fun loadData() {
+        if (type == 1){
+            storeVm.getProductList()
+        } else {
+            storeVm.getExitProductList()
+        }
+
     }
 
     override fun initOther() {
+        ARouter.getInstance().inject(this)
         setBackView(binding.toolbar.ivBack)
         binding.toolbar.ivBack.setImageResource(R.mipmap.back_white)
         binding.toolbar.tvTitle.setTextColor(Color.parseColor("#FFFFFF"))
-        binding.toolbar.tvTitle.text =
-            "Store"
+        if (type == 1){
+            binding.toolbar.tvTitle.text =
+                AppContext.getContext().resources.getString(R.string.mall)
+        } else {
+            binding.toolbar.tvTitle.text =
+                AppContext.getContext().resources.getString(R.string.dress_up)
+            binding.tvEnterMore.visibility = View.GONE
+            binding.ivEnterMore.visibility = View.GONE
+
+            binding.tvAvatarMore.visibility = View.GONE
+            binding.ivAvatarMore.visibility = View.GONE
+
+            binding.tvBadgeMore.visibility = View.GONE
+            binding.ivBadgeMore.visibility = View.GONE
+
+            binding.tvBubbleMore.visibility = View.GONE
+            binding.ivBubbleMore.visibility = View.GONE
+        }
     }
 
     override fun initLiveData() {
-        binding.swagoRv.layoutManager = LinearLayoutManager(this)
-        adapter.setNewData(arrayListOf(StoreListBean("dfg", false), StoreListBean("fsdfds", false)))
-        binding.swagoRv.adapter = adapter
-        adapter.setOnItemChildClickListener { _, view, positon ->
-            when (view?.id) {
-                R.id.clMore -> {
-                    adapter.data[positon].isExpanded = !adapter.data[positon].isExpanded
-                    adapter.notifyItemChanged(positon)
+        binding.rvEnter.layoutManager = GridLayoutManager(this, 3)
+        binding.rvEnter.adapter = enterAdapter
+
+        binding.rvAvatar.layoutManager = GridLayoutManager(this, 3)
+        binding.rvAvatar.adapter = avatarAdapter
+
+        binding.rvBadge.layoutManager = GridLayoutManager(this, 3)
+        binding.rvBadge.adapter = badgeAdapter
+
+        binding.rvBubble.layoutManager = GridLayoutManager(this, 3)
+        binding.rvBubble.adapter = bubbleAdapter
+
+        storeVm.storeProductData.observe(this){
+            if (it.isNullOrEmpty()){
+                binding.clEmpty.visibility = View.VISIBLE
+            } else {
+                it.forEach { item ->
+                    when (item.product_category){
+                        1 -> {
+                            enterList.add(item)
+                        }
+                        2 -> {
+                            avatarList.add(item)
+                        }
+                        3 -> {
+                            badgeList.add(item)
+                        }
+                        4 -> {
+                            bubbleList.add(item)
+                        }
+                    }
                 }
+                if (enterList.isNotEmpty()){
+                    binding.clEnterMore.visibility = View.VISIBLE
+                    enterAdapter.setNewData(enterList.subList(0, enterList.size.coerceAtMost(3)))
+                }
+                if (avatarList.isNotEmpty()){
+                    binding.clAvatarMore.visibility = View.VISIBLE
+                    avatarAdapter.setNewData(avatarList.subList(0, avatarList.size.coerceAtMost(3)))
+                }
+                if (badgeList.isNotEmpty()){
+                    binding.clBadgeMore.visibility = View.VISIBLE
+                    badgeAdapter.setNewData(badgeList.subList(0, badgeList.size.coerceAtMost(3)))
+                }
+                if (bubbleList.isNotEmpty()){
+                    binding.clBubbleMore.visibility = View.VISIBLE
+                    bubbleAdapter.setNewData(bubbleList.subList(0, bubbleList.size.coerceAtMost(3)))
+                }
+
+            }
+
+
+        }
+
+        storeVm.exitProductData.observe(this){
+            if (it.isNullOrEmpty()){
+                binding.clEmpty.visibility = View.VISIBLE
+            } else {
+                it.forEach { item ->
+                    when (item.product_category){
+                        1 -> {
+                            enterList.add(item)
+                        }
+                        2 -> {
+                            avatarList.add(item)
+                        }
+                        3 -> {
+                            badgeList.add(item)
+                        }
+                        4 -> {
+                            bubbleList.add(item)
+                        }
+                    }
+                }
+                if (enterList.isNotEmpty()){
+                    binding.clEnterMore.visibility = View.VISIBLE
+                    enterAdapter.setNewData(enterList)
+                }
+                if (avatarList.isNotEmpty()){
+                    binding.clAvatarMore.visibility = View.VISIBLE
+                    avatarAdapter.setNewData(avatarList)
+                }
+                if (badgeList.isNotEmpty()){
+                    binding.clBadgeMore.visibility = View.VISIBLE
+                    badgeAdapter.setNewData(badgeList)
+                }
+                if (bubbleList.isNotEmpty()){
+                    binding.clBubbleMore.visibility = View.VISIBLE
+                    bubbleAdapter.setNewData(bubbleList)
+                }
+            }
+
+        }
+
+        binding.clEnterMore.setOnClickListener {
+            if (type == 2)
+                return@setOnClickListener
+            if (isEnterExpanded) {
+                enterAdapter.setNewData(enterList)
+                binding.tvEnterMore.text = "Show Less"
+                binding.ivEnterMore.setImageResource(R.mipmap.ic_show_less)
+            } else {
+                enterAdapter.setNewData(enterList.subList(0, enterList.size.coerceAtMost(3)))
+                binding.tvEnterMore.text = "Show More"
+                binding.ivEnterMore.setImageResource(R.mipmap.ic_show_more)
+            }
+            isEnterExpanded = !isEnterExpanded
+        }
+
+        binding.clAvatarMore.setOnClickListener {
+            if (type == 2)
+                return@setOnClickListener
+            if (isAvatarExpanded) {
+                avatarAdapter.setNewData(avatarList)
+                binding.tvAvatarMore.text = "Show Less"
+                binding.ivAvatarMore.setImageResource(R.mipmap.ic_show_less)
+            } else {
+                avatarAdapter.setNewData(avatarList.subList(0, avatarList.size.coerceAtMost(3)))
+                binding.tvAvatarMore.text = "Show More"
+                binding.ivAvatarMore.setImageResource(R.mipmap.ic_show_more)
+            }
+            isAvatarExpanded = !isAvatarExpanded
+        }
+
+        binding.clBadgeMore.setOnClickListener {
+            if (type == 2)
+                return@setOnClickListener
+            if (isBadgeExpanded) {
+                badgeAdapter.setNewData(badgeList)
+                binding.tvBadgeMore.text = "Show Less"
+                binding.ivBadgeMore.setImageResource(R.mipmap.ic_show_less)
+            } else {
+                badgeAdapter.setNewData(badgeList.subList(0, badgeList.size.coerceAtMost(3)))
+                binding.tvBadgeMore.text = "Show More"
+                binding.ivBadgeMore.setImageResource(R.mipmap.ic_show_more)
+            }
+            isBadgeExpanded = !isBadgeExpanded
+        }
+
+        binding.clBubbleMore.setOnClickListener {
+            if (type == 2)
+                return@setOnClickListener
+            if (isBubbleExpanded) {
+                bubbleAdapter.setNewData(bubbleList)
+                binding.tvBubbleMore.text = "Show Less"
+                binding.ivBubbleMore.setImageResource(R.mipmap.ic_show_less)
+            } else {
+                bubbleAdapter.setNewData(bubbleList.subList(0, bubbleList.size.coerceAtMost(3)))
+                binding.tvBubbleMore.text = "Show More"
+                binding.ivBubbleMore.setImageResource(R.mipmap.ic_show_more)
             }
+            isBubbleExpanded = !isBubbleExpanded
         }
-        adapter.itemClickFun = { typeItem, position ->
-            StoreBuyDialog.newInstance().show(supportFragmentManager ,"StoreBuyDialog")
+        enterAdapter.setOnItemClickListener { _, _, position ->
+            StoreBuyDialog.newInstance(enterAdapter.data[position]).show(supportFragmentManager ,"StoreBuyDialog")
         }
     }
 

+ 0 - 6
user/src/main/java/com/swago/user/store/StoreListBean.kt

@@ -1,6 +0,0 @@
-package com.swago.user.store
-
-data class StoreListBean(
-    val name: String,
-    var isExpanded: Boolean
-)

+ 0 - 39
user/src/main/java/com/swago/user/store/StoreTypeAdapter.kt

@@ -1,39 +0,0 @@
-package com.swago.user.store
-
-import androidx.recyclerview.widget.GridLayoutManager
-import androidx.recyclerview.widget.RecyclerView
-import com.chad.library.adapter.base.BaseQuickAdapter
-import com.chad.library.adapter.base.BaseViewHolder
-import com.swago.user.R
-
-class StoreTypeAdapter: BaseQuickAdapter<StoreListBean, BaseViewHolder>(R.layout.item_type_store, arrayListOf())  {
-    var itemClickFun: ((typeItem: StoreListBean , position:Int) -> Unit)? = null
-
-    override fun convert(helper: BaseViewHolder?, item: StoreListBean?) {
-        val itemAdapter = StoreItemAdapter()
-        val array = arrayListOf("ds", "ferg","dfdg","dfdg")
-        helper?.apply {
-            item?.let {
-                setText(R.id.tvType ,item.name)
-                if (item.isExpanded){
-                    itemAdapter.setNewData(array)
-                    setText(R.id.tvMore ,"Show Less")
-                    setImageResource(R.id.ivMore , R.mipmap.ic_show_less)
-                } else {
-                    itemAdapter.setNewData(array.subList(0 , array.size.coerceAtMost(3)))
-                    setText(R.id.tvMore ,"Show More")
-                    setImageResource(R.id.ivMore , R.mipmap.ic_show_more)
-                }
-                val recyclerView = itemView.findViewById<RecyclerView>(R.id.rvType)
-                recyclerView.layoutManager = GridLayoutManager(mContext, 3)
-                recyclerView.adapter = itemAdapter
-                addOnClickListener(R.id.clMore)
-                itemAdapter.setOnItemClickListener { _, _, postion ->
-                    itemClickFun?.invoke(item,postion)
-                }
-            }
-
-
-        }
-    }
-}

+ 54 - 0
user/src/main/java/com/swago/user/vm/StoreVm.kt

@@ -0,0 +1,54 @@
+package com.swago.user.vm
+
+import android.app.Application
+import androidx.lifecycle.MutableLiveData
+import com.swago.baseswago.inter.ApiManager
+import com.swago.baseswago.model.mine.StoreItemBean
+import com.swago.baseswago.model.mine.TaskModel
+import com.swago.baseswago.util.ActivityManagerUtil
+import com.swago.baseswago.util.BaseViewModel
+import com.swago.baseswago.util.SwagoLoading
+
+class StoreVm(application: Application) : BaseViewModel(application){
+
+    val storeProductData by lazy {
+        MutableLiveData<List<StoreItemBean>?>()
+    }
+
+    fun getProductList(){
+        requestData2 {
+            requestData {
+                val data = ApiManager.userApi.getProductList()
+                storeProductData.value  = data.list
+            }
+            requestError {
+                storeProductData.value = null
+            }
+        }
+    }
+
+    fun buyProduct(productId:Long){
+        requestData2 (){
+            requestData {
+                ApiManager.userApi.buyProduct(productId)
+            }
+
+        }
+    }
+
+    val exitProductData by lazy {
+        MutableLiveData<List<StoreItemBean>?>()
+    }
+
+    fun getExitProductList(){
+        requestData2 {
+            requestData {
+                val data = ApiManager.userApi.exitProductList()
+                exitProductData.value  = data.list
+            }
+            requestError {
+                exitProductData.value = null
+            }
+        }
+    }
+}

+ 247 - 10
user/src/main/res/layout/activity_store_list.xml

@@ -4,6 +4,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="#030417"
+    xmlns:tools="http://schemas.android.com/tools"
     xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <ImageView
@@ -20,17 +21,253 @@
         android:layout_marginTop="25dp"
         app:layout_constraintTop_toTopOf="parent" />
 
-    <FrameLayout
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintBottom_toBottomOf="parent"
-        android:layout_marginTop="81dp"
+    <androidx.core.widget.NestedScrollView
         android:layout_width="match_parent"
-        android:layout_height="0dp">
-
-        <androidx.recyclerview.widget.RecyclerView
-            android:id="@+id/swagoRv"
+        android:layout_height="0dp"
+        android:layout_marginTop="81dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent">
+        <androidx.constraintlayout.widget.ConstraintLayout
             android:layout_width="match_parent"
-            android:layout_height="match_parent" />
+            android:layout_height="match_parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent">
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/clEnterMore"
+                android:layout_width="match_parent"
+                android:layout_height="43dp"
+                android:visibility="gone"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent">
+
+                <com.swago.baseswago.cusview.BoldTextView
+                    android:id="@+id/tvEnterType"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="16dp"
+                    android:textColor="#fff"
+                    android:textSize="@dimen/sp_16"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="入场特效" />
+
+                <com.swago.baseswago.cusview.MediumTextView
+                    android:id="@+id/tvEnterMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="2dp"
+                    android:drawablePadding="2dp"
+                    android:textColor="#99ffffff"
+                    android:textSize="12sp"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toStartOf="@+id/ivEnterMore"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="Show Less" />
+                <ImageView
+                    android:id="@+id/ivEnterMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    android:src="@mipmap/ic_show_more"
+                    android:layout_marginEnd="16dp"/>
+            </androidx.constraintlayout.widget.ConstraintLayout>
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rvEnter"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:layout_marginEnd="8dp"
+                app:layout_constraintTop_toBottomOf="@+id/clEnterMore"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"/>
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/clAvatarMore"
+                android:layout_width="match_parent"
+                android:layout_height="43dp"
+                android:visibility="gone"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/rvEnter">
+
+                <com.swago.baseswago.cusview.BoldTextView
+                    android:id="@+id/tvAvatarType"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="16dp"
+                    android:textColor="#fff"
+                    android:textSize="@dimen/sp_16"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="头像框" />
 
-    </FrameLayout>
+                <com.swago.baseswago.cusview.MediumTextView
+                    android:id="@+id/tvAvatarMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="2dp"
+                    android:drawablePadding="2dp"
+                    android:textColor="#99ffffff"
+                    android:textSize="12sp"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toStartOf="@+id/ivAvatarMore"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="Show Less" />
+                <ImageView
+                    android:id="@+id/ivAvatarMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    android:src="@mipmap/ic_show_more"
+                    android:layout_marginEnd="16dp"/>
+            </androidx.constraintlayout.widget.ConstraintLayout>
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rvAvatar"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:layout_marginEnd="8dp"
+                app:layout_constraintTop_toBottomOf="@+id/clAvatarMore"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"/>
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/clBadgeMore"
+                android:layout_width="match_parent"
+                android:layout_height="43dp"
+                android:visibility="gone"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/rvAvatar">
+
+                <com.swago.baseswago.cusview.BoldTextView
+                    android:id="@+id/tvBadgeType"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="16dp"
+                    android:textColor="#fff"
+                    android:textSize="@dimen/sp_16"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="徽章" />
+
+                <com.swago.baseswago.cusview.MediumTextView
+                    android:id="@+id/tvBadgeMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="2dp"
+                    android:drawablePadding="2dp"
+                    android:textColor="#99ffffff"
+                    android:textSize="12sp"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toStartOf="@+id/ivBadgeMore"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="Show Less" />
+                <ImageView
+                    android:id="@+id/ivBadgeMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    android:src="@mipmap/ic_show_more"
+                    android:layout_marginEnd="16dp"/>
+            </androidx.constraintlayout.widget.ConstraintLayout>
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rvBadge"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:layout_marginEnd="8dp"
+                app:layout_constraintTop_toBottomOf="@+id/clBadgeMore"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"/>
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/clBubbleMore"
+                android:layout_width="match_parent"
+                android:layout_height="43dp"
+                android:visibility="gone"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/rvBadge">
+
+                <com.swago.baseswago.cusview.BoldTextView
+                    android:id="@+id/tvBubbleType"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="16dp"
+                    android:textColor="#fff"
+                    android:textSize="@dimen/sp_16"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="聊天气泡" />
+
+                <com.swago.baseswago.cusview.MediumTextView
+                    android:id="@+id/tvBubbleMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="2dp"
+                    android:drawablePadding="2dp"
+                    android:textColor="#99ffffff"
+                    android:textSize="12sp"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toStartOf="@+id/ivBubbleMore"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="Show Less" />
+                <ImageView
+                    android:id="@+id/ivBubbleMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    android:src="@mipmap/ic_show_more"
+                    android:layout_marginEnd="16dp"/>
+            </androidx.constraintlayout.widget.ConstraintLayout>
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rvBubble"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:layout_marginEnd="8dp"
+                app:layout_constraintTop_toBottomOf="@+id/clBubbleMore"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"/>
+        </androidx.constraintlayout.widget.ConstraintLayout>
+    </androidx.core.widget.NestedScrollView>
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/clEmpty"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_marginTop="81dp"
+        android:visibility="gone"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent">
+        <ImageView
+            android:id="@+id/ivEmpty"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@mipmap/state_error_empty"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent" />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textSize="14sp"
+            android:textColor="@color/_ffffff"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/ivEmpty"
+            android:text="@string/There_is_nothing_here"
+            android:layout_marginTop="@dimen/dp_4"/>
+    </androidx.constraintlayout.widget.ConstraintLayout>
 </androidx.constraintlayout.widget.ConstraintLayout>

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

@@ -52,6 +52,7 @@
                 tools:text="fgg" />
 
             <com.swago.baseswago.cusview.MediumTextView
+                android:id="@+id/tvBuy"
                 android:layout_width="match_parent"
                 android:layout_height="44dp"
                 android:layout_marginStart="17dp"
@@ -59,7 +60,7 @@
                 android:layout_marginEnd="17dp"
                 android:background="@drawable/shape_9b20fc_20"
                 android:gravity="center"
-                android:text="Buy Now"
+                android:text="@string/buy_it_now"
                 android:textColor="@color/_ffffff"
                 android:textSize="@dimen/sp_16"
                 app:layout_constraintTop_toBottomOf="@+id/tv_coin" />

+ 12 - 1
user/src/main/res/layout/item_store.xml

@@ -15,7 +15,6 @@
         android:background="@drawable/shape_0fffffff_4"
         app:layout_constraintDimensionRatio="h,52:66"
         app:layout_constraintTop_toTopOf="parent">
-
         <ImageView
             android:id="@+id/iv_svg"
             android:layout_width="90dp"
@@ -50,6 +49,18 @@
             android:drawableStart="@mipmap/ic_coin_store"
             android:textSize="10sp"
             android:textColor="#A3FFFFFF"/>
+        <TextView
+            android:id="@+id/tvUsing"
+            android:layout_width="51dp"
+            android:layout_height="18dp"
+            android:textSize="@dimen/sp_12"
+            android:textColor="@color/_ffffff"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            android:text="Using"
+            android:gravity="center"
+            android:visibility="gone"
+            android:background="@drawable/shape_8c25cb_top_bottom_one_4"/>
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 0 - 57
user/src/main/res/layout/item_type_store.xml

@@ -1,57 +0,0 @@
-<?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"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-
-    <androidx.constraintlayout.widget.ConstraintLayout
-        android:id="@+id/clMore"
-        android:layout_width="match_parent"
-        android:layout_height="43dp"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent">
-
-        <com.swago.baseswago.cusview.BoldTextView
-            android:id="@+id/tvType"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginStart="16dp"
-            android:textColor="#fff"
-            android:textSize="@dimen/sp_16"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent"
-            tools:text="Enter" />
-
-        <com.swago.baseswago.cusview.MediumTextView
-            android:id="@+id/tvMore"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginEnd="2dp"
-            android:drawablePadding="2dp"
-            android:textColor="#99ffffff"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toStartOf="@+id/ivMore"
-            app:layout_constraintTop_toTopOf="parent"
-            android:text="Show Less" />
-        <ImageView
-            android:id="@+id/ivMore"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            app:layout_constraintTop_toTopOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            android:src="@mipmap/ic_show_more"
-            android:layout_marginEnd="16dp"/>
-    </androidx.constraintlayout.widget.ConstraintLayout>
-
-    <androidx.recyclerview.widget.RecyclerView
-        android:id="@+id/rvType"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="4dp"
-        android:layout_marginEnd="4dp"
-        app:layout_constraintTop_toBottomOf="@+id/clMore"/>
-</androidx.constraintlayout.widget.ConstraintLayout>