Luca Nicoletti
10/18/2019, 7:52 PMFlexColumn
compose the 2 Text
in a row instead of a column?Leland Richardson [G]
10/18/2019, 10:41 PMLuca Nicoletti
10/20/2019, 6:01 PMLuca Nicoletti
10/21/2019, 11:27 AMsuppressed
by default for @Composable
functions?wasyl
10/21/2019, 10:49 PM@Model
into another @Composable
function? Something like:
@Composable
fun App() {
val appState = +memo {
ParentModel(
listOf(
ChildModel("Item 1", false),
ChildModel("Item 2", true)
)
)
}
Column {
appState.childModels.forEach { item ->
Item(item)
}
}
}
@Composable
fun Item(item: ChildModel) {
ListItem(
text = { Text(item.description) },
trailing = {
Checkbox(
checked = item.checked,
onCheckedChange = { item.checked = it })
}
)
}
@Model
data class ParentModel(
var childModels: List<ChildModel>
)
@Model
data class ChildModel(
var description: String,
var checked: Boolean
)
?wasyl
10/22/2019, 9:56 AMModelList
, they are being added out of order, that is when I add items slowly I have e.g. 1, 2, 3, 4, 5
. But when I click button to add them fast, I end up with 0, 4, 3, 2, 1
. Even when I try explicitly adding the item at position list.size
. The same happens for an immutable list.
Is this because mutating the state doesn’t guarantee order of the mutation? Is there any way actually have the changes applied in order?Icaro Temponi
10/22/2019, 1:14 PMAdam Bennett
10/22/2019, 5:29 PMNo direct method <init>(Ljava/lang/String;Lkotlin/jvm/functions/Function0;)V in class Landroidx/compose/Ambient; or its super classes
wasyl
10/22/2019, 8:50 PMModifier
type is a LayoutModifier
, which, if I understand correctly, is read and applied in the LayoutNode
in appropriate place.
I know there’s been a discussion about the scope of modifiers, but in the end there’ll be just some number of modifier types handled by the core library in appropriate places, right?
Could you share what other possible types of modifiers were you thinking about in general, not necessarily ones that are likely to be part of Compose?dector
10/23/2019, 6:04 PMFudge
10/23/2019, 6:05 PMzak.taccardi
10/23/2019, 7:07 PMFlow<T>
for this. Every instance of T
is immutable all the way down, which has a bunch of advantages. @Model
seems to require use of var
louis993546
10/23/2019, 7:08 PMflorent
10/23/2019, 7:19 PMAndy Gibel
10/23/2019, 7:27 PMpavi2410
10/23/2019, 7:33 PM@Preview
@Composable
fun Greeting(name: String = "Android") {
Text (text = "Hello $name!")
}
Would the preview work by using default values?passiondroid
10/23/2019, 7:34 PMthemishkun
10/23/2019, 7:39 PM@Preview
annotation is actually pretty cool in terms of documenting your UI components library. Good job! Any plans to have a Library tab in Android Studio, similar to ResourceManager, where I could see all of my components annotated with @Preview
? It would be super cool to have this kind of visual reference of the project guidelinespavi2410
10/23/2019, 7:46 PM1 👁️ | @Composable
2 | fun Greeting(name: String = "Android") {
3 | Text (text = "Hello $name!")
4 | }
Fudge
10/23/2019, 7:51 PM+
thing for effects be removed? Back then you were saying it's gonna go away.Andy Gibel
10/23/2019, 8:36 PMFudge
10/23/2019, 10:09 PMwasyl
10/23/2019, 10:17 PMromainguy
10/23/2019, 10:22 PMandrew
10/23/2019, 10:36 PMSteve
10/23/2019, 10:44 PMCody Engel
10/24/2019, 4:25 AMFloatingActionButton
to display an image yet? I feel like I’m missing something very simple…
val resource = +vectorResource(R.drawable.ic_baseline_add)
FloatingActionButton(icon = resource) // takes an Image instead of Vector, how does one convert a Vector to an Image with Compose?
Cody Engel
10/24/2019, 5:00 AM@Model
class Name(var name: String = "Android") : ViewModel()
But inheritance isn’t currently supported for Model objects.
We currently use LiveData a lot today but with Compose it seems like unnecessary overhead.Cody Engel
10/24/2019, 5:32 AM+observe
isn’t quite I was hoping for, making the entire ViewModel observable with @Model
was more what I was hoping for.
I don’t think +observe
currently exists as part of the Canary build either? Android Studio at least can’t recognize it on my end.
I’ll try to stop by the office hours tomorrow to talk it through a bit more. Thanks again for all of the help and sorry for bugging ya at 10:30 at night 😅Gil Goldzweig
10/24/2019, 5:39 AM