Skip to content

Commit

Permalink
[FIX/#93] 로딩 중 터치 방지 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchbreeze committed Jan 7, 2025
1 parent 5e0818f commit 2acf858
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) }
)

Expand Down Expand Up @@ -181,29 +180,19 @@ 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(
rhythmState = rhythmState,
lottieComposition = lottiePlaying,
animationSpeed = animationSpeed,
onPlayBtnClick = onPlayBtnClick,
onStopBtnClick = onStopBtnClick
onStopBtnClick = onPauseBtnClick
)

Column(
Expand Down Expand Up @@ -250,7 +239,7 @@ internal fun RhythmScreen(
.fillMaxSize()
.background(Transparent50)
.padding(horizontal = 50.dp)

.clickableWithoutRipple { }
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ constructor(
suspendCancellableCoroutine<Unit> { 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)
}
Expand Down

0 comments on commit 2acf858

Please sign in to comment.