Adam Powell
05/13/2020, 7:14 PMbohregard
05/14/2020, 12:14 AMBox(
modifier = Modifier.fillMaxSize(),
gravity = Alignment.BottomEnd
) {
Column(modifier = Modifier.fillMaxHeight()) {
....
}
val icon = vectorResource(id = R.drawable.ic_home)
FloatingActionButton(
onClick = {
}, modifier = Modifier.padding(20.dp)
) {
Image(asset = icon, modifier = Modifier.preferredSize(24.dp))
}
}
Is there a better way than the above?Timo Drick
05/14/2020, 9:22 AMjitinsharma
05/14/2020, 1:29 PMval themeColors = lightColorPalette(
primary = Color(0xFF092432),
primaryVariant = Color(0xFF092432),
secondary = Color(0xFF3DDB85)
)
And initialised the same like this
MaterialTheme(colors = themeColors) {
// children
}
Now if I access colors using MaterialTheme.colors
, I’m able to get custom colors in all composables except for Dialog
In Dialog
, the colours reset to default values.
Is this a known issue?Val Salamakha
05/15/2020, 12:15 AM"androidx.ui:ui-framework"
excluded from compose?Zach Klippenstein (he/him) [MOD]
05/15/2020, 10:55 AMDrawFoo(myFoo)
2️⃣ myFoo.draw()
Both functions are composable and do the same thing. Worded another way, when is it appropriate/idiomatic to create a composable extension function?Gabriel Feo
05/15/2020, 12:41 PMcarlos cdmp
05/15/2020, 1:27 PMromainguy
05/15/2020, 2:53 PMVal Salamakha
05/16/2020, 3:50 AMcb
05/16/2020, 8:28 AMhenrikhorbovyi
05/16/2020, 4:14 PMKazemihabib1996
05/16/2020, 5:01 PMVinay Gaba
05/16/2020, 11:54 PMgrandstaish
05/17/2020, 1:23 AMmolikto
05/17/2020, 8:50 AMcaelum19
05/17/2020, 10:48 PMcoolchandrakumar
05/18/2020, 1:44 PMval modifier = Modifier.rawDragGestureFilter(dragObserver = object : DragObserver { })
Button( onClick = {
log()
}) {
Text(text = "Delete")
}
Box( modifier = modifier.drawLayer(
translationX = itemLeft.value
)
) {
}
Button click not working !!! translationX not moving the actual UI coordinates !?Zach Klippenstein (he/him) [MOD]
05/18/2020, 3:53 PMOwnerAmbient
to get access to the root View for inflating nested Android views further down in the composition. The inflation is being done by another library, so I can't use the AndroidView(Int)
composable. However, OwnerAmbient
is deprecated. Is there (or will there be) another API for getting access to the View hosting a composition?Vinay Gaba
05/18/2020, 4:58 PMContextDrawScope
and clipRRect
was removed from it. What’s the alternative if I want to clip a rect with rounded corners?Kazemihabib1996
05/18/2020, 5:43 PMsubcomposition
multiple times in slack, what does it mean?Timo Drick
05/18/2020, 8:48 PMVerticalScroller() {
Column(Modifier.padding(10.dp)) {
for (i in 0..50) {
Box(backgroundColor = if (i % 2 == 0) Color.LightGray else Color.Gray) {
HorizontalScroller(()) {
Row {
for (j in 0..10) {
Text("i: $i element $j", Modifier.padding(20.dp))
}
}
}
}
}
}
}
bohregard
05/18/2020, 10:51 PM@Composable
fun buildUi() {
Column(
modifier = Modifier.fillMaxSize(),
horizontalGravity = Alignment.CenterHorizontally
) {
SurfaceView(ContextAmbient.current)
}
}
dagomni
05/19/2020, 6:06 PMkagomez
05/20/2020, 6:08 AMAntanas A.
05/20/2020, 11:33 AMgrandstaish
05/20/2020, 3:45 PMSrSouza
05/20/2020, 5:42 PMflosch
05/21/2020, 6:40 PM@Composable
internal fun composeCoroutineScope(
coroutineContext: CoroutineContext = SupervisorJob() + Dispatchers.Main.immediate
): CoroutineScope {
val scope = remember { CoroutineScope(coroutineContext) }
onDispose { scope.cancel() }
return scope
}
Guy Bieber
05/21/2020, 9:08 PMExpected (without @Model):
{"public_key":"","user":{"email":"<mailto:me@me.com|me@me.com>","password":"fun"}}
Actual (with @Model):
{"$record":{"user":{"$record":{"me":"<mailto:guy@me.com|guy@me.com>","password":"fun","frameId":1}},"frameId":1},"public_key":""}
Guy Bieber
05/21/2020, 9:08 PMExpected (without @Model):
{"public_key":"","user":{"email":"<mailto:me@me.com|me@me.com>","password":"fun"}}
Actual (with @Model):
{"$record":{"user":{"$record":{"me":"<mailto:guy@me.com|guy@me.com>","password":"fun","frameId":1}},"frameId":1},"public_key":""}
Zach Klippenstein (he/him) [MOD]
05/21/2020, 9:39 PM@Model
is getting deprecated. Is your class immutable? Then you should mark it @Immutable
instead.Guy Bieber
05/21/2020, 9:40 PMZach Klippenstein (he/him) [MOD]
05/21/2020, 9:41 PMGuy Bieber
05/21/2020, 9:42 PMZach Klippenstein (he/him) [MOD]
05/21/2020, 9:46 PMMutableState
. If you need to change your json model, just put a new instance into the state.
If you can’t use an immutable value for some reason, then you can make a wrapper that maintains MutableState
properties for every property on your JSON object.@Model
deprecation is landing in the next dev release though.Guy Bieber
05/21/2020, 9:50 PMZach Klippenstein (he/him) [MOD]
05/21/2020, 9:56 PMMutableState
holders in your UI layer. How are your JSON model objects mutated?Guy Bieber
05/21/2020, 10:00 PMZach Klippenstein (he/him) [MOD]
05/21/2020, 10:02 PMGuy Bieber
05/21/2020, 10:03 PMZach Klippenstein (he/him) [MOD]
05/21/2020, 10:03 PMGuy Bieber
05/21/2020, 10:04 PMZach Klippenstein (he/him) [MOD]
05/21/2020, 11:16 PM