aryk
03/04/2020, 12:37 PMKazemihabib1996
03/04/2020, 5:58 PMContainer(width = 400.dp, height = 400.dp) {
Clip(shape = RoundedCornerShape(20.dp)) {
Draw { canvas, parentsize ->
val outer = Rect(10f, 10f, 100f, 100f)
canvas.drawRect(outer, paint)
}
}
}
tcracknell
03/04/2020, 6:14 PMKevin Hester
03/04/2020, 7:01 PMaryk
03/04/2020, 9:18 PMindent
parameter? Can't we just add a left offset with padding?
@Composable
fun Divider(
modifier: Modifier = Modifier.None,
color: Color = MaterialTheme.colors().surface,
height: Dp = 1.dp,
indent: Dp = 0.dp
): Unit
gumil
03/04/2020, 10:42 PM0.1.0-dev06
Is this a known error? I also get e: java.lang.IllegalStateException: Backend Internal error: Exception during code generation
when adding Text Stylehenrikhorbovyi
03/05/2020, 3:01 PMIan Warwick
03/05/2020, 4:39 PMDrawShape
now?Ian Warwick
03/05/2020, 5:13 PMgumil
03/05/2020, 7:50 PM@Model
classes. I suspect that the noinline
might have affected this. It works okay using a plain buttonThaw De Zin
03/06/2020, 6:35 AMIan Warwick
03/06/2020, 9:53 AMIan Warwick
03/06/2020, 10:12 AMaryk
03/06/2020, 9:47 PMVinay Gaba
03/07/2020, 6:45 AMImagePainter
to display an image. Code in thread..itnoles
03/07/2020, 6:56 AMKlaas Kabini
03/07/2020, 7:32 AMBox(modifier = modifier + ImagePainter(image = image).toModifier(),
shape = CircleShape,
border = Border(borderWidth, borderColor))
molikto
03/07/2020, 9:46 AMkotlin.UninitializedPropertyAccessException was thrown at: org.jetbrains.kotlin.ir.declarations.impl.IrDeclarationBase.getParent
. Excepton in thread. Any idea how to fix it ?aryk
03/07/2020, 1:04 PM@Model
into a Composable without having it recompose when something changes?Andrew Kuryan
03/07/2020, 1:19 PMKlaas Kabini
03/08/2020, 8:56 AMcaelum19
03/08/2020, 8:24 PMcomposeOptions {
kotlinCompilerExtensionVersion = "0.1.0-dev06"
kotlinCompilerVersion "1.3.61-dev-withExperimentalGoogleExtensions-20200129"
}
buildFeatures {
// viewBinding = true
compose true
}
Anyone else experienced this?gpaligot
03/09/2020, 5:11 PMursus
03/10/2020, 3:21 AMdata class State(
val items: List<Item> = emptyList(),
...
)
sealed class Item
data class HeaderItem(val titleRes: Int) : Item()
sealed class ServiceItem : Item() { ..
data class SimpleItem(..) : ServiceItem
data class FormItem(val textItems: List<TextItem> = emptyList()) : ServiceItem
-- lets say now I need to change text item inside a form item
with mutable models code is pretty neat in kotlin
state.items
.firstOrNull { it is FormItem && item.service.id == serviceId }
?.let { it as FormItem }
?.textItems
?.firstOrNull { it.id == textItemId }
?.apply {
value = text
validity = FormItem.TextItem.Validity.PENDING
}
with immutable obviously you need to create copies
setState {
copy(
items = items.map { item ->
if (item is FormItem && item.service.id == serviceId) {
item.copy(
textItems = item.textItems.map {
if (it.id == textItemId) {
it.copy(value = text, validity = FormItem.TextItem.Validity.PENDING)
} else {
it
}
})
} else {
item
}
}
)
}
ursus
03/10/2020, 3:22 AMjolo
03/10/2020, 1:30 PMGuy Bieber
03/10/2020, 1:41 PMGuy Bieber
03/10/2020, 1:41 PMkyleg
03/10/2020, 4:17 PMimport mycomposemodule.testactivity
. How do I accomplish this? I’m trying to add Compose functionality to an existing application that uses Room and other stuff. dev06
, by the way.amar_1995
03/10/2020, 8:08 PM