agrosner
12/08/2021, 1:25 PMJavier
12/08/2021, 1:47 PMnglauber
12/08/2021, 2:49 PMMainActivity
is running and has the ScreenA
and ScreenB
in the backstack.
If the user press the notification I would like to keep the MainActivity
opened just adding the ScreenC
to the backstack… Is there a way to do that?Mihai Voicescu
12/08/2021, 5:06 PMNavHostController
to navigate using the ComposeNavigator
API. I need access to it in certain Compose
functions.
Is using the CompositionLocal
API suitable for efficiently pass it around? Seems like they need access to the same reference and I couldn't find a function that already does that...
Something like this
val navController = rememberNavController()
CompositionLocalProvider(LocalNavHostController provides navController) {
NavHost(navController = navController, startDestination = navController.pathToMainScreen) {
composable(navController.pathToMainScreen) { MainScreen() }
composable(navController.pathToWifiScreen) { WiFiScreen() }
}
}
Brian G
12/08/2021, 7:50 PMFrancois Morvillier
12/08/2021, 7:55 PMChris Johnson
12/08/2021, 8:48 PMdetectTransformGestures
and also detectTapGestures
with double tap.tad
12/09/2021, 12:22 AMTYPE_NUMBER_FLAG_DECIMAL
set, which doesn't appear possible via TextInputService
on Android.
https://issuetracker.google.com/issues/209835363joney
12/09/2021, 8:47 AMpackage androidx.compose.ui.res
provides access to resources as follows (src):
@Composable
@ReadOnlyComposable
private fun resources(): Resources {
LocalConfiguration.current //<---- why?
return LocalContext.current.resources
}
☝️ I wonder why a call to LocalConfiguration.current
is needed before accessing the resources
field. Is this a pattern which I should follow for any values provided with local composition?
👇 So should I do this in my own code?
@Composable
@ReadOnlyComposable
private fun myThing(): MyThing {
LocalThings.current //<---- why?
return LocalSomeThings.current.myThing
}
yschimke
12/09/2021, 10:33 AMPages in bothDoes this mean it is safe to use LaunchedEffect as a signal that the current page is just been shown? Or do they get created eagerly when user is contemplating a scroll/starting a swipe? Should pager state change events be used instead?andHorizontalPager
are lazily composed and laid-out as required by the layout. As the user scrolls through pages, any pages which are no longer required are removed from the content.VerticalPager
Tomáš Hubálek
12/09/2021, 12:37 PMText(
text = "Something",
style = MaterialTheme.typography.body1
)
then color is wrong when Android is set to dark mode.
It is somehow connected to `Surface`/`Scaffold`but it is still not working for me.
Why it is designed in so counterintuitive way? It looks like I have to specify colors in Typography
(which is solution I feel is wrong as colors should be in ColorScheme IMHO)Pavle Joksovic
12/09/2021, 2:06 PMRow {
ComponentA()
Column(modifier = Modifier.fillMaxSize()){
ComponentB()
}
}
how can I align the ComponentB to bottom right of the Column?
I'm trying to achieve something from the image attachedFilip Wiesner
12/09/2021, 2:17 PMVisualTransformation
in TextField
(even with PasswordVisualTransformation
)
Whenever VisualTransformation
is involved the cursor disappears and cannot be moved by dragging. (video example)Chris Fillmore
12/09/2021, 3:14 PMAshu
12/09/2021, 3:41 PMYASAN
12/09/2021, 4:56 PMView
variable inside a shared ViewModel which lives with in the app scope and not inside a specific route. I use this view inside one of my routes. My issue is that if the screen is rotated or the route is navigated to again from itself, loading the view throws an exception since the view is still attached to the previous layout parent.
I know the fix for this is to have at least 2 instances of the view I need but the issue is that composable lifecycles work a bit weirdly and I cannot figure out exactly how and when I should tell the ViewModel to switch the used view so it wont throw an exception.
More in 🧵Tolriq
12/09/2021, 5:53 PMChris Fillmore
12/09/2021, 5:53 PMModalBottomSheetLayout
and BottomSheetNavigator
and I’d like my bottom sheets to open into Expanded
state. The HalfExpanded
state doesn’t really suit my use case as there is often a lot of content in the sheet, and/or the keyboard is up.
But, curiously, ModalBottomSheetState.expand()
is internal
and it’s not obvious to me how I could manipulate SwipeableState.anchors
.
Any advice? Thanks!Brian Donovan
12/09/2021, 6:13 PMRob
12/09/2021, 7:15 PMImage
match the aspect ratio of the image loaded?zsperske
12/09/2021, 7:25 PMfirstBaselineToTopHeight
& lastBaselineToBottomHeight
(TextView attributes) available in Compose?brabo-hi
12/09/2021, 11:20 PMandroidx.compose.material3:material3:1.0.0-alpha02
scaffoldState
has been removed. Does it mean in the future we will no longer be able to launch a Snackbar and link it’s state to the Scaffold?darkmoon_uk
12/10/2021, 12:52 AMAnimatedContent
transitions because multiple recompositions are firing where conceptually there should be only one.
Carefully tracing the code for state changes is a given, just wondering if people can share any smart breakpoints/profiling tricks they're employing?star_zero
12/10/2021, 1:53 AMPeng Wang
12/10/2021, 3:43 AM@Composable
@Deprecated("Example with bug")
fun ListWithBug(myList: List<String>) {
var items = 0
Row(horizontalArrangement = Arrangement.SpaceBetween) {
Column {
for (item in myList) {
Text("Item: $item")
items++ // Avoid! Side-effect of the column recomposing.
}
}
Text("Count: $items")
}
}
I don't know why this code has thread-safe problem, can anyone explain ? https://developer.android.google.cn/jetpack/compose/mental-model#parallelZoltan Demant
12/10/2021, 6:37 AModay
12/10/2021, 7:03 AMweight
Modifier? just goes unresolved, no hint to import or anything, using Compose 1.0.5
iamthevoid
12/10/2021, 8:40 AMfillMax...
looks pretty the same, but when it applied to child of container, that doesn’t have exact size, then child stretch the parent
when i used view framework i can did like
parent(wrap_content) {
child(match_parent) // 1
child(exact_size) // 2
}
and size of 1
was always the same as size of 2
. And when size of 2
changes size of 1
changes as well. Can i do the same in Compose?fvink
12/10/2021, 11:15 AMjannis
12/10/2021, 11:25 AMAnimatedNavHost
from the Accompanist library (+latest Compose beta). Even if I disable all animations, e.g.:
AnimatedNavHost(
...
enterTransition = { EnterTransition.None },
exitTransition = { ExitTransition.None },
popEnterTransition = { EnterTransition.None },
popExitTransition = { ExitTransition.None },
) {
I see an expand transition when I open a new screen. Can I disable that somehow? I don't even see where this might coming from 😅jannis
12/10/2021, 11:25 AMAnimatedNavHost
from the Accompanist library (+latest Compose beta). Even if I disable all animations, e.g.:
AnimatedNavHost(
...
enterTransition = { EnterTransition.None },
exitTransition = { ExitTransition.None },
popEnterTransition = { EnterTransition.None },
popExitTransition = { ExitTransition.None },
) {
I see an expand transition when I open a new screen. Can I disable that somehow? I don't even see where this might coming from 😅Alex
12/10/2021, 11:30 AMjannis
12/10/2021, 11:58 AMallan.conda
12/10/2021, 8:39 PMKimon
01/30/2022, 12:08 PMjannis
01/31/2022, 7:58 AMKimon
01/31/2022, 8:30 AM