loloof64
02/02/2021, 10:39 AMwhy
02/02/2021, 11:07 AMnull
like this:
Modifier.clickable (indication = null){}
any idea?Michael Elgavi
02/02/2021, 12:12 PMLazyColumn
measure the entire list on first composition, and only composes the visible items? Or is the measurement also only done for the visible items?Yuri Drigin
02/02/2021, 1:23 PMloloof64
02/02/2021, 2:18 PMNeal Sanche
02/02/2021, 4:30 PMlewis
02/02/2021, 4:42 PMval lazyItems = posts.collectAsLazyPagingItems()
if(lazyItems.itemCount == 0) {
NoItemsLeft()
} else {
LazyColumn(modifier = modifier) {
items(lazyItems) {
grandstaish
02/02/2021, 7:27 PMTash
02/02/2021, 8:23 PMspierce7
02/02/2021, 11:06 PMAndroidView
composable to embed a native Android View into Jetpack Compose. However, I’d when a certain event happens on my model, I’d like to re-create the AndroidView
, removing the old, and replacing it with a newly created one. How would I go about doing that?Alexa_Gal
02/03/2021, 2:09 AMModalBottomSheetLayout
? at the moment i only get the next view after the second click/composeYuri Drigin
02/03/2021, 7:19 AMTheme
? I create colors, palettes and theme like in the sample,
but colors changed only for text not for backgrounds (surfaces)André Thiele
02/03/2021, 9:25 AMKshitij Patil
02/03/2021, 9:47 AM@Composable
function. Currently I was planning to borrow the constraints from parent layout through Modifier
type parameter.
@Composable
fun CustomGroup(
<required-fields>,
...,
firstComponentModifier: Modifier = Modifier,
secondComponentModifier: Modifier = Modifier,
...,
<other optional fields>
) { ... }
This seems to be working for me but the linter gives this ConstrainedLayoutReferences
class public so that I could pass it on as parameter to other functionJorkoh
02/03/2021, 12:53 PMindicatorIndex
here doesn't use animateFloatAsState()
? Is there a difference?
+ val indicatorIndex by animateFloatAsState(selectedIndex.toFloat(), animSpec)
- val indicatorIndex = remember { Animatable(0f) }
- val targetIndicatorIndex = selectedIndex.toFloat()
- LaunchedEffect(targetIndicatorIndex) {
- indicatorIndex.animateTo(targetIndicatorIndex, animSpec)
- }
loloof64
02/03/2021, 1:49 PMPiotr Prus
02/03/2021, 3:17 PMColton Idle
02/03/2021, 3:24 PMNoé Casas
02/03/2021, 4:36 PM.clickable
modifier but with information of the position where the user clicked?Kirill Grouchnikov
02/03/2021, 6:42 PMMichael Elgavi
02/03/2021, 9:25 PMfillMaxHeight()
? I guess it would be possible with ConstraintLayout
, wondering if there's a simpler solution.Colton Idle
02/03/2021, 10:49 PMobject MyCompanyColors {
val Background = Color(0xFFFFFFFF)
val Text = Color(0xFF424242)
//20 other colors
}
Anyone see anything wrong with this? I feel like the docs and codelabs don't really have any guidance on how to create a Color sheet UNLESS you go the material theme routeizyaboi
02/04/2021, 8:03 AMallan.conda
02/04/2021, 8:27 AMallan.conda
02/04/2021, 9:33 AMSwitch
so we can build our own design components with less effort? Just like we have BasicTextField
, I’m wondering if we could have something like BasicSwitch
. Currently we resort to copy-pasting non-public components in order to easily build our own design. I’m wondering if this is the ideal way to move forward for such cases.julioromano
02/04/2021, 10:15 AMjulioromano
02/04/2021, 2:40 PMStateRestorationPolicy.PREVENT_WHEN_EMPTY
for LazyColumn
?
LazyColumn
doesn’t currently restore the scroll position if the list’s data is fed using something like val myList by aFlow.collectAsState(emptyList())
.
For example during configuration changes (like rotation, dark/light theme switch, etc.) the flow will be resubscribed to and so aFlow
will temporarily emit emptyList()
causing the saved scroll position to be discarded.
This is a workaround I found but I was hoping it could be handled better:
if (myList.isNotEmpty()) {
LazyColumn() {
// .....
}
}
David Attias
02/04/2021, 2:58 PMpopUpTo
with a route which includes an optional argument. Is it supposed to work? Is it an issue ?Kensuke Sano
02/04/2021, 3:22 PMBox(modifier = Modifier.width(100.dp)) {
Box(modifier = Modifier.preferredSize(50 %) ) { // 50% equals 50.dp
Text("HELLO")
}
}
Colton Idle
02/04/2021, 5:45 PMFunctions which invoke @Composable functions must be marked with the @Composable annotation
colors = object : ButtonColors {
override fun backgroundColor(enabled: Boolean): Color =
JetsnackTheme.colors.color1
override fun contentColor(enabled: Boolean): Color =
JetsnackTheme.colors.color1
}
if I remove that block, then everything compiles fine.
Any ideas?Colton Idle
02/04/2021, 5:45 PMFunctions which invoke @Composable functions must be marked with the @Composable annotation
colors = object : ButtonColors {
override fun backgroundColor(enabled: Boolean): Color =
JetsnackTheme.colors.color1
override fun contentColor(enabled: Boolean): Color =
JetsnackTheme.colors.color1
}
if I remove that block, then everything compiles fine.
Any ideas?Cyril Find
02/04/2021, 5:51 PM@Composable
Colton Idle
02/04/2021, 6:15 PMConflicting overloads: @Composable public open fun backgroundColor
=(Cyril Find
02/04/2021, 6:17 PMColton Idle
02/04/2021, 6:18 PMCyril Find
02/04/2021, 6:18 PMColton Idle
02/04/2021, 7:13 PMCyril Find
02/04/2021, 10:47 PMJan Bína
02/05/2021, 12:11 AMButtonDefaults
object, like this:
OutlinedButton(
colors = ButtonDefaults.buttonColors(
backgroundColor = Color.Black
...
)
)
Colton Idle
02/05/2021, 2:22 PM