5 次代码提交 4e2e866861 ... 85e5f5556f

作者 SHA1 备注 提交日期
  tongmengxiao 85e5f5556f 用户信息弹框 5 月之前
  tongmengxiao 20dd70a90f feat: 清除缓存 5 月之前
  tongmengxiao c6632dc866 feat: 未读消息 5 月之前
  tongmengxiao 3974fd0f08 feat: 商城 5 月之前
  tongmengxiao f6b921fa88 feat: music 5 月之前
共有 67 个文件被更改,包括 1470 次插入34 次删除
  1. 2 0
      app/src/main/AndroidManifest.xml
  2. 7 2
      baseswago/src/main/java/com/swago/baseswago/PersonDataDFragment.kt
  3. 17 0
      baseswago/src/main/java/com/swago/baseswago/UserVm.kt
  4. 5 0
      baseswago/src/main/java/com/swago/baseswago/agora/AgoraManager.kt
  5. 2 0
      baseswago/src/main/java/com/swago/baseswago/constant/ARouteConstant.kt
  6. 16 0
      baseswago/src/main/java/com/swago/baseswago/model/UnreadMessageVm.kt
  7. 16 0
      baseswago/src/main/java/com/swago/baseswago/model/ViewModelProviderUtil.kt
  8. 14 0
      baseswago/src/main/java/com/swago/baseswago/util/FileUtil.kt
  9. 21 0
      baseswago/src/main/java/com/swago/baseswago/util/IMUtil.kt
  10. 5 0
      baseswago/src/main/res/drawable/shape_d54941_circle.xml
  11. 二进制
      baseswago/src/main/res/mipmap-xxhdpi/bg_store.png
  12. 2 0
      baseswago/src/main/res/values-ar/strings.xml
  13. 2 0
      baseswago/src/main/res/values-in/strings.xml
  14. 3 0
      baseswago/src/main/res/values-ms/strings.xml
  15. 2 0
      baseswago/src/main/res/values-zh/strings.xml
  16. 2 0
      baseswago/src/main/res/values/strings.xml
  17. 21 0
      home/src/main/java/com/swago/home/ChatDetailActivity.kt
  18. 17 1
      home/src/main/java/com/swago/home/HomeActivity.kt
  19. 12 0
      home/src/main/java/com/swago/home/MineFragment.kt
  20. 17 0
      home/src/main/res/layout/activity_home.xml
  21. 35 6
      home/src/main/res/layout/fragment_mine.xml
  22. 二进制
      home/src/main/res/mipmap-xxhdpi/icon_my_outfit.png
  23. 二进制
      home/src/main/res/mipmap-xxhdpi/icon_my_store.png
  24. 1 1
      room/src/main/AndroidManifest.xml
  25. 4 0
      room/src/main/java/com/swago/room/anchor/AnchorRoomFragment.kt
  26. 21 2
      room/src/main/java/com/swago/room/base/BaseComFragment.kt
  27. 8 0
      room/src/main/java/com/swago/room/dialog/AudienceListDialog.kt
  28. 16 1
      room/src/main/java/com/swago/room/dialog/FooterMoreDialog.kt
  29. 76 0
      room/src/main/java/com/swago/room/music/LocalMusicActivity.kt
  30. 31 0
      room/src/main/java/com/swago/room/music/LocalMusicAdapter.kt
  31. 44 0
      room/src/main/java/com/swago/room/music/MusicModel.kt
  32. 72 0
      room/src/main/java/com/swago/room/music/MusicVm.kt
  33. 19 0
      room/src/main/java/com/swago/room/music/MyMusicAdapter.kt
  34. 130 0
      room/src/main/java/com/swago/room/music/MyMusicDialog.kt
  35. 4 0
      room/src/main/java/com/swago/room/user/UserRoomFragment.kt
  36. 9 0
      room/src/main/java/com/swago/room/widget/UserFooterView.kt
  37. 6 0
      room/src/main/res/drawable/live_music_check.xml
  38. 6 0
      room/src/main/res/drawable/local_select_music.xml
  39. 55 0
      room/src/main/res/layout/activity_local_music.xml
  40. 46 12
      room/src/main/res/layout/dialog_footer_more.xml
  41. 121 0
      room/src/main/res/layout/dialog_my_music.xml
  42. 58 0
      room/src/main/res/layout/item_local_music.xml
  43. 67 0
      room/src/main/res/layout/item_my_music.xml
  44. 29 7
      room/src/main/res/layout/layout_user_footer_view.xml
  45. 二进制
      room/src/main/res/mipmap-xxhdpi/ic_add_music.png
  46. 二进制
      room/src/main/res/mipmap-xxhdpi/ic_music_check.png
  47. 二进制
      room/src/main/res/mipmap-xxhdpi/ic_music_close.png
  48. 二进制
      room/src/main/res/mipmap-xxhdpi/ic_music_uncheck.png
  49. 二进制
      room/src/main/res/mipmap-xxhdpi/ic_recall.png
  50. 二进制
      room/src/main/res/mipmap-xxhdpi/live_music.png
  51. 2 0
      user/src/main/AndroidManifest.xml
  52. 二进制
      user/src/main/assets/jojo_audio.svga
  53. 6 0
      user/src/main/java/com/swago/user/SettingActivity.kt
  54. 74 0
      user/src/main/java/com/swago/user/store/StoreBuyDialog.kt
  55. 16 0
      user/src/main/java/com/swago/user/store/StoreItemAdapter.kt
  56. 51 0
      user/src/main/java/com/swago/user/store/StoreListActivity.kt
  57. 6 0
      user/src/main/java/com/swago/user/store/StoreListBean.kt
  58. 39 0
      user/src/main/java/com/swago/user/store/StoreTypeAdapter.kt
  59. 5 0
      user/src/main/res/drawable/shape_0fffffff_4.xml
  60. 13 2
      user/src/main/res/layout/activity_setting.xml
  61. 36 0
      user/src/main/res/layout/activity_store_list.xml
  62. 69 0
      user/src/main/res/layout/dialog_store_detail.xml
  63. 55 0
      user/src/main/res/layout/item_store.xml
  64. 57 0
      user/src/main/res/layout/item_type_store.xml
  65. 二进制
      user/src/main/res/mipmap-xxhdpi/ic_coin_store.png
  66. 二进制
      user/src/main/res/mipmap-xxhdpi/ic_show_less.png
  67. 二进制
      user/src/main/res/mipmap-xxhdpi/ic_show_more.png

+ 2 - 0
app/src/main/AndroidManifest.xml

@@ -34,6 +34,8 @@
         android:label="@string/app_name"
         android:roundIcon="@mipmap/ic_launcher_round"
         android:supportsRtl="true"
+        android:usesCleartextTraffic="true"
+        android:requestLegacyExternalStorage="true"
         android:theme="@style/Theme.Swago">
         <activity android:name=".SplashActivity"
             android:exported="true"

+ 7 - 2
baseswago/src/main/java/com/swago/baseswago/PersonDataDFragment.kt

@@ -38,6 +38,7 @@ class PersonDataDFragment : BaseXDFragment<DialogPersonDataBinding>() {
     var roomId:String = ""
     var isAnchor = false //是否是主播点击了资料卡
     var isAdmin = false
+    var isMessage = false
     private var inRoom = false
     private var isForbid = 0 //0没有被禁言  1已被禁言
     var openGiftDialog:((nickName:String,userId:String)->Unit)? = null
@@ -45,13 +46,14 @@ class PersonDataDFragment : BaseXDFragment<DialogPersonDataBinding>() {
     var sendMsgInRoom:((nickName:String)->Unit)? = null
 
     companion object{
-        fun newInstance(uid:String,isAnchor:Boolean=false,inRoom:Boolean=false,roomId:String=""): PersonDataDFragment {
+        fun newInstance(uid:String,isAnchor:Boolean=false,inRoom:Boolean=false,roomId:String="",isMessage:Boolean=false): PersonDataDFragment {
             val dialog = PersonDataDFragment()
             val bundle = Bundle()
             bundle.putString("uid",uid)
             bundle.putBoolean("inRoom",inRoom)
             bundle.putBoolean("isAnchor",isAnchor)
             bundle.putString("roomId",roomId)
+            bundle.putBoolean("isMessage",isMessage)
             dialog.arguments = bundle
             return dialog
         }
@@ -64,13 +66,16 @@ class PersonDataDFragment : BaseXDFragment<DialogPersonDataBinding>() {
             inRoom = it.getBoolean("inRoom")
             isAnchor = it.getBoolean("isAnchor")
             roomId = it.getString("roomId","")
+            isMessage = it.getBoolean("isMessage")
             if (!TextUtils.isEmpty(uid)){
                 userVm.getOtherUserInfo(uid,roomId)
             }
 
             UserInfo.getUserInfo()?.let {
                 if (it.id == uid){
-//                    binding.ivGift.visibility = View.GONE
+                    if (isMessage){
+                        binding.ivGift.visibility = View.GONE
+                    }
                     binding.tvAt.visibility = View.GONE
                     binding.llChat.visibility = View.GONE
                     binding.llToFollow.visibility = View.GONE

+ 17 - 0
baseswago/src/main/java/com/swago/baseswago/UserVm.kt

@@ -11,6 +11,10 @@ import com.swago.baseswago.model.mine.LevelModel
 import com.swago.baseswago.model.mine.RoomBlack
 import com.swago.baseswago.model.mine.RoomBlackItem
 import com.swago.baseswago.util.*
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
 import okhttp3.MediaType.Companion.toMediaTypeOrNull
 import okhttp3.MultipartBody
 import okhttp3.RequestBody
@@ -322,4 +326,17 @@ class UserVm(application: Application) : BaseViewModel(application) {
         }
 
     }
+
+    fun clearCache(){
+        CoroutineScope(Dispatchers.Main).launch {
+            withContext(Dispatchers.IO){
+                FileUtil.clearCache(AppContext.getContext())
+            }
+            Toast.makeText(
+                AppContext.getContext(),
+                AppContext.getContext().resources.getString(R.string.clear_cache_success),
+                Toast.LENGTH_SHORT
+            ).show()
+        }
+    }
 }

+ 5 - 0
baseswago/src/main/java/com/swago/baseswago/agora/AgoraManager.kt

@@ -120,6 +120,11 @@ object AgoraManager {
                         super.onFacePositionChanged(imageWidth, imageHeight, faces)
                         iSwagoIRtcEngineEventHandler?.onFacePositionChanged(imageWidth,imageHeight,faces)
                     }
+
+                    override fun onAudioMixingStateChanged(state: Int, reason: Int) {
+                        super.onAudioMixingStateChanged(state, reason)
+                        LogUtil.d("onAudioMixingStateChanged" , "结果--$state  $reason")
+                    }
                 })
             setChannelProfile()
         } catch (e: Exception) {

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

@@ -27,6 +27,7 @@ object ARouteConstant {
         const val coinTransfer = "$rootPath/CoinTransferActivity"
         const val transferDetail = "$rootPath/TransferDetailsActivity"
         const val modifyPwd = "$rootPath/ModifyPwdActivity"
+        const val storeList = "$rootPath/StoreListActivity"
     }
 
     object Home {
@@ -47,6 +48,7 @@ object ARouteConstant {
         const val user = "$rootPath/UserRoomActivity"
         const val rankList = "$rootPath/RankListActivity"
         const val black = "$rootPath/BlackRoomActivity"
+        const val musicList = "$rootPath/LocalMusicActivity"
     }
 
 }

+ 16 - 0
baseswago/src/main/java/com/swago/baseswago/model/UnreadMessageVm.kt

@@ -0,0 +1,16 @@
+package com.swago.baseswago.model
+
+import android.app.Application
+import androidx.lifecycle.MutableLiveData
+import com.swago.baseswago.util.BaseViewModel
+
+class UnreadMessageVm (application: Application) : BaseViewModel(application){
+
+    val unreadMessageData by lazy {
+        MutableLiveData<Long>()
+    }
+
+    fun setTotalUnreadCount(count: Long) {
+        unreadMessageData.value = count
+    }
+}

+ 16 - 0
baseswago/src/main/java/com/swago/baseswago/model/ViewModelProviderUtil.kt

@@ -0,0 +1,16 @@
+package com.swago.baseswago.model
+
+import android.app.Application
+import androidx.lifecycle.ViewModelProvider
+
+object ViewModelProviderUtil {
+    private var unreadMessageViewModel: UnreadMessageVm? = null
+
+    fun getUnreadMessageViewModel(application: Application): UnreadMessageVm {
+        if (unreadMessageViewModel == null) {
+            unreadMessageViewModel = ViewModelProvider.AndroidViewModelFactory(application)
+                .create(UnreadMessageVm::class.java)
+        }
+        return unreadMessageViewModel!!
+    }
+}

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

@@ -1,5 +1,6 @@
 package com.swago.baseswago.util
 
+import android.app.Application
 import java.io.*
 import java.lang.Exception
 import java.util.*
@@ -99,4 +100,17 @@ object FileUtil {
         }
     }
 
+    fun clearCache(context : Application){
+        deleteFile(File(AppContext.getContext().cacheDir.absolutePath))
+        deleteFile(File(AppContext.getContext().filesDir.absolutePath))
+        val externalFile = context.getExternalFilesDir("")
+        if (externalFile != null){
+            deleteFile(File(externalFile.absolutePath))
+        }
+        val externalCache = context.externalCacheDir
+        if (externalCache != null){
+            deleteFile(File(externalCache.absolutePath))
+        }
+    }
+
 }

+ 21 - 0
baseswago/src/main/java/com/swago/baseswago/util/IMUtil.kt

@@ -85,4 +85,25 @@ object IMUtil {
             loginCallback?.invoke()
         }
     }
+
+    /**
+     * 未读消息数
+     * */
+    fun updateUnreadMessageCount(call:(total:Long)->Unit){
+        V2TIMManager.getConversationManager().getTotalUnreadMessageCount(object :V2TIMValueCallback<Long>{
+            override fun onSuccess(totalUnreadCount: Long) {
+                call.invoke(totalUnreadCount)
+            }
+
+            override fun onError(code: Int, desc: String?) {
+
+            }
+        })
+        V2TIMManager.getConversationManager().addConversationListener(object :V2TIMConversationListener(){
+            override fun onTotalUnreadMessageCountChanged(totalUnreadCount: Long) {
+                super.onTotalUnreadMessageCountChanged(totalUnreadCount)
+                call.invoke(totalUnreadCount)
+            }
+        })
+    }
 }

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

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

二进制
baseswago/src/main/res/mipmap-xxhdpi/bg_store.png


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

@@ -329,4 +329,6 @@
     <string name="loading">تحميل...</string>
     <string name="modify_success">حفظ بنجاح</string>
     <string name="Password_rooms_do_not_count_as_hours">أوقات غرفة القفل لم يتم احتسابها في المدة</string>
+    <string name="clear_cache">مسح ذاكرة التخزين المؤقت</string>
+    <string name="clear_cache_success">مسح ذاكرة التخزين المؤقت بنجاح</string>
 </resources>

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

@@ -341,4 +341,6 @@
     <string name="loading">loading...</string>
     <string name="modify_success">Berhasil dimodifikasi</string>
     <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>
 </resources>

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

@@ -341,4 +341,7 @@
     <string name="loading">loading...</string>
     <string name="modify_success">Berhasil dimodifikasi</string>
     <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>
+
 </resources>

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

@@ -329,4 +329,6 @@
     <string name="loading">loading...</string>
     <string name="modify_success">修改成功</string>
     <string name="Password_rooms_do_not_count_as_hours">密码房不计入时长</string>
+    <string name="clear_cache">清除缓存</string>
+    <string name="clear_cache_success">清除成功</string>
 </resources>

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

@@ -361,4 +361,6 @@
     <string name="loading">loading...</string>
     <string name="modify_success">Modify success</string>
     <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>
 </resources>

+ 21 - 0
home/src/main/java/com/swago/home/ChatDetailActivity.kt

@@ -10,6 +10,7 @@ import com.alibaba.android.arouter.facade.annotation.Route
 import com.alibaba.android.arouter.launcher.ARouter
 import com.google.gson.Gson
 import com.gyf.immersionbar.ImmersionBar
+import com.swago.baseswago.PersonDataDFragment
 import com.swago.baseswago.UserVm
 import com.swago.baseswago.dialog.ReportBlockDialogFragment
 import com.swago.baseswago.activity.BaseXActivity
@@ -20,6 +21,9 @@ import com.swago.baseswago.util.UserInfo
 import com.swago.home.databinding.ActivityChatDetailBinding
 import com.tencent.imsdk.v2.V2TIMConversation
 import com.tencent.qcloud.tim.uikit.modules.chat.base.ChatInfo
+import com.tencent.qcloud.tim.uikit.modules.chat.layout.message.MessageLayout
+import com.tencent.qcloud.tim.uikit.modules.message.MessageInfo
+import com.tencent.qcloud.tim.uikit.utils.ToastUtil
 
 /**
  *@date 2021/8/24 15:01
@@ -76,6 +80,23 @@ class ChatDetailActivity  : BaseXActivity<ActivityChatDetailBinding>() {
             UserInfo.setUserInfo(it)
             SpUtil.putString("user_info", Gson().toJson(it))
         }
+
+        val messageRecyclerView = binding.chatLayout.messageLayout
+        messageRecyclerView.setOnItemClickListener(object : MessageLayout.OnItemLongClickListener{
+            override fun onMessageLongClick(view: View?, position: Int, messageInfo: MessageInfo?) {
+
+            }
+
+            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")
+                }
+            }
+        })
     }
 
     override fun initLiveData() {

+ 17 - 1
home/src/main/java/com/swago/home/HomeActivity.kt

@@ -1,6 +1,7 @@
 package com.swago.home
 
 import android.text.TextUtils
+import android.view.View
 import android.widget.Toast
 import androidx.activity.viewModels
 import androidx.fragment.app.FragmentActivity
@@ -22,6 +23,8 @@ import com.swago.baseswago.im.IMMessageManager
 import com.swago.baseswago.inter.ApiManager
 import com.swago.baseswago.libpay.IPayCallback
 import com.swago.baseswago.libpay.PayManager
+import com.swago.baseswago.model.UnreadMessageVm
+import com.swago.baseswago.model.ViewModelProviderUtil
 import com.swago.baseswago.model.pay.PayModel
 import com.swago.baseswago.util.*
 import com.swago.home.databinding.ActivityHomeBinding
@@ -46,7 +49,7 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
     private val officialVm by viewModels<OfficialVm>()
     private val homeVm by viewModels<HomeVm>()
     private val payVm by viewModels<PayVm>()
-    private val userVm by viewModels<UserVm>()
+    private lateinit var unreadMessageVm: UnreadMessageVm
 
     private val listFragment =
         arrayListOf(HomeFragment(), MessageFragment(), MineFragment())
@@ -56,6 +59,7 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
     }
 
     override fun initOther() {
+        unreadMessageVm = ViewModelProviderUtil.getUnreadMessageViewModel(application)
         TUIKit.init(this, UrlConstant.getImId(), TUIKitConfigs.getConfigs())
         PayManager.init()
         IMMessageManager.groupMessageParser.add(GroupMsgParser())
@@ -117,6 +121,15 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
         })
 
         binding.viewPager.adapter = SwagoAdapter(listFragment, supportFragmentManager)
+        unreadMessageVm.unreadMessageData.observe(this){
+            if (it > 0){
+                binding.tvMessageNum.visibility = View.VISIBLE
+                binding.tvMessageNum.text = "$it"
+            } else {
+                binding.tvMessageNum.visibility = View.GONE
+            }
+
+        }
     }
 
     /**
@@ -288,6 +301,9 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
                 IUIKitCallBack {
                 override fun onSuccess(data: Any?) {
                     IMUtil.joinGroup(null)
+                    IMUtil.updateUnreadMessageCount {unread->
+                        unreadMessageVm.setTotalUnreadCount(unread)
+                    }
                 }
 
                 override fun onError(module: String?, errCode: Int, errMsg: String?) {

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

@@ -156,6 +156,18 @@ class MineFragment : BaseXFragment<FragmentMineBinding>() {
             }
         })
 
+        binding.tvXStore.setOnClickListener(object :NoDoubleClickListener(){
+            override fun onClick() {
+                ARouter.getInstance().build(ARouteConstant.User.storeList).navigation()
+            }
+        })
+
+        binding.tvXoutfit.setOnClickListener(object :NoDoubleClickListener(){
+            override fun onClick() {
+                ARouter.getInstance().build(ARouteConstant.User.storeList).navigation()
+            }
+        })
+
         payVm.getBenefit()
     }
 

+ 17 - 0
home/src/main/res/layout/activity_home.xml

@@ -1,6 +1,7 @@
 <?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="match_parent">
 
@@ -51,4 +52,20 @@
 
     </RadioGroup>
 
+    <TextView
+        android:id="@+id/tvMessageNum"
+        android:layout_width="12dp"
+        android:layout_height="12dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginBottom="28dp"
+        android:layout_marginStart="18dp"
+        android:textColor="#fff"
+        tools:text="1"
+        android:textSize="8sp"
+        android:gravity="center"
+        android:visibility="gone"
+        android:background="@drawable/shape_d54941_circle"/>
+
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 35 - 6
home/src/main/res/layout/fragment_mine.xml

@@ -270,7 +270,7 @@
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/frameLayout"
         android:layout_width="match_parent"
-        android:layout_height="80dp"
+        android:layout_height="wrap_content"
         android:layout_marginStart="16dp"
         android:layout_marginTop="21dp"
         android:layout_marginEnd="16dp"
@@ -286,7 +286,7 @@
             android:text="@string/level"
             android:textColor="#131B23"
             android:textSize="12dp"
-            app:layout_constraintBottom_toBottomOf="parent"
+            android:layout_marginTop="12dp"
             app:layout_constraintEnd_toStartOf="@+id/tvXTopUp"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
@@ -300,7 +300,7 @@
             android:text="@string/top_up"
             android:textColor="#131B23"
             android:textSize="12dp"
-            app:layout_constraintBottom_toBottomOf="parent"
+            android:layout_marginTop="12dp"
             app:layout_constraintEnd_toStartOf="@+id/tvXWithdrawal"
             app:layout_constraintStart_toEndOf="@+id/tvXLevel"
             app:layout_constraintTop_toTopOf="parent" />
@@ -314,8 +314,8 @@
             android:text="@string/withdrawal"
             android:textColor="#131B23"
             android:textSize="12dp"
+            android:layout_marginTop="12dp"
             android:visibility="gone"
-            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toStartOf="@+id/tvXTaskCenter"
             app:layout_constraintStart_toEndOf="@+id/tvXTopUp"
             app:layout_constraintTop_toTopOf="parent" />
@@ -329,11 +329,40 @@
             android:text="@string/task_center"
             android:textColor="#131B23"
             android:textSize="12dp"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
+            android:layout_marginTop="12dp"
             app:layout_constraintStart_toEndOf="@+id/tvXWithdrawal"
+            app:layout_constraintEnd_toStartOf="@+id/tvXStore"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <com.swago.baseswago.cusview.RegularTextView
+            android:id="@+id/tvXStore"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:drawableTop="@mipmap/icon_my_store"
+            android:drawablePadding="2dp"
+            android:text="@string/task_center"
+            android:textColor="#131B23"
+            android:textSize="12dp"
+            android:layout_marginTop="12dp"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toEndOf="@+id/tvXTaskCenter"
             app:layout_constraintTop_toTopOf="parent" />
 
+        <com.swago.baseswago.cusview.RegularTextView
+            android:id="@+id/tvXoutfit"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:drawableTop="@mipmap/icon_my_outfit"
+            android:drawablePadding="2dp"
+            android:text="@string/level"
+            android:textColor="#131B23"
+            android:textSize="12dp"
+            android:layout_marginTop="12dp"
+            android:layout_marginBottom="12dp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toStartOf="@+id/tvXTopUp"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/tvXLevel" />
 
     </androidx.constraintlayout.widget.ConstraintLayout>
 

二进制
home/src/main/res/mipmap-xxhdpi/icon_my_outfit.png


二进制
home/src/main/res/mipmap-xxhdpi/icon_my_store.png


+ 1 - 1
room/src/main/AndroidManifest.xml

@@ -14,7 +14,7 @@
             android:screenOrientation="portrait"/>
         <activity android:name=".wishgift.FanClubRuleActivity"
             android:screenOrientation="portrait"/>
-        <activity android:name=".black.BlackRoomActivity"
+        <activity android:name=".music.LocalMusicActivity"
             android:screenOrientation="portrait"/>
         <service android:name=".service.AgoraForegroundService"/>
     </application>

+ 4 - 0
room/src/main/java/com/swago/room/anchor/AnchorRoomFragment.kt

@@ -156,6 +156,10 @@ class AnchorRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
         lianMaiVm.showLianMaiDotFun = {
             (iFooter as AnchorFooterView).showLianMaiDot()
         }
+
+        unreadMessageVm.unreadMessageData.observe(this) {
+            unReadNum = it
+        }
     }
 
     private fun openLianMaiListDialog() {

+ 21 - 2
room/src/main/java/com/swago/room/base/BaseComFragment.kt

@@ -36,6 +36,8 @@ import com.swago.baseswago.dialog.ChoiceDialogFragment
 import com.swago.baseswago.dialog.ReportDialog
 import com.swago.baseswago.fragment.BaseXFragment
 import com.swago.baseswago.im.IRoomChat
+import com.swago.baseswago.model.UnreadMessageVm
+import com.swago.baseswago.model.ViewModelProviderUtil
 import com.swago.baseswago.model.im.GamePrize
 import com.swago.baseswago.model.im.RoomSystemMsgBean
 import com.swago.baseswago.model.live.RoomConfig
@@ -77,6 +79,7 @@ import com.swago.room.hongbao.RedEnvelopeDialog
 import com.swago.room.inter.IFooter
 import com.swago.room.inter.IHeader
 import com.swago.room.lianmai.LianMaiVm
+import com.swago.room.music.MyMusicDialog
 import com.swago.room.piaotiao.WaftManager
 import com.swago.room.pk.IPKListener
 import com.swago.room.pk.PKStateManager
@@ -113,6 +116,7 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
     val roomOtherVm by activityViewModels<RoomOtherVm>()
     val msgVm by activityViewModels<MsgVm>()
     val userVm by activityViewModels<UserVm>()
+    lateinit var unreadMessageVm: UnreadMessageVm
 
     /**
      * 麦位信息
@@ -121,6 +125,7 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
         CopyOnWriteArrayList<PositionBean>()
     }
     var count = 2
+    var unReadNum:Long = 0
 
     //直播间观众列表
     var roomUserList = CopyOnWriteArrayList<RoomUserModel.ListBean>()
@@ -175,6 +180,7 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
     }
 
     override fun initOther() {
+        unreadMessageVm = ViewModelProviderUtil.getUnreadMessageViewModel(AppContext.getContext())
         RoomTimer.timeTickList.add(this)
         PKStateManager.addPKListener(this)
         SwagoRoomManager.addListener(this)
@@ -445,7 +451,13 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
         }
 
         (iHeader as ComHeaderView).openAudienceListDialog = {
-            AudienceListDialog.newInstance().show(childFragmentManager, "AudienceListDialog")
+            AudienceListDialog.newInstance().apply {
+                this.showUserInfo = {userid ->
+                   PersonDataDFragment.newInstance(userid,
+                       isAnchor = false,
+                       inRoom = true).show(this@BaseComFragment.childFragmentManager,"PersonDataDFragment")
+                }
+            }.show(childFragmentManager, "AudienceListDialog")
         }
 
         (iHeader as ComHeaderView).showFanClubFun = {
@@ -616,6 +628,10 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
         ShareDialog.newInstance().show(childFragmentManager,"ShareDialog")
     }
 
+    fun openMusicDialog() {
+        MyMusicDialog.newInstance().show(childFragmentManager,"MyMusicDialog")
+    }
+
     private fun initMaiPosition() {
         allPositionXYList.clear()
         val centerX = DpPxUtil.getScreenWidth() / 2
@@ -726,13 +742,16 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
     }
 
     fun openMoreDialog(){
-        FooterMoreDialog.newInstance().apply {
+        FooterMoreDialog.newInstance(unReadNum).apply {
             openMessageFun = {
                 openMessageListDialog()
             }
             openShareFun = {
                 openShareDialog()
             }
+            openMusicFun = {
+                openMusicDialog()
+            }
         }.show(childFragmentManager , "FooterMoreDialog")
     }
 

+ 8 - 0
room/src/main/java/com/swago/room/dialog/AudienceListDialog.kt

@@ -29,6 +29,7 @@ import de.hdodenhof.circleimageview.CircleImageView
 class AudienceListDialog : BaseListDialogFragment<DialogAudienceListBinding,RoomUserModel.ListBean>() {
 
     private val roomVm by activityViewModels<RoomVm>()
+    var showUserInfo:((id:String)->Unit)? = null
 
     init {
         setGravity(Gravity.BOTTOM)
@@ -75,6 +76,13 @@ class AudienceListDialog : BaseListDialogFragment<DialogAudienceListBinding,Room
 
            }
        }
+
+        adapter.setOnItemClickListener { _, _, position ->
+            if (adapter.data.size>position){
+                showUserInfo?.invoke(adapter.data[position].user_id)
+                dismissAllowingStateLoss()
+            }
+        }
     }
 
 

+ 16 - 1
room/src/main/java/com/swago/room/dialog/FooterMoreDialog.kt

@@ -18,6 +18,7 @@ class FooterMoreDialog : BaseXDFragment<DialogFooterMoreBinding>() {
 
     var openMessageFun:(()->Unit)? = null
     var openShareFun:(()->Unit)? = null
+    var openMusicFun:(()->Unit)? = null
 
     init {
         setGravity(Gravity.BOTTOM)
@@ -26,8 +27,9 @@ class FooterMoreDialog : BaseXDFragment<DialogFooterMoreBinding>() {
     }
 
     companion object{
-        fun newInstance(): FooterMoreDialog {
+        fun newInstance(unReadNum:Long): FooterMoreDialog {
             val args = Bundle()
+            args.putLong("unReadNum", unReadNum)
             val fragment = FooterMoreDialog()
             fragment.arguments = args
             return fragment
@@ -39,6 +41,15 @@ class FooterMoreDialog : BaseXDFragment<DialogFooterMoreBinding>() {
     }
 
     override fun initLiveData() {
+        arguments?.let {
+            val unReadNum = it.getLong("unReadNum",0)
+            if (unReadNum > 0){
+                binding.tvNum.visibility = View.VISIBLE
+                binding.tvNum.text = "$unReadNum"
+            } else {
+                binding.tvNum.visibility = View.GONE
+            }
+        }
         binding.ivMessage.setOnClickListener {
             openMessageFun?.invoke()
             dismissAllowingStateLoss()
@@ -47,5 +58,9 @@ class FooterMoreDialog : BaseXDFragment<DialogFooterMoreBinding>() {
             openShareFun?.invoke()
             dismissAllowingStateLoss()
         }
+        binding.ivMusic.setOnClickListener{
+            openMusicFun?.invoke()
+            dismissAllowingStateLoss()
+        }
     }
 }

+ 76 - 0
room/src/main/java/com/swago/room/music/LocalMusicActivity.kt

@@ -0,0 +1,76 @@
+package com.swago.room.music
+
+
+import androidx.activity.viewModels
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import com.alibaba.android.arouter.facade.annotation.Autowired
+import com.alibaba.android.arouter.facade.annotation.Route
+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.databinding.ActivityLocalMusicBinding
+
+@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()
+    }
+
+    private val selectMusicData by lazy {
+        ArrayList<MusicModel>()
+    }
+
+    val layoutManager: RecyclerView.LayoutManager
+        get() = LinearLayoutManager(this)
+
+    override fun loadData() {
+        musicVm.loadMediaItems()
+    }
+
+    override fun initOther() {
+        setBackView(binding.toolbar.ivBack)
+        binding.toolbar.tvTitle.text = AppContext.getContext().resources.getString(R.string.swago_offical_msg)
+
+        binding.rv.layoutManager = layoutManager
+        binding.rv.adapter = adapter
+    }
+
+    override fun initLiveData() {
+        musicVm.musicListData.observe(this){
+            adapter.setNewData(it)
+        }
+
+        binding.cbSelect.setOnCheckedChangeListener { _, isChecked ->
+            if (isChecked){
+                selectMusicData.addAll(adapter.data)
+            } else {
+                selectMusicData.clear()
+            }
+            adapter.setSelectAll(isChecked)
+        }
+
+        binding.tvAdd.setOnClickListener {
+            if (selectMusicData.size == 0){
+                return@setOnClickListener
+            }
+        }
+
+        adapter.isSelectFun = {
+            musicItem, select ->
+            if (select){
+                selectMusicData.add(musicItem)
+            } else {
+                selectMusicData.remove(musicItem)
+            }
+        }
+    }
+
+}

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

@@ -0,0 +1,31 @@
+package com.swago.room.music
+
+import android.widget.CheckBox
+import com.chad.library.adapter.base.BaseQuickAdapter
+import com.chad.library.adapter.base.BaseViewHolder
+import com.swago.baseswago.cusview.BoldTextView
+import com.swago.baseswago.cusview.MediumTextView
+import com.swago.room.R
+
+class LocalMusicAdapter :  BaseQuickAdapter<MusicModel, BaseViewHolder>(R.layout.item_local_music, arrayListOf())  {
+    var isSelectFun: (( musicModel: MusicModel , select: Boolean) -> Unit)? = null
+
+    fun setSelectAll(isSelect : Boolean){
+        data.forEachIndexed { index, musicModel ->
+            data[index].isSelect = isSelect
+        }
+        notifyDataSetChanged()
+    }
+    override fun convert(helper: BaseViewHolder, item: MusicModel) {
+        helper.apply {
+            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.setOnCheckedChangeListener { _, isChecked ->
+                item.isSelect = isChecked
+               isSelectFun?.invoke(item , isChecked)
+            }
+        }
+    }
+}

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

@@ -0,0 +1,44 @@
+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)
+        }
+    }
+
+}

+ 72 - 0
room/src/main/java/com/swago/room/music/MusicVm.kt

@@ -0,0 +1,72 @@
+package com.swago.room.music
+
+import android.app.Application
+import android.provider.MediaStore
+import androidx.lifecycle.MutableLiveData
+import com.swago.baseswago.util.AppContext
+import com.swago.baseswago.util.BaseViewModel
+import com.swago.baseswago.util.LogUtil
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
+
+class MusicVm(application: Application) : BaseViewModel(application) {
+    val projection = arrayOf(
+        MediaStore.Audio.Media._ID,
+        MediaStore.Audio.Media.TITLE,
+        MediaStore.Audio.Media.DATA,
+        MediaStore.Audio.Media.DURATION)
+    val selection = "${MediaStore.Audio.Media.SIZE} >= ? " +
+            "and ${MediaStore.Audio.Media.DURATION} >= ? " +
+            "and ${MediaStore.Audio.Artists.ARTIST} != ?"
+    val electionArgs = arrayOf("1000000", "200000", "Unknown Artist")
+    val sortOrder = "${MediaStore.Audio.Media._ID} DESC"
+
+    val musicListData by lazy {
+        MutableLiveData<List<MusicModel>>()
+    }
+    fun loadMediaItems(){
+        CoroutineScope(Dispatchers.Main).launch{
+            withContext(Dispatchers.IO){
+                val audioList = mutableListOf<MusicModel>()
+                val cursor = AppContext.getContext().contentResolver.query(
+                    MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
+                    projection,
+                    selection,
+                    electionArgs,
+                    sortOrder
+                )
+                cursor?.use {
+                    val idColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media._ID)
+                    val titleColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE)
+                    val dataColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA)
+                    val durationColumn = it.getColumnIndexOrThrow(MediaStore.Audio.Media.DURATION)
+                    while (it.moveToNext()){
+                        val id = it.getLong(idColumn)
+                        val title = it.getString(titleColumn)
+                        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))
+                    }
+                }
+                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
+    }
+}

+ 19 - 0
room/src/main/java/com/swago/room/music/MyMusicAdapter.kt

@@ -0,0 +1,19 @@
+package com.swago.room.music
+
+import com.chad.library.adapter.base.BaseQuickAdapter
+import com.chad.library.adapter.base.BaseViewHolder
+import com.swago.baseswago.cusview.BoldTextView
+import com.swago.baseswago.cusview.MediumTextView
+import com.swago.room.R
+
+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)
+            addOnClickListener(R.id.ivRecall)
+        }
+    }
+}

+ 130 - 0
room/src/main/java/com/swago/room/music/MyMusicDialog.kt

@@ -0,0 +1,130 @@
+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.room.R
+import com.swago.room.databinding.DialogMyMusicBinding
+
+class MyMusicDialog : BaseListDialogFragment<DialogMyMusicBinding, MusicModel>() {
+    private val musicVm by viewModels<MusicVm>()
+
+    companion object {
+        const val select_local_result = 10002
+        fun newInstance(): MyMusicDialog {
+            val args = Bundle()
+            val fragment = MyMusicDialog()
+            fragment.arguments = args
+            return fragment
+        }
+    }
+
+    init {
+        setGravity(Gravity.BOTTOM)
+        setCanCancel(false)
+        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 {
+            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
+
+            }
+
+        }
+        adapter.setOnItemClickListener { _, _, position ->
+            if (adapter.data.size > position){
+                AgoraManager.getRtcEngine()?.startAudioMixing(
+                    adapter.data[position].data,
+                    false,
+                    false,
+                    -1,
+                    0
+                )
+            }
+
+        }
+        binding.clAdd.setOnClickListener {
+            ARouter.getInstance()
+                .build(ARouteConstant.Room.musicList)
+                .withParcelableArrayList("data",adapter.data as ArrayList<MusicModel>)
+                .navigation(activity, select_local_result)
+        }
+        binding.clNoContent.setOnClickListener {
+            ARouter.getInstance()
+                .build(ARouteConstant.Room.musicList)
+                .withParcelableArrayList("data",adapter.data as ArrayList<MusicModel>)
+                .navigation(activity, select_local_result)
+        }
+
+        adapter.setOnItemChildClickListener { _, view, position ->
+            when(view?.id){
+                R.id.ivRecall -> {
+
+                }
+            }
+
+        }
+    }
+
+    override fun loadMoreNeed(): Boolean {
+        return false
+    }
+
+    override fun refreshNeed(): Boolean {
+        return false
+    }
+
+    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)
+                }
+            }
+        }
+    }
+
+}

+ 4 - 0
room/src/main/java/com/swago/room/user/UserRoomFragment.kt

@@ -124,6 +124,10 @@ class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
             openLianMaiListDialog()
         }
 
+        unreadMessageVm.unreadMessageData.observe(this){
+            footerView.setUnReadCount(it)
+        }
+
         msgVm.forbidSpeakOrCancel = {
             isForbid = it
         }

+ 9 - 0
room/src/main/java/com/swago/room/widget/UserFooterView.kt

@@ -123,4 +123,13 @@ class UserFooterView : ConstraintLayout, IFooter,IRoomActiveListener {
     override fun closeRoomed() {
         SwagoRoomManager.removeListener(this)
     }
+
+    fun setUnReadCount(num:Long){
+        if (num > 0){
+            binding.tvNum.visibility = View.VISIBLE
+            binding.tvNum.text = "$num"
+        } else {
+            binding.tvNum.visibility = View.GONE
+        }
+    }
 }

+ 6 - 0
room/src/main/res/drawable/live_music_check.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@mipmap/ic_music_check" android:state_checked="true"/>
+ <item android:drawable="@mipmap/ic_music_uncheck" android:state_checked="false"/>
+ <item android:drawable="@mipmap/ic_music_uncheck"/>
+</selector>

+ 6 - 0
room/src/main/res/drawable/local_select_music.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="#9B20FC" android:state_checked="true"/>
+ <item android:color="#435568" android:state_checked="false"/>
+ <item android:color="#435568"/>
+</selector>

+ 55 - 0
room/src/main/res/layout/activity_local_music.xml

@@ -0,0 +1,55 @@
+<?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:id="@+id/main"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".music.LocalMusicActivity">
+
+    <include
+        android:id="@+id/toolbar"
+        layout="@layout/layout_toolbar"
+        android:layout_width="match_parent"
+        android:layout_height="56dp"
+        android:layout_marginTop="25dp"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <CheckBox
+        android:id="@+id/cbSelect"
+        android:textSize="14dp"
+        android:textColor="@drawable/local_select_music"
+        android:text="Select all"
+        android:layout_marginEnd="20dp"
+        android:padding="10dp"
+        android:gravity="center"
+        android:button="@null"
+        android:background="@android:color/transparent"
+        app:layout_constraintTop_toTopOf="@+id/toolbar"
+        app:layout_constraintBottom_toBottomOf="@+id/toolbar"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/rv"
+        android:layout_marginTop="81dp"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginBottom="68dp"/>
+
+    <TextView
+        android:id="@+id/tvAdd"
+        android:layout_width="match_parent"
+        android:layout_height="44dp"
+        android:background="@drawable/shape_9b20fc_20"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:layout_marginStart="17dp"
+        android:layout_marginEnd="17dp"
+        android:layout_marginBottom="24dp"
+        android:textColor="#fff"
+        android:text="Add to My Music"
+        android:gravity="center"
+        android:textSize="@dimen/sp_16"/>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 46 - 12
room/src/main/res/layout/dialog_footer_more.xml

@@ -1,6 +1,7 @@
 <?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="match_parent">
 
@@ -11,29 +12,62 @@
         android:layout_width="match_parent"
         android:layout_height="0dp">
 
-    <ImageView
-        android:id="@+id/ivMessage"
-        android:layout_marginStart="10dp"
-        android:background="@drawable/shape_80000000_20"
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        android:src="@mipmap/live_message"
-        android:layout_marginTop="@dimen/dp_10"
-        android:layout_width="40dp"
-        android:layout_height="40dp"/>
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/clMessage"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            android:layout_marginTop="@dimen/dp_10">
+            <ImageView
+                android:id="@+id/ivMessage"
+                android:layout_marginStart="10dp"
+                android:background="@drawable/shape_80000000_20"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                android:src="@mipmap/live_message"
+                android:layout_width="40dp"
+                android:layout_height="40dp"/>
+            <TextView
+                android:id="@+id/tvNum"
+                android:layout_width="12dp"
+                android:layout_height="12dp"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                android:textColor="#fff"
+                tools:text="1"
+                android:textSize="8sp"
+                android:gravity="center"
+                android:visibility="gone"
+                android:background="@drawable/shape_d54941_circle"/>
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
 
-    <ImageView
+        <ImageView
         android:id="@+id/ivShare"
         android:layout_marginStart="16dp"
         android:background="@drawable/shape_80000000_20"
         app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintStart_toEndOf="@+id/ivMessage"
+        app:layout_constraintStart_toEndOf="@+id/clMessage"
         android:src="@mipmap/live_share"
         android:padding="6dp"
         android:layout_marginTop="@dimen/dp_10"
         android:layout_width="40dp"
         android:layout_height="40dp"/>
 
+        <ImageView
+            android:id="@+id/ivMusic"
+            android:layout_marginStart="16dp"
+            android:background="@drawable/shape_80000000_20"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintStart_toEndOf="@+id/ivShare"
+            android:src="@mipmap/live_music"
+            android:padding="6dp"
+            android:layout_marginTop="@dimen/dp_10"
+            android:layout_width="40dp"
+            android:layout_height="40dp"/>
+
+
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 121 - 0
room/src/main/res/layout/dialog_my_music.xml

@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:background="#000"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/cl"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:layout_width="match_parent"
+        app:layout_constraintDimensionRatio="h,360,541"
+        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:textStyle="bold"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"/>
+
+
+        <ImageView
+            android:id="@+id/ivClose"
+            android:src="@mipmap/ic_music_close"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            android:layout_marginEnd="16dp"
+            android:layout_marginTop="12dp"
+            android:layout_width="24dp"
+            android:layout_height="24dp"/>
+
+        <com.swago.baseswago.cusview.SwagoRecyclerView
+            android:id="@+id/swagoRv"
+            android:layout_marginTop="18dp"
+            app:layout_constraintTop_toBottomOf="@+id/tvTitle"
+            app:layout_constraintBottom_toTopOf="@+id/cl_add"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"/>
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/cl_add"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            android:layout_marginBottom="30dp"
+            android:layout_marginTop="10dp"
+            android:layout_marginEnd="24dp"
+            android:layout_marginStart="24dp"
+            android:background="@drawable/shape_9b20fc_20">
+            <ImageView
+                android:layout_width="16dp"
+                android:layout_height="16dp"
+                android:background="@mipmap/ic_add_music"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintBottom_toBottomOf="parent"
+                android:layout_marginEnd="6dp"
+                app:layout_constraintRight_toLeftOf="@+id/tv_add"
+                />
+            <TextView
+                android:id="@+id/tv_add"
+                android:layout_width="wrap_content"
+                android:layout_height="44dp"
+                android:gravity="center"
+                android:text="Add Music"
+                android:textColor="#fff"
+                android:textSize="@dimen/sp_16"
+                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="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>
+
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 58 - 0
room/src/main/res/layout/item_local_music.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="60dp"
+    xmlns:tools="http://schemas.android.com/tools"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <com.swago.baseswago.cusview.BoldTextView
+        android:id="@+id/tvTitle"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textColor="#131b23"
+        android:textSize="15sp"
+        android:maxLines="1"
+        android:maxWidth="220dp"
+        android:ellipsize="end"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="12dp"
+        tools:text="ddfgbhgh"/>
+
+    <com.swago.baseswago.cusview.MediumTextView
+        android:id="@+id/tvDuration"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textColor="#435568"
+        android:textSize="12sp"
+        android:maxLines="1"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/tvTitle"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="2dp"
+        tools:text="00:00"/>
+    <CheckBox
+        android:id="@+id/cbCheck"
+        android:layout_width="20dp"
+        android:layout_height="20dp"
+        android:button="@null"
+        android:drawableLeft="@drawable/live_music_check"
+        android:textColor="#ffffff"
+        android:textSize="14dp"
+        android:drawablePadding="4dp"
+        android:gravity="center_horizontal"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:background="@android:color/transparent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:layout_marginEnd="16dp"/>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginStart="16dp"
+        android:layout_marginEnd="16dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:background="#eceff2"/>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 67 - 0
room/src/main/res/layout/item_my_music.xml

@@ -0,0 +1,67 @@
+<?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="70dp">
+
+    <com.opensource.svgaplayer.SVGAImageView
+        android:id="@+id/svgaImageView"
+        android:layout_height="18dp"
+        android:layout_width="18dp"
+        app:source="cry.svga"
+        app:autoPlay="true"
+        app:loopCount="0"
+        android:background="#fff"
+        android:layout_marginTop="-16dp"
+        android:layout_marginStart="16dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"/>
+
+    <com.swago.baseswago.cusview.BoldTextView
+        android:id="@+id/tvName"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        app:layout_constraintLeft_toRightOf="@+id/svgaImageView"
+        app:layout_constraintTop_toTopOf="@+id/svgaImageView"
+        android:layout_marginEnd="@dimen/dp_40"
+        android:lines="1"
+        android:maxWidth="200dp"
+        tools:text="gfghy"
+        android:ellipsize="end"
+        android:textSize="@dimen/sp_14"
+        android:textColor="#131b23"
+        android:layout_marginStart="@dimen/dp_10"/>
+
+    <com.swago.baseswago.cusview.MediumTextView
+        android:id="@+id/tvDuration"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        app:layout_constraintLeft_toRightOf="@+id/svgaImageView"
+        app:layout_constraintTop_toBottomOf="@+id/tvName"
+        android:layout_marginStart="@dimen/dp_10"
+        android:layout_marginTop="@dimen/dp_4"
+        tools:text="00:00"
+        android:textSize="12sp"
+        android:textColor="#435568"/>
+
+    <ImageView
+        android:id="@+id/ivRecall"
+        android:layout_width="20dp"
+        android:layout_height="20dp"
+        android:background="@mipmap/ic_recall"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:layout_marginEnd="16dp"/>
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginStart="16dp"
+        android:layout_marginEnd="16dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:background="#eceff2"/>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 29 - 7
room/src/main/res/layout/layout_user_footer_view.xml

@@ -63,14 +63,36 @@
         android:layout_width="40dp"
         android:layout_height="40dp"/>
 
-    <ImageView
-        android:id="@+id/ivMessage"
-        android:background="@drawable/shape_80000000_20"
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
         app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintStart_toEndOf="@+id/ivShare"
-        android:layout_marginStart="10dp"
-        android:src="@mipmap/live_message"
-        android:layout_width="40dp"
-        android:layout_height="40dp"/>
+        android:layout_marginStart="10dp">
+
+        <ImageView
+            android:id="@+id/ivMessage"
+            android:background="@drawable/shape_80000000_20"
+            android:src="@mipmap/live_message"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            android:layout_width="40dp"
+            android:layout_height="40dp"/>
+
+        <TextView
+            android:id="@+id/tvNum"
+            android:layout_width="12dp"
+            android:layout_height="12dp"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            android:textColor="#fff"
+            tools:text="1"
+            android:textSize="8sp"
+            android:gravity="center"
+            android:visibility="gone"
+            android:background="@drawable/shape_d54941_circle"/>
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+
 
 </androidx.constraintlayout.widget.ConstraintLayout>

二进制
room/src/main/res/mipmap-xxhdpi/ic_add_music.png


二进制
room/src/main/res/mipmap-xxhdpi/ic_music_check.png


二进制
room/src/main/res/mipmap-xxhdpi/ic_music_close.png


二进制
room/src/main/res/mipmap-xxhdpi/ic_music_uncheck.png


二进制
room/src/main/res/mipmap-xxhdpi/ic_recall.png


二进制
room/src/main/res/mipmap-xxhdpi/live_music.png


+ 2 - 0
user/src/main/AndroidManifest.xml

@@ -31,6 +31,8 @@
             android:screenOrientation="portrait"/>
         <activity android:name=".ModifyPwdActivity"
             android:screenOrientation="portrait"/>
+        <activity android:name=".store.StoreListActivity"
+            android:screenOrientation="portrait"/>
     </application>
 
 </manifest>

二进制
user/src/main/assets/jojo_audio.svga


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

@@ -55,6 +55,12 @@ class SettingActivity : BaseXActivity<ActivitySettingBinding>() {
                 userVm.logout()
             }
         })
+
+        binding.tvClearCache.setOnClickListener(object : NoDoubleClickListener() {
+            override fun onClick() {
+                userVm.clearCache()
+            }
+        })
     }
 
     override fun initLiveData() {

+ 74 - 0
user/src/main/java/com/swago/user/store/StoreBuyDialog.kt

@@ -0,0 +1,74 @@
+package com.swago.user.store
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import com.opensource.svgaplayer.SVGADrawable
+import com.opensource.svgaplayer.SVGAParser
+import com.opensource.svgaplayer.SVGAVideoEntity
+import com.swago.baseswago.dialog.BaseXDFragment
+import com.swago.user.databinding.DialogStoreDetailBinding
+import java.io.File
+import java.net.URL
+
+class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
+
+    private var svgaParser: SVGAParser? = null
+    var svgaString: String ?= null
+    init {
+        setGravity(Gravity.BOTTOM)
+        setDimAmount(0.5f)
+        setCanCancel(true)
+    }
+
+    companion object{
+        fun newInstance(): StoreBuyDialog {
+            val dialog = StoreBuyDialog()
+            val bundle = Bundle()
+//            bundle.putString("svgaString",svgaString)
+            dialog.arguments = bundle
+            return dialog
+        }
+    }
+
+
+    override fun initOther() {
+        svgaParser = SVGAParser(activity)
+//        arguments?.let {
+//            svgaString = it.getString("svgaString")
+//        }
+        svgaString?.let {
+            svgaParser?.let { svgaParser ->
+                svgaParser.decodeFromURL(URL(it), object : SVGAParser.ParseCompletion{
+                    override fun onComplete(videoItem: SVGAVideoEntity) {
+                        val drawable = SVGADrawable(videoItem)
+                        binding.svgContent.setImageDrawable(drawable)
+                        binding.svgContent.startAnimation()
+                    }
+
+                    override fun onError() {
+
+                    }
+                })
+
+            }
+        }
+        svgaParser?.let {
+            it.decodeFromAssets("jojo_audio.svga",object : SVGAParser.ParseCompletion{
+                override fun onComplete(videoItem: SVGAVideoEntity) {
+                    val drawable = SVGADrawable(videoItem)
+                    binding.svgContent.setImageDrawable(drawable)
+                    binding.svgContent.startAnimation()
+                }
+
+                override fun onError() {
+
+                }
+            })
+        }
+    }
+
+    override fun initLiveData() {
+
+    }
+}

+ 16 - 0
user/src/main/java/com/swago/user/store/StoreItemAdapter.kt

@@ -0,0 +1,16 @@
+package com.swago.user.store
+
+import com.chad.library.adapter.base.BaseQuickAdapter
+import com.chad.library.adapter.base.BaseViewHolder
+import com.swago.user.R
+
+class StoreItemAdapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_store, arrayListOf())  {
+    override fun convert(helper: BaseViewHolder?, item: String?) {
+        helper?.apply {
+            item?.let {
+                setText(R.id.tv_name ,item)
+            }
+
+        }
+    }
+}

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

@@ -0,0 +1,51 @@
+package com.swago.user.store
+
+import android.graphics.Color
+import androidx.recyclerview.widget.LinearLayoutManager
+import com.alibaba.android.arouter.facade.annotation.Route
+import com.swago.baseswago.activity.BaseXActivity
+import com.swago.baseswago.constant.ARouteConstant
+import com.swago.user.R
+import com.swago.user.databinding.ActivityStoreListBinding
+import com.swago.user.vm.TaskVm
+
+/**
+ *@date 2022/2/26 13:37
+ *description:
+ */
+@Route(path = ARouteConstant.User.storeList)
+class StoreListActivity : BaseXActivity<ActivityStoreListBinding>() {
+
+    val adapter by lazy {
+        StoreTypeAdapter()
+    }
+
+    override fun loadData() {
+    }
+
+    override fun initOther() {
+        setBackView(binding.toolbar.ivBack)
+        binding.toolbar.ivBack.setImageResource(R.mipmap.back_white)
+        binding.toolbar.tvTitle.setTextColor(Color.parseColor("#FFFFFF"))
+        binding.toolbar.tvTitle.text =
+            "Store"
+    }
+
+    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)
+                }
+            }
+        }
+        adapter.itemClickFun = { typeItem, position ->
+            StoreBuyDialog.newInstance().show(supportFragmentManager ,"StoreBuyDialog")
+        }
+    }
+
+}

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

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

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

@@ -0,0 +1,39 @@
+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)
+                }
+            }
+
+
+        }
+    }
+}

+ 5 - 0
user/src/main/res/drawable/shape_0fffffff_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="#0FFFFFFF"/>
+    <corners android:radius="4dp"/>
+</shape>

+ 13 - 2
user/src/main/res/layout/activity_setting.xml

@@ -52,10 +52,21 @@
             android:layout_width="match_parent"
             android:layout_height="60dp"/>
 
+        <com.swago.baseswago.cusview.MediumTextView
+            android:id="@+id/tvClearCache"
+            app:layout_constraintTop_toBottomOf="@+id/tvUserPrivacy"
+            android:gravity="center_vertical"
+            android:padding="20dp"
+            android:textSize="16dp"
+            android:textColor="@color/black"
+            android:drawableEnd="@mipmap/more_small"
+            android:text="@string/clear_cache"
+            android:layout_width="match_parent"
+            android:layout_height="60dp"/>
 
         <com.swago.baseswago.cusview.MediumTextView
             android:id="@+id/tvCurrentVersion"
-            app:layout_constraintTop_toBottomOf="@+id/tvUserPrivacy"
+            app:layout_constraintTop_toBottomOf="@+id/tvClearCache"
             android:gravity="center_vertical"
             android:padding="20dp"
             android:textSize="16dp"
@@ -70,7 +81,7 @@
 
         <com.swago.baseswago.cusview.RegularTextView
             android:id="@+id/tvVersion"
-            app:layout_constraintTop_toBottomOf="@+id/tvUserPrivacy"
+            app:layout_constraintTop_toBottomOf="@+id/tvClearCache"
             android:gravity="center_vertical"
             android:padding="20dp"
             android:textSize="16dp"

+ 36 - 0
user/src/main/res/layout/activity_store_list.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#030417"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <ImageView
+        android:background="@mipmap/bg_store"
+        app:layout_constraintTop_toTopOf="parent"
+        android:layout_width="match_parent"
+        android:layout_height="300dp"/>
+
+    <include
+        android:id="@+id/toolbar"
+        layout="@layout/layout_toolbar"
+        android:layout_width="match_parent"
+        android:layout_height="56dp"
+        android:layout_marginTop="25dp"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <FrameLayout
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:layout_marginTop="81dp"
+        android:layout_width="match_parent"
+        android:layout_height="0dp">
+
+        <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/swagoRv"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
+
+    </FrameLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

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

@@ -0,0 +1,69 @@
+<?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="match_parent">
+
+        <com.opensource.svgaplayer.SVGAImageView
+            android:id="@+id/svg_content"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            app:autoPlay="true"
+            app:fillMode="Forward"
+            app:layout_constraintDimensionRatio="h,1:1"
+            app:layout_constraintBottom_toTopOf="@+id/cl_bottom"
+            app:layout_constraintTop_toTopOf="parent"
+            app:loopCount="1" />
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/cl_bottom"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="#0E0F26"
+            android:paddingBottom="24dp"
+            app:layout_constraintBottom_toBottomOf="parent">
+
+            <com.swago.baseswago.cusview.MediumTextView
+                android:id="@+id/tv_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="18dp"
+                android:maxWidth="120dp"
+                android:textColor="#ffffff"
+                android:textSize="16sp"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                tools:text="fgg" />
+
+            <com.swago.baseswago.cusview.MediumTextView
+                android:id="@+id/tv_coin"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:drawableStart="@mipmap/ic_coin_store"
+                android:drawablePadding="2dp"
+                android:textColor="#A3FFFFFF"
+                android:textSize="14sp"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/tv_name"
+                tools:text="fgg" />
+
+            <com.swago.baseswago.cusview.MediumTextView
+                android:layout_width="match_parent"
+                android:layout_height="44dp"
+                android:layout_marginStart="17dp"
+                android:layout_marginTop="24dp"
+                android:layout_marginEnd="17dp"
+                android:background="@drawable/shape_9b20fc_20"
+                android:gravity="center"
+                android:text="Buy Now"
+                android:textColor="@color/_ffffff"
+                android:textSize="@dimen/sp_16"
+                app:layout_constraintTop_toBottomOf="@+id/tv_coin" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 55 - 0
user/src/main/res/layout/item_store.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_marginStart="4dp"
+        android:layout_marginEnd="4dp"
+        android:layout_marginTop="8dp"
+        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"
+            android:layout_height="90dp"
+            android:src="@mipmap/bg_host_eight"
+            android:padding="@dimen/dp_4"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toTopOf="parent"/>
+        <com.swago.baseswago.cusview.MediumTextView
+            android:id="@+id/tv_name"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="2dp"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/iv_svg"
+            tools:text="fgg"
+            android:textSize="12sp"
+            android:maxWidth="120dp"
+            android:textColor="#ffffff"/>
+        <com.swago.baseswago.cusview.MediumTextView
+            android:id="@+id/tv_coin"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="2dp"
+            android:drawablePadding="2dp"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/tv_name"
+            tools:text="fgg"
+            android:drawableStart="@mipmap/ic_coin_store"
+            android:textSize="10sp"
+            android:textColor="#A3FFFFFF"/>
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

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

@@ -0,0 +1,57 @@
+<?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>

二进制
user/src/main/res/mipmap-xxhdpi/ic_coin_store.png


二进制
user/src/main/res/mipmap-xxhdpi/ic_show_less.png


二进制
user/src/main/res/mipmap-xxhdpi/ic_show_more.png