kevindmoore
07/26/2021, 2:10 AMms
07/26/2021, 3:12 AMimePadding()
it doesn't animate upon keyboard visible, but if I use navigationBarsWithImePadding()
it animates.
I only need to animate ime height excluding navBars height. @cb any inputs?Richard Graham
07/26/2021, 3:45 AMandroid:animateLayoutChanges="false"
to the xml file and have played around with AnimatedContent()
and .animateContentSize()
to no avail. I'm assuming it has something to do with the whole element being updated for some reason but am out of ideas on how to fix it, any thoughts?Colton Idle
07/26/2021, 4:42 AMSignInScreen
that should not follow the typical "back press = popBackStack". When on the SignInScreen, the MainScreen is in the stack, but in this case I want the app to just close.
Where is the more appropriate place to override this? In the SignInScreen
composable itself? Or on the activity level?Abhishek Dewan
07/26/2021, 7:34 AMStefMa
07/26/2021, 8:00 AMDialogFragment
which creates an AlertDialog
with the MaterialAlertDialogBuilder
.
The customView I created for the AlertDialog
is created with a ComposeView
. Inside this View I create a OutlinedTextField
.
This "works" and the correct view show up.
But unfortunately, the Keyboard does not show up on click on the TextField
😱
I tried it already with the FocusRequester
, and with a different AlertDialog
(from androidx instead of material package). No luck.
I moved the ComposeView into a "normal" Fragment
. There, everything works as expected.
So I guess it is a DialogFragment
related issue... Can someone help me out here?
Is this a bug? 🤔Radu - Ionut Kurta
07/26/2021, 8:33 AMMohamed Ibrahim
07/26/2021, 8:38 AMallan.conda
07/26/2021, 10:40 AMcomposable
destinations.
I think the compose navigation behavior makes sense. I’m not sure what’s the right way to achieve the requirement, or whether I’m going against the navigation principles.Mjahangiry75
07/26/2021, 12:18 PMcanary 4
, If I put 13 of composables
inside NavHost
app will crash, error in threadrsktash
07/26/2021, 12:36 PMnitrog42
07/26/2021, 12:58 PMyousefa2
07/26/2021, 2:09 PMRow
, Column
or Box
depending on what I want. You get additional modifiers based on the scope you are in..i.e BoxScope.Modifier.matchsParentSize()
, RowScope.Modifier.weight
..etc.
I am looking into a way to get these values from the server. Since I don’t know which layout will be rendering at run-time.. I can’t have a scope.
I have looked into something like
fun MyCustomLayout(someLayoutEnum: LayoutTypeEnum, content: @Composable () -> Unit) {
// do some work here
}
Which works to define the layout at run-time but you would still be stuck not knowing the scope and not being able to use RowScope.Modifier.weight
for example.
What I am going with right now is copying the Jetpack compose team logic of using a MeasurePolicy + Layout, which is either internal or private, and modifying it to accept a list of modifiers for each child.
val measurePolicy = rowMeasurePolicy(horizontalArrangement,verticalAlignment, modifiers) // This could be columnMeasurePolicy or boxMeasurePolicy
Layout(
content = { content() },
measurePolicy = measurePolicy,
modifier = modifier
)
My question is, does anyone know a better way of doing this?iamthevoid
07/26/2021, 2:33 PMBindScopeWithComposable
in [Thread].
BindScopeWithComposable
(in my opinion) should remember result of provideComponent
lambda between compositions even if i go to the next screen and back.
BindScopeWithComposable's
used in the root of Compose navigation graph [Thread]. When i interact with one screen wrapped in BindScopeWithComposable
then component
instance stay the same. But when i go to the next screen and back it is recomposing and new instance of component
now used.eygraber
07/26/2021, 5:24 PMFlow<SomeState>
with collectAsState
instead of multiple MutableState
and will rely on function skipping if the discrete fields in SomeState
haven't changed (SomeState
will be immutable).
<\tl;dr>
(longer description in thread)dimsuz
07/26/2021, 5:29 PMhorizontalAlignment
. Does anyone know if this is fixed in Canary or ETA on the fix? It's a bit cumbersome to have to jump to compose sources when I forget these parameters...Colton Idle
07/26/2021, 6:20 PMShakil Karim
07/26/2021, 6:48 PMChris Johnson
07/26/2021, 8:14 PMLocalView.current.rootWindowInsets?.isVisible(WindowInsets.Type.ime())
. But that's for api 30+... I've tried to use accompanist's insets
api to see if there's insets (for the keyboard) but to no success.Landry Norris
07/26/2021, 9:45 PMcollect { value = it }
inside of collectAsState() does get called, and 'it' has the correct value, but the UI does not change. The UI did properly respond when I used LiveData and observeAsState(), but I am wanting to switch to Flows.Kefas
07/27/2021, 2:08 AManimateScrollBy
can be cancelled if I scroll the lazy column at the same time, and then the entire LaunchedEffect will be cancelled.
val scrollState = rememberLazyListState()
LaunchedEffect(Unit) {
while (true) {
delay(1000L)
scrollState.animateScrollBy(100f)
}
}
Sudhir Singh Khanger
07/27/2021, 3:43 AMColton Idle
07/27/2021, 5:14 AMColumn() {
val pagerState = rememberPagerState(pageCount = 10)
HorizontalPager(state = pagerState) { page ->
Text(text = "Page: $page", modifier = Modifier.fillMaxWidth())
}
Button(onClick = { pagerState.animateScrollToPage(pagerState.currentPage + 1) }) {
Text(text = "Test")
}
}
But I get an error of Suspend function 'animateScrollToPage' should be called only from a coroutine or another suspend function
I thought it was okay to have an event like this in an onClick event since it's not happening on every recomposition?Jason Roberts
07/27/2021, 5:17 AMColton Idle
07/27/2021, 5:40 AMNathan Castlehow
07/27/2021, 6:40 AMLuka
07/27/2021, 8:13 AMJeff
07/27/2021, 8:36 AMGeert
07/27/2021, 8:36 AMmodifier = Modifier
.then(Modifier.padding(it))
.then(Modifier.fillMaxSize())
and
modifier = Modifier.padding(it).fillMaxSize()
allan.conda
07/27/2021, 8:55 AMallan.conda
07/27/2021, 8:55 AMHalil Ozercan
07/27/2021, 9:01 AMallan.conda
07/27/2021, 9:05 AMcb
07/27/2021, 9:05 AMhfhbd
07/27/2021, 9:10 AMallan.conda
07/27/2021, 9:12 AMColton Idle
07/27/2021, 2:40 PMcb
07/28/2021, 7:09 AMAndrey Kulikov
07/28/2021, 10:21 AMColton Idle
07/28/2021, 2:04 PM