Fixed
Status Update
Comments
ma...@google.com <ma...@google.com>
se...@google.com <se...@google.com>
kl...@google.com <kl...@google.com> #2
I investigated this issue and I think Surface have problem with this, when I use Modifier.shadow with other composables it works normally
ah...@gmail.com <ah...@gmail.com> #3
Thanks for filing this.
This is working as intended, since Card in your case have bigger elevation than a TopAppBar.
As you place it in a Column { TopAppBar; ListOfCards }, cards are drawn after the top app bar, and overlap its shadow.
You either need to switch to the Box and compose the TopAppBar after the list of cards Or use Scaffold that handles this order for you Or use Modifier.zIndex (not recommended) to have higher Z index in the top app bar than in the card.
Description
Android Studio Build: #AI-203.7717.56.2031.7583922, built on July 26, 2021
Kotlin version: 1.5.30 (1.5.21 for stable versions)
Related issue, which forced to use native edit text:
Steps to Reproduce:
Create composable with edit text. Snippet:
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Bottom,
horizontalAlignment = Alignment.CenterHorizontally
) {
TextField(
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Text,
imeAction = ImeAction.Next
),
value = "10",
onValueChange = { },
keyboardActions = KeyboardActions(onNext = {
editText.requestFocus()
//focusManager.moveFocus(FocusDirection.Down)
})
)
AndroidView(
factory = { editText },
modifier = Modifier.focusable().onFocusEvent { if (it.isFocused) Log.d("TAG", "Got focus") }.fillMaxWidth()
)
}
Expected result: keyboard switched to editText, either by using request focus or focusManager. Keyboard not dismissed.
Actual result: focus switched to editText when editText.requestFocus() invoked, keyboard dismissed. Nothing happened when focusManager used.
Current workaround: used InputMethodManager.showSoftInput after some delay when focus retrieved, based on view focus changed listener.
This workaround still create noticable blick of hiding/showing keyboard.