From 0ebd68bb2b7ae106ee31538af204bd227df802fc Mon Sep 17 00:00:00 2001 From: 2taezeat Date: Thu, 7 Dec 2023 14:17:45 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20databi?= =?UTF-8?q?nding=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ohdodok/catchytape/MainActivity.kt | 16 ---------------- .../app/src/main/res/layout/activity_main.xml | 3 +++ 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/android/app/src/main/java/com/ohdodok/catchytape/MainActivity.kt b/android/app/src/main/java/com/ohdodok/catchytape/MainActivity.kt index 7fc723c..32cda95 100644 --- a/android/app/src/main/java/com/ohdodok/catchytape/MainActivity.kt +++ b/android/app/src/main/java/com/ohdodok/catchytape/MainActivity.kt @@ -24,8 +24,6 @@ import androidx.navigation.ui.setupWithNavController import com.ohdodok.catchytape.databinding.ActivityMainBinding import com.ohdodok.catchytape.feature.player.PlayerListener import com.ohdodok.catchytape.feature.player.PlayerViewModel -import com.ohdodok.catchytape.feature.player.changeMoveBtnState -import com.ohdodok.catchytape.feature.player.changePlayBtnState import com.ohdodok.catchytape.feature.player.getMediasWithMetaData import com.ohdodok.catchytape.feature.player.millisecondsPerSecond import com.ohdodok.catchytape.feature.player.moveNextMedia @@ -144,11 +142,6 @@ class MainActivity : AppCompatActivity() { private fun showPlayerController() { binding.pcvController.visibility = View.VISIBLE - player.changePlayBtnState(binding.pcvController.playImageView) - player.changeMoveBtnState( - binding.pcvController.moveNextImageView, - binding.pcvController.movePreviousImageView - ) } private fun setupPlayer() { @@ -191,26 +184,17 @@ class MainActivity : AppCompatActivity() { if (playViewModel.uiState.value.isPlaying) player.pause() else player.play() } - player.changePlayBtnState(binding.pcvController.playImageView) } private fun setupPreviousButton() { binding.pcvController.setOnPreviousButtonClick { player.movePreviousMedia() - player.changeMoveBtnState( - binding.pcvController.moveNextImageView, - binding.pcvController.movePreviousImageView - ) } } private fun setupNextButton() { binding.pcvController.setOnNextButtonClick { player.moveNextMedia() - player.changeMoveBtnState( - binding.pcvController.moveNextImageView, - binding.pcvController.movePreviousImageView - ) } } } \ No newline at end of file diff --git a/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml index 29d74d0..4fcaf14 100644 --- a/android/app/src/main/res/layout/activity_main.xml +++ b/android/app/src/main/res/layout/activity_main.xml @@ -40,7 +40,10 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:music="@{viewModel.uiState.currentMusic}" + app:nextEnabled="@{viewModel.uiState.nextEnable}" + app:playEnabled="@{viewModel.uiState.playEnable}" app:playing="@{viewModel.uiState.isPlaying}" + app:previousEnabled="@{viewModel.uiState.previousEnable}" app:progress="@{viewModel.uiState.currentPositionSecond}" />