tongmengxiao 6 miesięcy temu
rodzic
commit
f6b921fa88
25 zmienionych plików z 722 dodań i 3 usunięć
  1. 2 0
      app/src/main/AndroidManifest.xml
  2. 5 0
      baseswago/src/main/java/com/swago/baseswago/agora/AgoraManager.kt
  3. 1 0
      baseswago/src/main/java/com/swago/baseswago/constant/ARouteConstant.kt
  4. 1 1
      room/src/main/AndroidManifest.xml
  5. 8 0
      room/src/main/java/com/swago/room/base/BaseComFragment.kt
  6. 5 0
      room/src/main/java/com/swago/room/dialog/FooterMoreDialog.kt
  7. 76 0
      room/src/main/java/com/swago/room/music/LocalMusicActivity.kt
  8. 31 0
      room/src/main/java/com/swago/room/music/LocalMusicAdapter.kt
  9. 44 0
      room/src/main/java/com/swago/room/music/MusicModel.kt
  10. 72 0
      room/src/main/java/com/swago/room/music/MusicVm.kt
  11. 19 0
      room/src/main/java/com/swago/room/music/MyMusicAdapter.kt
  12. 130 0
      room/src/main/java/com/swago/room/music/MyMusicDialog.kt
  13. 6 0
      room/src/main/res/drawable/live_music_check.xml
  14. 6 0
      room/src/main/res/drawable/local_select_music.xml
  15. 55 0
      room/src/main/res/layout/activity_local_music.xml
  16. 15 2
      room/src/main/res/layout/dialog_footer_more.xml
  17. 121 0
      room/src/main/res/layout/dialog_my_music.xml
  18. 58 0
      room/src/main/res/layout/item_local_music.xml
  19. 67 0
      room/src/main/res/layout/item_my_music.xml
  20. BIN
      room/src/main/res/mipmap-xxhdpi/ic_add_music.png
  21. BIN
      room/src/main/res/mipmap-xxhdpi/ic_music_check.png
  22. BIN
      room/src/main/res/mipmap-xxhdpi/ic_music_close.png
  23. BIN
      room/src/main/res/mipmap-xxhdpi/ic_music_uncheck.png
  24. BIN
      room/src/main/res/mipmap-xxhdpi/ic_recall.png
  25. BIN
      room/src/main/res/mipmap-xxhdpi/live_music.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"

+ 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) {

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

@@ -47,6 +47,7 @@ object ARouteConstant {
         const val user = "$rootPath/UserRoomActivity"
         const val rankList = "$rootPath/RankListActivity"
         const val black = "$rootPath/BlackRoomActivity"
+        const val musicList = "$rootPath/LocalMusicActivity"
     }
 
 }

+ 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>

+ 8 - 0
room/src/main/java/com/swago/room/base/BaseComFragment.kt

@@ -77,6 +77,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
@@ -616,6 +617,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
@@ -733,6 +738,9 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
             openShareFun = {
                 openShareDialog()
             }
+            openMusicFun = {
+                openMusicDialog()
+            }
         }.show(childFragmentManager , "FooterMoreDialog")
     }
 

+ 5 - 0
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)
@@ -47,5 +48,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)
+                }
+            }
+        }
+    }
+
+}

+ 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>

+ 15 - 2
room/src/main/res/layout/dialog_footer_more.xml

@@ -11,7 +11,7 @@
         android:layout_width="match_parent"
         android:layout_height="0dp">
 
-    <ImageView
+        <ImageView
         android:id="@+id/ivMessage"
         android:layout_marginStart="10dp"
         android:background="@drawable/shape_80000000_20"
@@ -22,7 +22,7 @@
         android:layout_width="40dp"
         android:layout_height="40dp"/>
 
-    <ImageView
+        <ImageView
         android:id="@+id/ivShare"
         android:layout_marginStart="16dp"
         android:background="@drawable/shape_80000000_20"
@@ -34,6 +34,19 @@
         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>

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


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


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


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


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


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