Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import com.android.developers.androidify.creation.R as CreationR

@OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable
fun CreationScreen(
fileName: String? = null,
Expand Down Expand Up @@ -364,7 +363,9 @@ fun EditScreen(
}
} else {
BottomButtons(
onButtonColorClicked = { showColorPickerBottomSheet = !showColorPickerBottomSheet },
onButtonColorClicked = {
showColorPickerBottomSheet = !showColorPickerBottomSheet
},
uiState = uiState,
onStartClicked = onStartClicked,
modifier = Modifier
Expand Down Expand Up @@ -404,10 +405,16 @@ private fun MainCreationPane(
val pagerState = rememberPagerState(0) { PromptType.entries.size }
val focusManager = LocalFocusManager.current
LaunchedEffect(uiState.selectedPromptOption) {
pagerState.animateScrollToPage(
uiState.selectedPromptOption.ordinal,
animationSpec = spatialSpec,
)
launch {
pagerState.animateScrollToPage(
uiState.selectedPromptOption.ordinal,
animationSpec = spatialSpec,
)
}.invokeOnCompletion {
if (uiState.selectedPromptOption != PromptType.entries[pagerState.currentPage]) {
onSelectedPromptOptionChanged(PromptType.entries[pagerState.currentPage])
}
}
}
LaunchedEffect(pagerState) {
snapshotFlow { pagerState.currentPage }.collect { page ->
Expand Down