Slackbot
08/22/2022, 2:29 PMErfannj En
08/22/2022, 5:13 PMmattinger
08/22/2022, 5:40 PMenighma
08/22/2022, 6:15 PM@Composable LazyGridScope.myFun() = ...
Is there a workaround or suggested solution for this? I guess I can pass it as a param and run scope.apply{}
.rook
08/22/2022, 6:26 PMLazyListScope.items
and LazyGridScope.items
. I’m not sure if that’s intentional or if I’m meant to alias them somehow.Travis Griggs
08/22/2022, 11:39 PMAlan Lee
08/23/2022, 2:16 AMColton Idle
08/23/2022, 8:12 AMval lifecycle = LocalLifecycleOwner.current.lifecycle
DisposableEffect(lifecycle) {
val observer = LifecycleEventObserver { _, event ->
if (event == Lifecycle.Event.ON_RESUME) {
vm.doThing()
}
}
lifecycle.addObserver(observer)
onDispose { lifecycle.removeObserver(observer) }
}
dave08
08/23/2022, 9:11 AMandroidx.compose.runtime
(with NO other changes to the code base and NO extra added dependencies) to my app and enabled the compose compiler and suddenly pressing the back button from one fragment doesn't allow the fragment it's going back to to load properly... is this a known bug?dave08
08/23/2022, 9:11 AMAaron Waller
08/23/2022, 9:13 AMAmrJyniat
08/23/2022, 9:36 AMCard(
Modifier.clickable { doSomething() }
){
CheckBox(
.....,
onCheckedChange = { } // leave it empty and pass its event to parent
)
Text("Some label")
}
Yashwant Gowla
08/23/2022, 1:07 PMManuel Lorenzo
08/23/2022, 1:41 PMArpit Shukla
08/23/2022, 2:37 PMAndrew Hughes
08/23/2022, 4:54 PMColorScheme
is annotated with @Stable
, however, it does not override equals
. The @Stable
annotation mentions that the following must be true:
1. The result ofI assume this means that two instances of a class with the same internal values should evaluate towill always return the same result for the same two instances.equals
true
using equals
. However, this is not the case for ColorScheme
. Am I misunderstanding what this means?Jasmin Fajkic
08/23/2022, 5:48 PMMicko Cabacungan
08/23/2022, 7:15 PMupdate
parameter and factory
parameter and they dont show up when i background the app and then foreground itAaron Waller
08/23/2022, 8:07 PMwintersoldier
08/24/2022, 5:13 AMErfannj En
08/24/2022, 5:17 AMdawidhyzy
08/24/2022, 6:58 AM@Composable
usage
class SomeViewModel(
repository: SomeRepository,
) : ViewModel() {
val something: State<String?>
@Composable
get() = repository.something.collectAsState()
}
what could be the implication of including ViewModel
in composition?allan.conda
08/24/2022, 7:40 AMStylianos Gakis
08/24/2022, 8:51 AMOleksandr Balan
08/24/2022, 10:12 AMAnimatedContent
This is the way :mandalorian:
https://developer.android.com/jetpack/compose/animation#animatedcontent
You could start with default:
AnimatedContent(targetState = loginUiState) { state ->
when (state) {
is LoginEmailUiState ->
LoginEmailPassContainer(state)
is ResetPasswordUiState ->
ResetPasswordContainer(state)
}
}
And then tweak transitionSpec
as needed, see docs above ☝️Lucien Guimaraes
08/24/2022, 10:26 AMTariyel Islami
08/24/2022, 11:39 AMYann Badoual
08/24/2022, 12:00 PMlineSpacing
in TextField
except using TextStyle.ineHeight
(lineHeight also changes the cursor size)Michal Klimczak
08/24/2022, 12:31 PMLazyListState.animateScrollToItem(0)
suspends indefinitely whenever I intercept the scroll animation by touching the list. Thus blocking the collection for any consecutive animations.
Tried working around with withTimeout
, but it seems like the animateScrollToItem
animation loop has no way of supporting cancellation (no yield
in the while
loop).Landry Norris
08/24/2022, 1:25 PMLandry Norris
08/24/2022, 1:25 PM@Composable
fun Drawing(drawObjects: List<DrawObject>, drawHandler: TouchHandler) {
println("Draw handler is $drawHandler in drawing")
Canvas(modifier = Modifier.fillMaxSize().handleDraw(drawHandler).clipToBounds()) {
... draw stuff based on drawObjects
}
}
I need to be able to swap out my draw handler, and the new one should receive touch events.