gpaligot
10/27/2021, 8:00 PMCheckbox
or it is impossible? I tried to add a padding in the modifier of the composable but it doesn't work.Tolriq
10/27/2021, 8:25 PMAlexander Karkossa
10/27/2021, 9:08 PMLucas Reis
10/27/2021, 10:37 PMBottomNavigation
here but didn't found a solution for something I have in my project.
We created a AuthScreen
in composable()
that don't need to have a BottomNavigation
and it's the first screen of the App. I have only one Scaffold
for the app that encapsulates the NavHost
.
I added a conditional logic on the BottomNavigation
to only show when the current route is equal to some screens but not for the AuthScreen
, similar to how this works on the compose samples.
Everything works fine, but I notice when the AuthScreen
transitions to my HomeScreen
(that is a route that has the BottomNavigation
) the BottomNavigation
appears before the AuthScreen
fades away, and I found this behaviour a little strange, I think that it's something to do with the fade animation of navigation compose, anyone has this problem too and found a solution?
I tried putting Scaffold
in all screens that has the BottomNavigation
but I think this is not good, since Scaffold
is better to be shared throughout the application.itnoles
10/28/2021, 12:52 AMColton Idle
10/28/2021, 1:03 AMDanish Ansari
10/28/2021, 6:01 AMandroidx.navigation.navigation-compose
will be stable?AmrJyniat
10/28/2021, 7:39 AMisError = true
to the TextField the border's color not becomes only Red but I see it's combination of PrimaryColor and Red, any tips about the issue?solidogen
10/28/2021, 8:08 AMJulianK
10/28/2021, 8:35 AMjava.lang.IllegalStateException: Asking for intrinsic measurements of SubcomposeLayout layouts is not supported.
One advice given is using a Custom Layout to avoid measuring, which I've tried, but how would i place the content without first calling measure?Florian
10/28/2021, 9:13 AMFelix Schütz
10/28/2021, 11:01 AMsteelahhh
10/28/2021, 1:13 PM*TopAppBar
and scroll behavior combined with Accompanist's HorizontalPager
. As soon as I add the Scaffold
with the nestedScroll
(as per docs), the pager cannot be scrolled anymore
Code in 🧵galex
10/28/2021, 2:02 PMkotlin-android-extensions
? Meaning, both in the same module?Lucas Reis
10/28/2021, 2:10 PMDiego
10/28/2021, 3:25 PMColton Idle
10/28/2021, 3:29 PMAnthony Martin
10/28/2021, 3:44 PMnglauber
10/28/2021, 5:15 PMFlow operator functions should not be invoked within composition
Basically, almost all flows of my app are using something like this:
val someStateInViewModel by viewModel.myState.flowInLifecycle()
.collectAsState(initial = null)
This flowInLifecycle
function is doing the following:
@Composable
fun <T> Flow<T>.flowInLifecycle(): Flow<T> {
val lifecycleOwner = LocalLifecycleOwner.current
return remember(this, lifecycleOwner) {
this.flowWithLifecycle(lifecycleOwner.lifecycle, Lifecycle.State.STARTED)
}
}
Any suggestion? Because I’m using this function is 225 places in my app 😭Arpit Shukla
10/28/2021, 5:29 PMMichael Langford
10/28/2021, 7:00 PMcomposable ("/EntryEditor/BTypeEditor/${logEntryId}") {
val existing = it.arguments?.getString(logEntryIdentifierName)
EventEditorBType(navController = navController, eventStoreModel = eventStoreModel, existing?.let{BTypeIdentifier(value = it)})
}
This successfully lets us edit new log items as well as select existing log items via nested navigation.
Here is where the problem hits.
When editing new log items, the log items only exist in the ViewModel of the EntryEditor as they aren't saved to the flow store, or the backend, so "deeper" events can't reference the "shallower" events by just parsing the route when the shallower events aren't yet saved to the eventStoreModel. We do need to not save the events until the user confirms they've entered everything to both match iOS and meet scientific needs of the tool.
E.g.
User hits "New BType" Floating Action Button on main screen.
User partially enters in BType event. Hits "previous BTypeEvent" button on this Btype event.
This launches a screen kinda like the main screen, except it only shows BType events. It does also have a + button.
If the user selects an event, how do we easily pass this selected event back to the first editor screen? it's easy enough to go off the route to get the logEntryId in the case where the toplevel BTypeEvent is saved to the event store, however, when a new BTypeEvent event is being recorded, this avenue isn't available, as the event isn't yet in the event store.
This problem also has to be "technically infinitely scalable" but de facto, like 8 levels deep scalable. A person could start to record a current BType record, start storing a new BType record about a past report on this topic, and in that, start storing a past BType record on this item.
In iOS, this is easy, we don't use path based routing, so we can just push a list of BTypeEvents with a + button on it, and if the user hits plus, we let them record the event, save it, etc, then when we return, we call a closure which was passed to the invoked editor when we navigated. We can't pass such closures with jetpack.
One idea I've had is to delve into the backstack to guess if you're saving events for "shallower" events by the path, but with this approach, I'm not sure how to get the reference to the previous screen from this and google is failing me there.
I've heard the approach to "share a view model"...and that feels like a bit of a stretch with how "nested" all of this is and how complex saving that view model wold be, as only parts of it would save at a time.
Any ideas folks?Alexa_Gal
10/28/2021, 7:33 PMcomposable("Screen.Login.route?email={email})
and when i want to push to that screen like navController.navigate(Screen.Login.route?email=<mailto:user+test@example.com|user+test@example.com>)
in the next screen ill get the email argument like user <mailto:test@example.com|test@example.com>
without the +
but that only happens when i use argumentes like ?foo={bar}
no when i use something like /{bar}
Colton Idle
10/28/2021, 9:33 PMNeal Sanche
10/28/2021, 9:40 PMYASAN
10/28/2021, 11:42 PMjava.lang.IllegalStateException: Could not find Navigator with name "BottomSheetNavigator". You must call NavController.addNavigator() for each navigation type.
Zoltan Demant
10/29/2021, 5:14 AMCan't represent a size of X in Constraints
? Full stack-trace in thread! 🧵Colton Idle
10/29/2021, 6:27 AMSteffen Funke
10/29/2021, 7:40 AMLazyList
with items, and each item performs an expensive calculation for itself (Think of very item constrained data, like loading an image, …).
At the moment, as I scroll down and back up the list, the calculation is re-executed, as the item enters composition. This makes sense, but is not quite what I would like to achieve. Instead, I imagined some kind of LazyList
built-in caching mechanism - since the input parameters of the items are known and not changed, and the calculation has already taken place once.
So my questions are:
• is there any way to “cache” such calculations over item compositions in a LazyList
, to avoid a re-calculation on item appearance?
• I wrapped the calculation in a LaunchedEffect
keyed by the input, but it does run every time item enters composition. Makes sense, but not sure if there is a better way?
• Or is this totally wrong think, and I should implement this caching myself, e.g. with a ViewModel type of data holder?
Some sample code, hope it makes sense 👉
Thanks!therealbluepandabear
10/29/2021, 7:51 AMTanaka
10/29/2021, 8:20 AMTanaka
10/29/2021, 8:20 AMsindrenm
10/29/2021, 9:13 AMAlbert Chang
10/29/2021, 9:25 AMhttps://youtu.be/15Q7xqxBGG0?t=569▾
Nat Strangerweather
12/10/2021, 7:50 PMChris Sinco [G]
12/10/2021, 8:04 PMBryan Herbst
12/10/2021, 8:33 PMNat Strangerweather
12/10/2021, 9:13 PMChris Sinco [G]
12/10/2021, 9:22 PM