Преглед на файлове

fix: remove music empty

tongmengxiao преди 5 месеца
родител
ревизия
382ad50ede

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

@@ -351,4 +351,5 @@
     <string name="no_time_limit">لا يوجد حد زمني</string>
     <string name="already_owned">مملوكة</string>
     <string name="using">استخدام</string>
+    <string name="local_music">Local Music</string>
 </resources>

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

@@ -363,4 +363,5 @@
     <string name="no_time_limit">Tidak ada batas waktu</string>
     <string name="already_owned">dimiliki</string>
     <string name="using">digunakan</string>
+    <string name="local_music">Local Music</string>
 </resources>

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

@@ -363,4 +363,5 @@
     <string name="no_time_limit">Tidak ada batas waktu</string>
     <string name="already_owned">dimiliki</string>
     <string name="using">digunakan</string>
+    <string name="local_music">Local Music</string>
 </resources>

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

@@ -351,4 +351,5 @@
     <string name="no_time_limit">不限时间</string>
     <string name="already_owned">已拥有</string>
     <string name="using">使用中</string>
+    <string name="local_music">本地音乐</string>
 </resources>

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

@@ -383,4 +383,5 @@
     <string name="no_time_limit">No time limit</string>
     <string name="already_owned">owned</string>
     <string name="using">using</string>
+    <string name="local_music">Local Music</string>
 </resources>

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

@@ -39,7 +39,7 @@ class LocalMusicActivity : BaseXActivity<ActivityLocalMusicBinding>() {
 
     override fun initOther() {
         setBackView(binding.toolbar.ivBack)
-        binding.toolbar.tvTitle.text = "Local Music"
+        binding.toolbar.tvTitle.text = getString(R.string.local_music)
 
         binding.rv.layoutManager = layoutManager
         binding.rv.adapter = adapter

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

@@ -65,7 +65,6 @@ class MyMusicDialog : BaseXDFragment<DialogMyMusicBinding>() {
         val data = DBHelper.getMusicModel()?.loadAll()
         if (!data.isNullOrEmpty()){
             music_binding.clAdd.visibility = View.VISIBLE
-            music_binding.clNoContent.visibility = View.GONE
             data.forEachIndexed { index, item ->
                 if (musicModel != null && item.id == musicModel?.id){
                     data[index].setIsPlaying(true)
@@ -77,7 +76,6 @@ class MyMusicDialog : BaseXDFragment<DialogMyMusicBinding>() {
             adapter.setNewData(musicList)
         } else {
             music_binding.clAdd.visibility = View.GONE
-            music_binding.clNoContent.visibility = View.VISIBLE
         }
         music_binding.clAdd.setOnClickListener {
             isLocalCome = true
@@ -85,12 +83,6 @@ class MyMusicDialog : BaseXDFragment<DialogMyMusicBinding>() {
                 .build(ARouteConstant.Room.musicList)
                 .navigation()
         }
-        music_binding.clNoContent.setOnClickListener {
-            isLocalCome = true
-            ARouter.getInstance()
-                .build(ARouteConstant.Room.musicList)
-                .navigation()
-        }
 
         adapter.setOnItemChildClickListener { _, view, position ->
             when(view?.id){
@@ -104,7 +96,6 @@ class MyMusicDialog : BaseXDFragment<DialogMyMusicBinding>() {
                             AgoraManager.getRtcEngine()?.stopAudioMixing()
                             if (adapter.data.isEmpty()){
                                 music_binding.clAdd.visibility = View.GONE
-                                music_binding.clNoContent.visibility = View.VISIBLE
                             }
                         }
                     }.show(childFragmentManager,"ChoiceDialogFragment")
@@ -148,7 +139,6 @@ class MyMusicDialog : BaseXDFragment<DialogMyMusicBinding>() {
             val data = DBHelper.getMusicModel()?.loadAll()
             if (!data.isNullOrEmpty()){
                 binding.clAdd.visibility = View.VISIBLE
-                binding.clNoContent.visibility = View.GONE
                 musicList.clear()
                 data.forEachIndexed { index, item ->
                     if (musicModel != null && item.id == musicModel?.id){
@@ -161,7 +151,6 @@ class MyMusicDialog : BaseXDFragment<DialogMyMusicBinding>() {
                 adapter.setNewData(musicList)
             } else {
                 binding.clAdd.visibility = View.GONE
-                binding.clNoContent.visibility = View.VISIBLE
             }
         }
     }

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

@@ -81,68 +81,6 @@
                 app:layout_constraintBottom_toBottomOf="parent"/>
         </androidx.constraintlayout.widget.ConstraintLayout>
 
-       <androidx.constraintlayout.widget.ConstraintLayout
-           android:id="@+id/clNoContent"
-           android:layout_width="wrap_content"
-           android:layout_height="wrap_content"
-           android:visibility="gone"
-           app:layout_constraintStart_toStartOf="parent"
-           app:layout_constraintEnd_toEndOf="parent"
-           app:layout_constraintTop_toTopOf="parent"
-           app:layout_constraintBottom_toBottomOf="parent">
-           <ImageView
-               android:id="@+id/iv_empty"
-               android:layout_width="wrap_content"
-               android:layout_height="wrap_content"
-               app:layout_constraintStart_toStartOf="parent"
-               app:layout_constraintEnd_toEndOf="parent"
-               app:layout_constraintTop_toTopOf="parent"
-               android:src="@mipmap/state_error_empty"/>
-           <TextView
-               android:id="@+id/tv_empty"
-               android:layout_width="wrap_content"
-               android:layout_height="wrap_content"
-               app:layout_constraintStart_toStartOf="parent"
-               app:layout_constraintEnd_toEndOf="parent"
-               app:layout_constraintTop_toBottomOf="@+id/iv_empty"
-               android:layout_marginTop="16dp"
-               android:text="@string/There_is_nothing_here"
-               android:textColor="#435568"
-               android:textSize="@dimen/sp_12"/>
-
-           <androidx.constraintlayout.widget.ConstraintLayout
-               android:layout_width="146dp"
-               android:layout_height="36dp"
-               app:layout_constraintStart_toStartOf="parent"
-               app:layout_constraintEnd_toEndOf="parent"
-               app:layout_constraintTop_toBottomOf="@+id/tv_empty"
-               android:layout_marginTop="27dp"
-               android:background="@drawable/shape_9b20fc_20">
-               <ImageView
-                   android:layout_width="16dp"
-                   android:layout_height="16dp"
-                   app:layout_constraintTop_toTopOf="parent"
-                   app:layout_constraintBottom_toBottomOf="parent"
-                   android:background="@mipmap/ic_add_music"
-                   android:layout_marginEnd="@dimen/dp_4"
-                   app:layout_constraintRight_toLeftOf="@+id/tv_no_add"
-                   />
-               <TextView
-                   android:id="@+id/tv_no_add"
-                   android:layout_width="wrap_content"
-                   android:layout_height="36dp"
-                   android:gravity="center"
-                   android:text="@string/add_music"
-                   android:textColor="#fff"
-                   android:textSize="@dimen/sp_16"
-                   android:layout_marginStart="@dimen/dp_10"
-                   app:layout_constraintEnd_toEndOf="parent"
-                   app:layout_constraintStart_toStartOf="parent"
-                   app:layout_constraintBottom_toBottomOf="parent"/>
-           </androidx.constraintlayout.widget.ConstraintLayout>
-
-       </androidx.constraintlayout.widget.ConstraintLayout>
-
     </androidx.constraintlayout.widget.ConstraintLayout>