From 2acf85839358b1dc78220374b9ae328e45700cdb Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Tue, 7 Jan 2025 23:49:09 +0900 Subject: [PATCH] =?UTF-8?q?[FIX/#93]=20=EB=A1=9C=EB=94=A9=20=EC=A4=91=20?= =?UTF-8?q?=ED=84=B0=EC=B9=98=20=EB=B0=A9=EC=A7=80=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/main/rhythm/RhythmScreen.kt | 21 +++++-------------- .../main/rhythm/RhythmViewModel.kt | 3 +-- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/presentation/src/main/java/com/kkkk/presentation/main/rhythm/RhythmScreen.kt b/presentation/src/main/java/com/kkkk/presentation/main/rhythm/RhythmScreen.kt index 8ba7beb..c026ef4 100644 --- a/presentation/src/main/java/com/kkkk/presentation/main/rhythm/RhythmScreen.kt +++ b/presentation/src/main/java/com/kkkk/presentation/main/rhythm/RhythmScreen.kt @@ -62,7 +62,6 @@ import com.kkkk.presentation.main.theme.White import com.kkkk.stempo.presentation.R import kotlinx.coroutines.launch import java.io.File -import java.nio.file.Files @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -143,7 +142,7 @@ fun RhythmRoute( animationSpeed = animationSpeed, onToggleSelected = viewModel::changeSelectedMode, onPlayBtnClick = { viewModel.changeIsPlaying(PlayState.PLAYING) }, - onStopBtnClick = { viewModel.changeIsPlaying(PlayState.PAUSE) }, + onPauseBtnClick = { viewModel.changeIsPlaying(PlayState.PAUSE) }, onChangeBtnClick = { viewModel.showBottomSheet(true) } ) @@ -181,21 +180,11 @@ internal fun RhythmScreen( onToggleSelected: (RhythmMode) -> Unit = {}, onWatchBtnClick: () -> Unit = {}, onPlayBtnClick: () -> Unit = {}, - onStopBtnClick: () -> Unit = {}, + onPauseBtnClick: () -> Unit = {}, onChangeBtnClick: () -> Unit = {} ) { Box( - modifier = Modifier - .fillMaxSize() - .pointerInput(rhythmState.isLoading) { - if (rhythmState.isLoading) { - awaitPointerEventScope { - while (rhythmState.isLoading) { - awaitPointerEvent(PointerEventPass.Initial) - } - } - } - }, + modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center ) { RhythmPlayBtnWithLottie( @@ -203,7 +192,7 @@ internal fun RhythmScreen( lottieComposition = lottiePlaying, animationSpeed = animationSpeed, onPlayBtnClick = onPlayBtnClick, - onStopBtnClick = onStopBtnClick + onStopBtnClick = onPauseBtnClick ) Column( @@ -250,7 +239,7 @@ internal fun RhythmScreen( .fillMaxSize() .background(Transparent50) .padding(horizontal = 50.dp) - + .clickableWithoutRipple { } ) } } diff --git a/presentation/src/main/java/com/kkkk/presentation/main/rhythm/RhythmViewModel.kt b/presentation/src/main/java/com/kkkk/presentation/main/rhythm/RhythmViewModel.kt index d2c8414..daeac18 100644 --- a/presentation/src/main/java/com/kkkk/presentation/main/rhythm/RhythmViewModel.kt +++ b/presentation/src/main/java/com/kkkk/presentation/main/rhythm/RhythmViewModel.kt @@ -101,8 +101,7 @@ constructor( suspendCancellableCoroutine { continuation -> if (file.exists()) { soundPool = SoundPool.Builder().setMaxStreams(1).build().apply { - setOnLoadCompleteListener { _, sampleId, status -> - // TODO: 이거 왜 status 0 이 안되지 .. status == 0 조건 추가 필요함 + setOnLoadCompleteListener { _, sampleId, _ -> if (sampleId == beatSound) { continuation.resume(Unit) }