Status Update
Comments
ha...@google.com <ha...@google.com> #2
Hello, thanks for reporting this. I see the stacktrace goes through a VisualTransformation path. It doesn't necessarily mean that you are using a VisualTransformation but it's relatively rarer to hit this kind of a crash using an Identity
VisualTransformation.
Also, it's very difficult to reason in terms of what this screen represents without knowing much about FormInputA
, FormInputB
, ListSelectionButton
, etc. It'd be really nice to have more context with respect to how much you can share.
In any case, we will definitely look into BottomSheetDialogFragment
-> Fragment
-> ComposeView
hierarchy.
se...@gmail.com <se...@gmail.com> #3
Thanks for taking a look.
Here's a few more details about the FormInputA
, FormInputB
, & ListSelectionButton
composables:
Both inputs are pretty similar (using OutlinedTextField
):
fun FormInputA(
input: TextFieldValue,
onValueChange: (TextFieldValue) -> Unit,
modifier: Modifier = Modifier,
placeHolderText: String,
focusRequester: FocusRequester
) {
OutlinedTextField(
value = input,
placeholder = { TextFieldPlaceHolder(title = placeHolderText) },
onValueChange = onValueChange,
textStyle = TextStyles.heading.copy(textAlign = TextAlign.Left),
modifier = modifier
.defaultMinSize(minHeight = 250.dp)
.fillMaxWidth()
.focusRequester(focusRequester)
.background(Colors.background),
colors = TextFieldDefaults.outlinedTextFieldColors(
/** bunch of colors **/
)
)
}
@Composable
fun FormInputB(
input: TextFieldValue,
onValueChange: (TextFieldValue) -> Unit,
modifier: Modifier = Modifier,
placeHolderText: String,
labelText: String,
focusRequester: FocusRequester
) {
OutlinedTextField(
value = input,
label = { TextFieldLabel(title = labelText) },
placeholder = { TextFieldPlaceHolder(title = placeHolderText) },
onValueChange = onValueChange,
textStyle = TextStyles.heading.copy(textAlign = TextAlign.Left),
modifier = modifier
.defaultMinSize(minHeight = 200.dp)
.fillMaxWidth()
.focusRequester(focusRequester)
.background(Colors.background),
colors = TextFieldDefaults.outlinedTextFieldColors(
/** bunch of colors **/
)
)
}
The ListSelectionButton
is a Row
with a custom button whose main moving parts are shown here (not able to share the full code):
@Composable
fun ListSelectionButton(
modifier: Modifier = Modifier,
text: String,
notifyEvent: (Event) -> Unit
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center,
modifier = Modifier.fillMaxWidth()
) {
CustomButton(
text = text,
onClick = { notifyEvent(Event.Clicked) },
modifier = modifier
.wrapContentHeight()
.padding(top = 40.dp, bottom = 24.dp)
)
}
}
@composable
fun CustomButton(
onClick: () -> Unit,
text: String,
isLoading: Boolean,
modifier: Modifier
) {
Surface(modifier) {
Row {
if (isLoading) {
CircularProgressIndicator()
} else {
Text(text)
}
}
}
}
Let me know if there are any other details that could help, will try to share if possible.
se...@gmail.com <se...@gmail.com> #4
Hi all - wondering if there was any movement on this. We are currently on Compose BOM 2023.10.01 and it is still happening.
Description
Jetpack Compose version:
1.3.1
Jetpack Compose component used:
OutlinedTextField
Android Studio Build:
Android Studio Electric Eel | 2022.1.1 RC 1
Kotlin version:
1.7.10
Devices/Android versions reproduced on:
Pixel 2 Android 11
Keyboard (i.e. Gboard, Samsung, etc): Google
This is intermittent so we have not been able to produce a sample project yet. It happens with the original project with a
Pixel 2 Android 11
and otherwise on production devices. Can't share the video because its internal to the company, but repro steps are explained below.The hierarchy is:
BottomSheetDialogFragment
->Fragment
->ComposeView
-> and we dosetViewCompositionStrategy(DisposeOnViewTreeLifecycleDestroyed)
as well.The
ComposeView
has the following content:Where
OutlinedTextField
is used in theFormInputA/B
composables.Stack trace:
Repro steps:
I could be related to https://issuetracker.google.com/issues/262411188 because sometimes we see that exception and sometimes we see this
IllegalArgumentException
.Please see full trace attached.