Sebastian Höbarth
10/11/2022, 10:00 AMWindowInsets
in BottomAppBar
. The WindowInsets
padding are set after the transition to the new screen finishes and that results in a jump of the bottom bar. Is there a work arround for that? (video in thread)
Scaffold(topBar = {
...
}, bottomBar = {
// Wrap the navigation bar in a surface so the color behind the system
// navigation is equal to the container color of the navigation bar.
Surface(
color = MaterialTheme.colorScheme.surface,
tonalElevation = 6.dp
) {
BottomAppBar(
modifier = Modifier
.windowInsetsPadding(
WindowInsets.safeDrawing.only(
WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom
)
),
oday
10/11/2022, 10:06 AMUtkarsh Tiwari
10/11/2022, 12:56 PMPedro Alberto
10/11/2022, 2:24 PMMarco Pierucci
10/11/2022, 3:25 PMListState
? ( For example if a user scrolls al rows are scrolled at the same time)Chris Johnson
10/11/2022, 9:36 PMModifier.focusable(false)
isn't doing what I expect it to do. My use case is I want to have a TextField that looks editable, but when clicked on is not focused and instead goes to a different screen. Ideally I'd like to use enabled = false
but that changes the colors in an undesirable way. Currently, it still focuses the text in the TextField before navigating awayKotlinLeaner
10/11/2022, 11:16 PMzt
10/11/2022, 11:20 PMfengdai
10/12/2022, 3:40 AM@Preview
@Composable
fun Preview() = Row {
val fontSize = 48.sp
val modifier = Modifier.border(1.dp, Color.Blue)
Text(text = "Function", modifier, fontSize = fontSize)
Text(text = "功能", modifier, fontSize = fontSize)
Text(text = "機能", modifier, fontSize = fontSize)
}
oday
10/12/2022, 8:28 AModay
10/12/2022, 10:18 AMwhen (state)
to be run on each recomposition ?
cause I have the state changing from the viewmodel due to some request and something happening there that will cuase it to change, and then the when gets triggered again and the actions resulting from it happen againAnmol Verma
10/12/2022, 11:06 AMabu naser
10/12/2022, 12:04 PMagrosner
10/12/2022, 12:59 PMZach
10/12/2022, 3:41 PMBasicTextField
and OutlinedTextFieldDecorationBox
, and when the field is tall enough for some reason, this green teardrop shaped draggable handle appears. Is there any way to remove this, or at least style it?Aaron Waller
10/12/2022, 4:09 PMjava.lang.IllegalArgumentException: Only VectorDrawables and rasterized asset types are supported ex. PNG, JPG
the image I pass as an INT is a PNG.Jasmin Fajkic
10/12/2022, 5:48 PMcomposable
and bottomSheet
( from accompanist ). In my composable route i set custom BackHandler. But when i navigate from that screen to bottom sheet screen , my bottom sheet screen inherit back handler behaviour from previous screen. Any chance to solve it 😞 ?Alexandru Hadăr
10/12/2022, 7:52 PMlogout
call to finish, how should we collect the flow result in a @Composable function?
The only way I could think of would be something like this:
@Composable
private fun ProfileScreen(
onUserLoggedOut: () -> Unit,
viewModel: UserProfileViewModel = viewModel()
) {
LaunchedEffect(key1 = Unit) {
viewModel.onUserLoggedOut.collect { userLoginState ->
when (userLoginState) {
UserLoginState.LOGGED_IN -> Unit // do nothing
UserLoginState.LOGGED_OUT -> onUserLoggedOut()
}
}
}
}
However, it seems a bit off. IS there any better solution to this?v79
10/12/2022, 9:02 PMclass PercentageVisualTransformation : VisualTransformation {
override fun filter(text: AnnotatedString): TransformedText {
TODO("Not yet implemented")
}
}
The code no longer compiles with an error message: Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option
- I'm not comfortable changing compiler options for what, I thought, should be a simple thing to do. Any suggestions?Joseph Hawkes-Cates
10/12/2022, 9:22 PMandroid:configChanges
property set in our Activity in our AndroidManifest and one of the values we have in there is orientation. We also utilize LocalConfiguration.current.orientation
to check the orientation in some places and act accordingly. This works on all of the devices we’ve tested except this Galaxy Tab s6 Lite. For some reason we are always getting ORIENTATION_LANDSCAPE as the value on the current config on that device, unless we remove “orientation” from the conifgChanges list in the manifest. Has anyone seen this before or aware of another option to work around this issue?PHondogo
10/13/2022, 8:36 AMspierce7
10/13/2022, 7:33 PMSiyamed
10/13/2022, 9:56 PMzt
10/14/2022, 5:21 AMpajatopmr
10/14/2022, 6:29 AM@Stable class Filter(
val name: String,
enabled: Boolean = false,
val icon: ImageVector? = null
) {
val enabled = mutableStateOf(enabled)
}
which has me wondering why the “val enabled” property is not passed in the constructor and the class is not a data class. Is this some sort of compose pattern? Possibly to use in a destructured access to the “setEnabled” setter, which I do observe in Jetsnack.Yoni Obia
10/14/2022, 7:50 AMContext
and Pools.SimplePool
via Hilt I’ve made it into a Singleton. Would creating a LocalProvider for this not recommended ?Zoltan Demant
10/14/2022, 8:51 AMsetContent{ LaunchedEffect(Unit){ suspend code } }
in my activity, as compared to lifecycleScope.launch { suspend code }
? Both calls would be made in onCreate, and Im just curious really.reactormonk
10/14/2022, 9:43 AModay
10/14/2022, 11:41 AMfreddiewang
10/14/2022, 1:44 PMPath
and some control points, I’d like to keep the same state after going back to the screen
but don’t know how to keep the state in Compose UIfreddiewang
10/14/2022, 1:44 PMPath
and some control points, I’d like to keep the same state after going back to the screen
but don’t know how to keep the state in Compose UIczuckie
10/14/2022, 2:29 PMupdate
lambda that you can provide to the AndroidView
composable.
If that's not feasible, I imagine implementing onSaveInstanceState/onRestoreInstanceState may work?
What have you tried?freddiewang
10/14/2022, 3:38 PMonSaveInstanceState
is invoked and onRestoreInstanceState
is never invoked in Compose UI. The workaround is to export the saved state to Compose. Still finding a better solution