Colton Idle
08/25/2021, 8:02 PMTopAppBar(
backgroundColor = Color.Red //Works as expected
backgroundColor = Color.Transparent //Doesn't work as expected
Zach Klippenstein (he/him) [MOD]
08/25/2021, 8:29 PMNavBackStackEntryProvider
sets all the owner locals for the destination (ViewModelStore
, Lifecycle
, SavedStateRegistry
, and SaveableStateRegistry
), and that AndroidView
manages its view’s hierarchy state, but if a view underneath an AndroidView
inside a composable destination asks for the ViewTreeSavedStateRegistryOwner
, for example (and same for the other 2 view tree owners), wouldn’t they skip past the compose nav destination’s owners and find the owner on the android view containing the composition with the nav host? I would expect AndroidView
to set the view tree owners from the respective composition locals on its child view.adjpd
08/25/2021, 10:38 PM@Preview
?
@Composable
private fun TodoActivityScreen(todoViewModel: TodoViewModel) {
...
}
Skolson5903
08/25/2021, 11:21 PMSlackbot
08/25/2021, 11:21 PMRafiul Islam
08/26/2021, 5:33 AMAlex
08/26/2021, 7:26 AMNapa Ram
08/26/2021, 7:28 AMNathan Castlehow
08/26/2021, 8:29 AMComposeTestRule
, the test will be synchronized beforehand, waiting until the UI tree is idle”
Does this synchronisation on assertions include custom idling resources which have been registered? Or would I have to call waitForIdle() in between each line that makes async changes (eg. a network call)?Tin Tran
08/26/2021, 9:31 AMPiotr Prus
08/26/2021, 11:55 AMdimsuz
08/26/2021, 12:12 PMBox
with two composables of different height and use `AnimateVisibility`/`AnimateContent` so that one of them is removed, what is the best way to make this Box
stay with height = max(composable1.height, composable2.height)
? Otherwise layout content jumps which doesn't look good.Jonas Frid
08/26/2021, 1:09 PMrkeazor
08/26/2021, 1:25 PMColton Idle
08/26/2021, 1:54 PMAlex
08/26/2021, 1:59 PMmarios proto
08/26/2021, 2:49 PM@Composable
fun IconTopLeftText(
backgroundImageId: Int,
iconId: Int,
padding: Int = 16,
imagePadding: Int,
text: String,
textColor: Int,
textSize: Int
) {
Box(modifier = Modifier
.padding(padding.dp)
.semantics(true) { }) {
val drawable = AppCompatResources.getDrawable(LocalContext.current, backgroundImageId)
Image(
rememberDrawablePainter( drawable ),
contentDescription = null)
Row(
horizontalArrangement = Arrangement.Start,
verticalAlignment = <http://Alignment.Top|Alignment.Top>,
) {
Image(
painter = painterResource(id = iconId),
modifier = Modifier
.padding(end = imagePadding.dp),
contentDescription = null
)
Text(
text = text,
fontSize = textSize.sp,
color = colorResource(id = textColor)
)
}
}
}
Any ideas what am I missing please?Nick
08/26/2021, 3:48 PMrajesh
08/26/2021, 4:33 PMadjpd
08/26/2021, 4:42 PMMyAppNameTheme
.
But that boolean doesn't seem dependent on the Android system's dark mode. Am I missing something?Tolriq
08/26/2021, 4:56 PMChris Johnson
08/26/2021, 5:25 PMView.performClick
Mohamed Ibrahim
08/26/2021, 5:32 PMif (condition){
wrapComposableWith( Container() )
} else {
createComposable
}
Rafiul Islam
08/26/2021, 7:34 PMShivam Kumar Jha
08/26/2021, 7:37 PMAnthony
08/26/2021, 7:49 PMApp development SHOULD prefer simpler concrete types until the abstraction provided by an interface proves necessary. When it does, adding a factory function for a default implementation as outlined above is a source-compatible change that does not require refactoring of usage sites.
mean exactly? Should we not hoist our state with an interface and an implementation like so?mcpiroman
08/26/2021, 7:54 PMdimsuz
08/26/2021, 9:11 PMStylianos Gakis
08/26/2021, 9:56 PMAnimatedVisibility
inside a box, so no row or column scope. It works alright but the clipping of how the animation opens up is a square. Meaning that it looks awkward as it comes into the screen especially since the shadows are looking weird. Is there a way to provide a clipping of how it should be expanded just like how I am passing that it should be expanding from the center?jkm
08/27/2021, 2:01 AMdata class Model( var one: Boolean, var two: Boolean, //etc)
do I:
A. declare each of the checkboxes states ? i.e. var someState by remember { mutableStateOf(myModel.one) }
B. declare the state of the collection of checkboxes as var someState by remember { mutableStateOf(myModel) }
I would like to do B, but I’m struggling with the state change callbacks, I’m thinking I might have to do Ajkm
08/27/2021, 2:01 AMdata class Model( var one: Boolean, var two: Boolean, //etc)
do I:
A. declare each of the checkboxes states ? i.e. var someState by remember { mutableStateOf(myModel.one) }
B. declare the state of the collection of checkboxes as var someState by remember { mutableStateOf(myModel) }
I would like to do B, but I’m struggling with the state change callbacks, I’m thinking I might have to do AWill Shelor
08/27/2021, 2:30 AMjkm
08/27/2021, 2:42 AMState<T>.someProperty
wouldn’t trigger a recomposition