Lilly
04/16/2022, 11:26 PMLazyVerticalGrid
?James Black
04/17/2022, 4:50 AMNoop
04/17/2022, 6:59 AMval navController = rememberNavController()
error then below
java.lang.IllegalStateException: 2. expected value parameter count to be higher: rememberNavController()
what’s the problem?Sanendak
04/17/2022, 11:00 PMnuhkoca
04/18/2022, 1:55 AMTopBar
mimic(it is not a Scaffold TopBar
, rather just a Box
due to transparency) and I need to use a sticky header in my LazyColumn
but the header doesn’t stick to custom Box(TopBar mimic)
as it probably doesn’t treat it as a TopBar
. How do I manage to have a sticky header with a custom mimic?myanmarking
04/18/2022, 10:32 AMIlya Kalibrov [JB]
04/18/2022, 10:43 AMSlackbot
04/18/2022, 10:53 AMFilip Wiesner
04/18/2022, 1:51 PM@Composable
function when you ask yourself "should I divide this into separate composables/files"?
1️⃣ 50 lines
2️⃣ 100 lines
3️⃣ 200 lines
4️⃣ 300 lines
5️⃣ It's not dependant on number of lines but rather number and cohesion of parameters
6️⃣ It's fine as long it does "one thing".
7️⃣ Other 👉 commentNthily
04/18/2022, 6:30 PMDavid Corrado
04/18/2022, 8:57 PMnatario1
04/18/2022, 11:02 PMandroidx.compose.foundation.lazy.layout.LazyLayout
, or even better smaller parts like LazyLayoutItemContentFactory
and LazyLayoutPrefetcher
? They would help so much for creating custom lazy layouts.aniruddha dhamal
04/19/2022, 12:52 AMLazyColumn
, I'm using fading animation for item animation. When item is added, all the items on the screen animate. How to get only that item animated and rest of the items shift the positions? Details in the 🧵David W
04/19/2022, 6:24 AM@Composable
, which doesn't exist in the business layer. Any patterns on how to structure that? I'll put what I have so far in the thread.Nana Vong
04/19/2022, 6:55 AMJonas Frid
04/19/2022, 8:53 AMColton Idle
04/19/2022, 1:31 PMAyfri
04/19/2022, 4:24 PMfillMaxWidth()
but I only want to limit the maximum size)Mikael Alfredsson
04/19/2022, 4:53 PMagrosner
04/19/2022, 5:31 PMChris Fillmore
04/19/2022, 7:08 PMMultiplePermissionsState
as the key
in a LaunchedEffect?Tash
04/19/2022, 7:30 PMandroidx.profileinstaller:profileinstaller:1.2.0-alpha01
?
According to the docs, it seems like that dependency is only necessary when creating custom profiles, but just double-checking 🙏🏼Tin Tran
04/20/2022, 2:52 AMBoxWithConstrain {
val maxHeight = maxHeight
Box(
Modifier.heightIn(min = 0.dp, max = maxHeight * .8f)
)
}
Rafal
04/20/2022, 12:23 PMRecyclerView
in my NavigationView
. When I use the LazyRow
or Row(Modifier.horizontalScroll())
the touch events are not intercepted properly and instead of scrolling the row, the NavigationView
is closing. Is there any way to make the ComposeView
intercept touch events?Gabriel Lasso
04/20/2022, 12:34 PMComposeView
inside a ConstraintLayout
it began flickering when it is expanding or contracting. Anyone can help me?
I created a minimal example of it happening here (video on README.md)Yves Kalume
04/20/2022, 12:41 PMMarko Novakovic
04/20/2022, 12:47 PMprivate fun <T : Any> SavedStateHandle.saveableMutableStateOf(
key: String,
saver: Saver<T, out Any> = autoSaver(),
init: () -> T,
): MutableState<T> {
@Suppress("UNCHECKED_CAST")
(saver as Saver<T, Any>)
val value = mutableStateOf(restoreOrInit(key, saver, init))
saveToStateHandle(key, saver, value)
return value
}
private fun <T : Any> SavedStateHandle.restoreOrInit(
key: String,
saver: Saver<T, Any>,
init: () -> T,
): T = run {
val restored = get<Bundle>(key)?.get("value")?.let(saver::restore)
restored ?: init()
}
private fun <T : Any> SavedStateHandle.saveToStateHandle(
key: String,
saver: Saver<T, Any>,
value: MutableState<T>,
) = setSavedStateProvider(key) {
val saverScope = SaverScope { true }
with(saver) {
bundleOf("value" to saverScope.save(value.value))
}
}
...
//usage
private var _state by savedStateHandle.saveableMutableStateOf(STATE) { initialState }
this used to work but now in 1.2.0-alpha07
setting _state
doesn’t save value to SavedStateHandle
Jhonatan Sabadi
04/20/2022, 12:56 PMdata class
, and i created a mutableStateOf<MyClass>().
What is the best way to update this data class with mutable state on ViewModel?
• Set value directly: myClass.property = "value"
• Or use copy function: myClass.copy(property = "value")
Tolriq
04/20/2022, 6:13 PMjava.lang.IllegalArgumentException: Inconsistency between the count of nodes tracked by the state (0) and the children count on the SubcomposeLayout (3). Are you trying to use the state of the disposed SubcomposeLayout?
with LazyList. Anyone can explain more the error so I can build a repro before opening an issue ?zalewski.se
04/20/2022, 6:28 PM1.6.20
? 🙂zalewski.se
04/20/2022, 6:28 PM1.6.20
? 🙂kenkyee
04/20/2022, 6:53 PMandrew
04/20/2022, 8:44 PMJames Black
04/21/2022, 2:36 AMArkadii Ivanov
05/15/2022, 10:11 AMkenkyee
05/15/2022, 10:37 AMArkadii Ivanov
05/15/2022, 10:38 AM