Michal Klimczak
09/15/2021, 7:28 AMadb shell cmd package compile -r bg-dexopt my.app.id
But it only shows me
Failure: package my.app.id could not be compiled
My second question is - can I somehow test the final experience, e.g. should deploying to Firebase App Distribution work as fine as Google Play or not really?Alexander Sitnikov
09/15/2021, 9:35 AMFlow.collectAsState()
where collection of the flow starts one frame after initial composition. Usually my Flow
emits its first value immediately upon subscription, and in that case I don’t want to see initialValue
. But because collect starts only after first frame, there’s visible fast “blink” when you first open a screen. As I understand it’s because LaunchedEffect
executes it’s lambda in AndroidUiDispatcher
, and it dispatches `LaunchedEffect`’s job only after first frame has been drawn. I found a solution, where if I launch a coroutine that collects the Flow
with start = CoroutineStart.UNDISPATCHED
, value is produced immediately after first composition (so I can read it inside SubcomposeLayout
of some sort, and screen does not “blink”). Is there any pitfalls of doing so?Zoltan Demant
09/15/2021, 10:04 AMStylianos Gakis
09/15/2021, 11:01 AMisMinifyEnabled = true
? Couldn’t find how to edit my proguard to make that happen
My use case is that I want a different build type, that is not production, but is used to test the production experience (minified) but also be able to browse the previews rendered by ShowkasePeter Mandeljc
09/15/2021, 11:01 AMTim Malseed
09/15/2021, 12:04 PMBottomSheet
that sits above the BottomAppBar
. As the sheet is expanded, I'd like the BottomAppBar
to scroll off screen.
I've managed to sort of achieve this by tying the `BottomAppBar's`y offset to the bottom sheet's offset amount (derived from BottomSheetState
direction & progress:
val bottomSheetScaffoldState = rememberBottomSheetScaffoldState()
Scaffold (
bottomBar = {
BottomAppBar(Modifier.offset(y = 56.dp * (1f - bottomSheetState.offsetFraction()))
}
) { padding ->
BottomSheetScaffold(Modifier.padding(bottom = 56.dp * bottomSheetState.offsetFraction()))
}
The problem is that the bottom sheet scroll/fling events now seem to be sort of interrupted. I guess having the padding change out from underneath it while it's scrolling causes issues with the size calculations or something along those lines.
Just wondering if anyone can recommend an approach for this?Napa Ram
09/15/2021, 12:11 PMVinícius Santos
09/15/2021, 2:39 PMcomposable()
, removing the arguments makes evething works fine.
Navigation destination that matches request NavDeepLinkRequest{ uri=<android-app://androidx.navigation/character> } cannot be found in the navigation graph NavGraph(0x0) startDestination={NavGraph(0x78da56c6) route=main startDestination={Destination(0x78d845ec) route=home}}
This is the code thats braking
composable(
route = MainRoutes.CharacterDetail.routeName,
arguments = MainRoutes.CharacterDetail.navArgs, /*Comenting this line get things working again*/
enterTransition = {initial, target -> null },
exitTransition = {initial, target -> null },
popEnterTransition = {initial, target -> null },
popExitTransition = {initial, target -> null }
) { backStackEntry ->
val character = MainRoutes.CharacterDetail.getNavArgs(backStackEntry)
character?.let {
CharacterScreen(
character = character,
onBack = { navController.popBackStack() })
}
}
miqbaldc
09/15/2021, 3:15 PMmutableStateOf(<with initial/default value>)
but the recomposition unable to use the default valueLuke
09/15/2021, 3:32 PMColumn(modifier = Modifier.height(128.dp)) {
Text("Super long text...", overflow = TextOverflow.Ellipsis)
}
Is there a way to constraint the Text to ellipsize as soon as the next line would be outside the column? Since the column has a predefined height, different font scales would require different max lines. I know I can check LocalDensity.current.fontScale
but I'm looking for something more genericRak
09/15/2021, 3:48 PMVinay Gaba
09/15/2021, 4:53 PMdivid3d
09/15/2021, 9:07 PMOrhan Tozan
09/15/2021, 10:12 PMColton Idle
09/16/2021, 5:41 AMup
button, I know that both
navController.navigateUp()
and
navController.popBackStack()
do the same thing, but which one should be used for the up action specifically. navigateUp
right?Stefan Oltmann
09/16/2021, 8:40 AMK Merle
09/16/2021, 9:59 AMRafiul Islam
09/16/2021, 10:08 AMNicholas Doglio
09/16/2021, 12:52 PMSnapshotStateList
and it’s working fine but still new to Compose so was wondering if anyone had a better implementation.Stefan Oltmann
09/16/2021, 2:23 PMLazyRow
so that the element is centered.
LazyListState.animateScrollToItem()
takes an index
and a scrollOffset
as arguments.
Per default it scrolls the list so that the item is the first one.
If a positive scrollOffset
is given it scrolls further, making the item go off scren.
So I tried to give a negative scrollOffset
and calculate what I need so that the element is in center position.
The problem is: Negative Offsets are not allowed. 😞
How can I scroll to an index that it's at the center of the list?theapache64
09/16/2021, 4:34 PMprintln
or Log
output in androidTest? Details in thread 🧵Nikhil
09/16/2021, 5:58 PMonGloballyPositioned{..}
(I also have some other code and I want to avoid adding it this modifier since it’s called a lot.)
Is there any method/modifier where I can get any alternative of `Rect`/ bounds
?brabo-hi
09/16/2021, 6:10 PMK Merle
09/16/2021, 7:09 PMgpaligot
09/16/2021, 8:34 PMText
composable, the callback onTextLayout
to get information about text measurements and the modifier drawBehind
.
Text(
text = "My text here\n Multi line",
modifier = Modifier.drawBehind {
// Draw something here
},
onTextLayout = { textLayoutResult ->
// Get value of textLayoutResult.multiParagraph.lineCount
// Get values of textLayoutResult.multiParagraph.getLineHeight(index)
}
)
If I'm using this snippet with two states, it works well but my composable is draw 2 times. First time to measure the text and the second time when my states are updated inside the onTextLayout
callback which force a new recomposition.
I would like to know if it is possible to avoid to draw 2 times my text when there are no changes between my first and second composition?
If anyone have an idea, I'm very interested!
Thanks!Marko Novakovic
09/16/2021, 8:55 PMcompose
into new project but I can’t run it.
error: org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
I have fragment with ComposeView
and am just calling setContent
on it
any help?
compose version 1.0.2
compose build feature is enabled
composeOptions {
kotlinCompilerExtensionVersion = "1.0.2"
kotlinCompilerVersion = "1.5.21"
}
Colton Idle
09/16/2021, 11:11 PMadjpd
09/16/2021, 11:13 PMBasicTextField
, the keyboard covers the input. Is this expected behavior (even with adjustResize
)?
LazyColumn {
items((1..100).toList()) { BasicTextField("$it", {}) }
}
bohregard
09/16/2021, 11:54 PMZoltan Demant
09/17/2021, 7:06 AMremember
on Enum.values()
such that a new array isnt created on each recomposition, or am I over-optimizing?Zoltan Demant
09/17/2021, 7:06 AMremember
on Enum.values()
such that a new array isnt created on each recomposition, or am I over-optimizing?Felix Schütz
09/17/2021, 7:21 AM