A cheap attempt at a native Bluesky client for Android

ComposeView: Open keyboard when sheet expands

When the compose bottom sheet expands, automatically focus the text field and show the software keyboard. This is achieved by observing `bottomSheetState.targetValue` instead of `currentValue`.

+4 -4
+4 -4
app/src/main/java/industries/geesawra/monarch/ComposeView.kt
··· 95 95 val mediaSelected = remember { mutableStateOf(listOf<Uri>()) } 96 96 val mediaSelectedIsVideo = remember { mutableStateOf(false) } 97 97 98 - LaunchedEffect(scaffoldState.bottomSheetState.currentValue) { 99 - when (scaffoldState.bottomSheetState.currentValue) { 98 + LaunchedEffect(scaffoldState.bottomSheetState.targetValue) { 99 + when (scaffoldState.bottomSheetState.targetValue) { 100 100 SheetValue.Hidden -> { 101 101 composeFieldState.clearText() 102 102 keyboardController?.hide() ··· 109 109 } 110 110 111 111 SheetValue.PartiallyExpanded, SheetValue.Expanded -> { 112 - keyboardController?.hide() 113 - focusManager.clearFocus() 112 + focusRequester.requestFocus() 113 + keyboardController?.show() 114 114 } 115 115 } 116 116 }