File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
feature/creation/src/main/java/com/android/developers/androidify/creation Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -363,7 +363,9 @@ fun EditScreen(
363
363
}
364
364
} else {
365
365
BottomButtons (
366
- onButtonColorClicked = { showColorPickerBottomSheet = ! showColorPickerBottomSheet },
366
+ onButtonColorClicked = {
367
+ showColorPickerBottomSheet = ! showColorPickerBottomSheet
368
+ },
367
369
uiState = uiState,
368
370
onStartClicked = onStartClicked,
369
371
modifier = Modifier
@@ -403,10 +405,16 @@ private fun MainCreationPane(
403
405
val pagerState = rememberPagerState(0 ) { PromptType .entries.size }
404
406
val focusManager = LocalFocusManager .current
405
407
LaunchedEffect (uiState.selectedPromptOption) {
406
- pagerState.animateScrollToPage(
407
- uiState.selectedPromptOption.ordinal,
408
- animationSpec = spatialSpec,
409
- )
408
+ launch {
409
+ pagerState.animateScrollToPage(
410
+ uiState.selectedPromptOption.ordinal,
411
+ animationSpec = spatialSpec,
412
+ )
413
+ }.invokeOnCompletion {
414
+ if (uiState.selectedPromptOption != PromptType .entries[pagerState.currentPage]) {
415
+ onSelectedPromptOptionChanged(PromptType .entries[pagerState.currentPage])
416
+ }
417
+ }
410
418
}
411
419
LaunchedEffect (pagerState) {
412
420
snapshotFlow { pagerState.currentPage }.collect { page ->
You can’t perform that action at this time.
0 commit comments