georgiy.shur
08/10/2021, 1:13 PMModalBottomSheetLayout
. But I’m struggling to add a dragging indicator above the sheet (see the image). In the old framework I could use anchor for this, but it seems there’s nothing like this in Compose. I know that I could always achieve the same effect using custom content and not use the shape for bottom sheet, but it doesn’t seem very clean.
The screenshot of what I’m trying to achieve is in the thread.lhwdev
08/10/2021, 2:20 PMfun interface
with @Composable
works or still WIP? I encountered this:
fun interface SomeComposable {
@Composable fun Content()
}
val content = SomeComposable { Text("hi") } // <- @Composable invocations can only happen from the context of a @Composable function
val content = SomeComposable @Composable { Text("hi") } // <- type mismatch: inferred @Composable () -> Unit but () -> Unit is expected
Akram Bensalem
08/10/2021, 3:04 PMjava.lang.IllegalStateException: Could not find Navigator with name "animatedComposable". You must call NavController.addNavigator() for each navigation type.
Florian
08/10/2021, 3:08 PMcollectAsState
has some small delay to it before views are populated even if the underlying Flow
is cached using stateIn
? It's quite noticeable in the UI.Shivam Kumar Jha
08/10/2021, 3:24 PMAnthony
08/10/2021, 3:42 PMFlorian
08/10/2021, 3:48 PMscaffoldState.snackbarHostState.showSnackbar
? I can't use stringResource
there since that's a Composable.PHondogo
08/10/2021, 4:13 PMdimsuz
08/10/2021, 4:46 PMLazyRow
inside a particular page on an accompanyist Pager
and while this lazy row is being horizontally scrolled I want to disable horizontal swipe of `Pager`'s pages. How can this be achieved?Casey Brooks
08/10/2021, 5:00 PMFlorian
08/10/2021, 6:10 PMscaffoldState.snackbarHostState.showSnackbar
appear above the keyboard without changing the windowSoftInputMode
in the manifest?Florian
08/10/2021, 6:26 PMisError
argument. Do I have to add the error message manually as a Text
below my TextField?nglauber
08/10/2021, 6:37 PMNavHost
by AnimatedNavHost
, but I’m having an issue…
Using NavHost
I have this structure:
@Composable
fun AppNavHost(...){
val navController = rememberNavController()
NavHost(navController = navController, ...) {
composable("A") { ScreenA() }
composable("B") { Feature1NavHost() }
}
}
In Feature1NavHost
I have another NavHost
which takes control of the feature navigation. So, ScreenA
calls “B” and pops out of the stack. Everything works fine here.
Using AnimatedNavHost
, when I press back in the first screen of Feature1NavHost
, the display blinks and the application does not finish… 😕 I have to press a lot to close the app.Billy Newman
08/10/2021, 7:02 PMColton Idle
08/11/2021, 12:59 AM@Composable
fun DebugPanelBottomSheet(viewModel: NewCreditCardViewModel = hiltViewModel()) {
val myClickLambda = {
viewModel.state.cardNumber = "1234 1234 1234 1234"
}
//button that passes myClickLamda
Berkeli Alashov
08/11/2021, 1:55 AMtheapache64
08/11/2021, 4:51 AMlaunchSingleTop
flag works based on the route
pattern, but not route launched. For eg: if I’ve composable("page/{pageId}"){...}
and if i navigate("page/1")
and navigate("page/2")
with launchSingleTop = true
, only the page/1
will load. Is there anyway to make it route based rather than router pattern based ? or How can I handle this scenario?Pardeep Sharma
08/11/2021, 6:48 AMNapa Ram
08/11/2021, 7:38 AMAttila Blenesi
08/11/2021, 8:19 AMswipeable
/ draggable
only from a portion of a view?K Merle
08/11/2021, 8:37 AMAndroid developer
08/11/2021, 9:15 AMPHondogo
08/11/2021, 10:08 AMAkram Bensalem
08/11/2021, 10:16 AMbatuhan ardor
08/11/2021, 12:24 PMNacho Ruiz Martin
08/11/2021, 1:16 PMadjustViewBounds
in Compose’s Image
?
I want an image’s height to be driven by the width + keep original aspect ratio so I’m using
alignment = Alignment.Center,
contentScale = ContentScale.FillWidth,
but this creates vertical padding that I want to get rid of.
In traditional view system I would just ad adjustViewBounds=true
.Mjahangiry75
08/11/2021, 1:25 PM@Composable
fun networkState(): State<Boolean> {
val context = LocalContext.current
return context.networkStateFlow().collectAsState(initial = false)
}
Actually I'm trying to observe the network state in composablesStefan Oltmann
08/11/2021, 1:44 PMCicero
08/11/2021, 2:32 PMTin Tran
08/11/2021, 2:56 PMTin Tran
08/11/2021, 2:56 PMColton Idle
08/11/2021, 3:38 PMdrawPath(
path = path,
brush =
Brush.linearGradient(
colorStops =
arrayOf(
0.1f to Color(0x00ff0000),
.2f to Color(0xFFff0000),
.8f to Color(0xFFff0000),
.9f to Color(0x00ff0000),
),
),
Tash
08/11/2021, 9:36 PMsweepGradient
by making sure color stops are passed instead of just a list of colors
Brush.sweepGradient(
0.0f to Color.Red,
0.3f to Color.Green,
1.0f to Color.Blue,
center = Offset(0.0f, 100.0f)
)
sweepGradient
helps especially if you want the leading edge to go back to the starting color when it completes the arcTin Tran
08/12/2021, 6:17 AM