Oussama Haff.
02/04/2021, 6:00 PMColors
and Typography
are annotated with different annotations @Stable
for the first and @Immutable
for the second.
Does this mean at a higher level that The Material Theme Composable expect colors to change at a moment of time (dark/light) but not expecting a change of typography ?Shakil Karim
02/04/2021, 6:53 PMVitor Prado
02/04/2021, 8:08 PMnavigate("")
?Jordi Saumell
02/04/2021, 10:12 PMUtkarsh Tiwari
02/05/2021, 4:59 AMmorfly
02/05/2021, 8:44 AMdp
value and ends with fillMaxWidth
?
For example:
val width = DpPropKey("width")
val transitionDefinition = transitionDefinition<ButtonState> {
state(ButtonState.COLLAPSED) {
this[width] = 60.dp
}
state(ButtonState.EXPANDED) {
this[width] = ??? // how can I represent a `fillMaxWidth` value here?
}
}
Thanks!Kensuke Sano
02/05/2021, 10:47 AMloloof64
02/05/2021, 12:39 PMloloof64
02/05/2021, 1:29 PMandroidx.compose.animation.core.Transition
cheap or expensive to create ? I mean, is it safe to create an array of Transition
? I mean a 64 cells arrayZach Klippenstein (he/him) [MOD]
02/05/2021, 4:07 PMAndroidComposeTestRule
assertions? Example in thread.julioromano
02/05/2021, 4:37 PMBasicTextField
whose onValueChange
does two things:
1. Feeds `onValueChange`’s value back to the BasicTextField
to display what the user has typed.
2. Triggers an HTTP search call to fetch updated data to be displayed.
I’d like to debounce 2. but not 1. but: since the onValueChange
is a single callback I see no “easy” way to do it.
Were I to debounce the whole onValueChange
callback, the user will notice a lag with the on screen feedback too.
I believe this is a pretty common use case so I’m wondering if there’s a compose friendly pattern to handle this or if something ad-hoc must be concocted.Devesh Sanghvi
02/05/2021, 7:12 PMScrollableRow
with list of composable. Is there any state within compose that I can use to know if that view has been brought to Foreground (basically I want to know onResume() has been called)? Based on that I can scroll the list to the start.Shakil Karim
02/05/2021, 7:13 PMTash
02/05/2021, 9:38 PMViewModel
to cache state across configuration changes?Mehdi Haghgoo
02/06/2021, 8:22 AMDenis
02/06/2021, 10:03 AMcounts
list on each tap. I expect it to render a new Count
and somehow move previous rows down without calling Count
again. Is it possible?
@Composable
fun CounterApp() {
var counts by remember { mutableStateOf(listOf<Int>()) }
var taps by remember { mutableStateOf(0) }
Column(
modifier = Modifier.fillMaxSize().clickable(onClick = {
counts = listOf(taps) + counts; taps++
})
) { Text("$taps"); Divider(); counts.forEach { Count(it) } }
}
@Composable
fun Count(n: Int) {
Log.d("Count", "$n")
Text("$n")
}
lewis
02/06/2021, 11:14 AMandroidx.paging.compose.LazyPagingItems#getItemCount
for recomposition on change?Jordi Saumell
02/06/2021, 4:53 PMOnDestinationChangedListener
of the Navigation component. I have a bottom nav bar with 3 items, and the third is a subgraph. When I navigate to that one my OnDestinationChangedListener gets called twice, first with the start destination and then with the actual destination.
Is this the intended behaviour?Rick Regan
02/06/2021, 5:14 PMCheckbox
have onCheckedChange: (Boolean) -> Unit
instead of onClick: () -> Unit
only to support TriStateCheckbox
? I can see why it's there for that but if you are not using TriStateCheckbox (the normal usage case?) it seems strange that it's just not onClick (like Button, RadioButton, TextButton, and even TriStateCheckbox itself). Why not have a second signature for CheckBox with onClick instead of onCheckedChange?Dominaezzz
02/06/2021, 5:16 PMShakil Karim
02/06/2021, 5:17 PMJordi Saumell
02/06/2021, 7:41 PMupdateConfiguration(config, displayMetrics)
, which works fine but happens to be deprecated 😅.
All other ways that I know of rely on activity recreation (wrapping the context and using createConfigurationContext
, using attachBaseContext
, using applyOverrideConfiguration
).
Is there a non-deprecated way of doing this (without recreating the activity)?
(I think overwriting the language is considered not being the best practice, but it is quite common and many clients want it 🤷♂️)Michael Elgavi
02/06/2021, 7:54 PMColumn
? Tried fillMaxHeight
but that takes up the entire columnColton Idle
02/07/2021, 12:40 AMkotlinCompilerExtensionVersion
to 1.4.21-2
should I also set all of the other kotlin versions to the same thing? i.e. kotlin-stdlib, etc? I feel like I never heard about this -2 release of kotlinDenis
02/07/2021, 6:56 AMvar names = remember { mutableStateListOf<String>() }
it starts to work. Is it a mistake in docs or am I doing/expecting something wrong?Nat Strangerweather
02/07/2021, 9:54 AMIlias Zosimadis
02/07/2021, 10:37 AMZhelyazko Atanasov
02/07/2021, 2:52 PMTextField
and BasicTextField
, Text
and BasicText
. But I can't seem to find the "Basic" version of a Button
. That is - if I don't want to use the material buttons or library, is there a barebone composable for a button or I'd have to implement one myself?Noé Casas
02/07/2021, 7:09 PMLazyColumn
if I scroll down slowly, rows are adjusted to adjust to the first row. If I scroll up slowly, I can’t get past the current first visible element; scrolling up faster I can get past it. I am not passing anything special to LazyColumn
. The same happens with LazyVerticalGrid
. Can I disable this behaviour? I am using alpha-10, but it also happens at least in alpha-09 and alpha-08Noé Casas
02/07/2021, 7:09 PMLazyColumn
if I scroll down slowly, rows are adjusted to adjust to the first row. If I scroll up slowly, I can’t get past the current first visible element; scrolling up faster I can get past it. I am not passing anything special to LazyColumn
. The same happens with LazyVerticalGrid
. Can I disable this behaviour? I am using alpha-10, but it also happens at least in alpha-09 and alpha-08Adam Powell
02/07/2021, 7:11 PMNoé Casas
02/07/2021, 7:43 PM