Rick Regan
03/26/2021, 1:26 AMvar text: String by mutableStateOf(text)
(At runtime it gets "Attempt to invoke interface method 'java.lang.Object androidx.compose.runtime.State.getValue()' on a null object reference.)Albert Chang
03/26/2021, 2:50 AMshahroz
03/26/2021, 3:21 AMneeds X version of Y dependency in the host application
kind of issues that might arise. Anyone who made the switch, have any pointers to share?Tash
03/26/2021, 3:44 AMItemAnimator
-esque animations for additions/removals into a LazyColumn/Row
: I see we have this example in the codebase that wraps each item around AnimatedVisibility
. However, the example is rather simplistic in that the visible
flag to AnimatedVisibility
is computed via indices; the actual list backing the LazyColumn
doesn’t mutate.
In most app scenarios, lists mutate based on some source of truth (domain/business layer). Can AnimatedVisibility
still be used in some capacity to animate mutating lists, or are there any other Compose constructs we can use?escodro
03/26/2021, 10:52 AMSaver
to be used with rememberSaveable
. Could you please help me?
I have a list of items that, when clicked, shows a BottomSheet
with the item data. Implementing my custom Saver
works only or the first time and the first item saved will show every time the screen is rotate.
When in portrait or landscape, if I click in any item, it shows the item correctly. But when rotate, the first one saved is shown again.
Code is in the comments.
Thanks a lot in advance! ❤️wisdom
03/26/2021, 12:07 PMpawegio
03/26/2021, 4:17 PMNavHost
without state restoration mechanism? I’d like to recompose it and return to start destination when state is lost.Shawn Tucker
03/26/2021, 8:26 PMVerticalScrollerState
instead of
scrollPosition: Int,
scrollRange: Int,
onScrollPositionChange: (Int) -> Unit,
onScrollRangeChange: (Int) -> Unit
The issue I am experiencing with this approach is that now I can not update my viewModel when "onSomethingHappened"
. I tried adding a callback to my custom state object but it just did not feel right.
Is there a suggestion/best practice about how I can observe changes to my custom state object (and each of the parameters in it)?Vinay Gaba
03/27/2021, 6:25 AMAccessibilityChecks.enable().setRunChecksFromRootView(true)
available for Compose or if that already is capable of running on Compose views. I haven’t tested it yet so unsure about what its current behavior is.Simon
03/27/2021, 9:04 AMComposeview
inside each, but I'm facing an issue with state restoration when using navigation component. When put on the backstack, the fragment's view is destroyed, but onSaveInstanceState
is not called and there is no saveHierarchyState
mechanism on ComposeView
. So when a fragment's view is recreated when i pop the backstack, all scroll state of LazyColumn is lost for example. Is there a way to save this state inside fragments ? Thankselye
03/27/2021, 10:51 AMNat Strangerweather
03/27/2021, 4:31 PMval b:Bitmap = canvas.drawToBitmap(Bitmap.Config.ARGB_8888)
Or is there an alternative to save a canvas?orangy
03/27/2021, 5:56 PMGraphicsLayerScope
, but there is no suitable property as far as I understand. It creates outline for clipping based on the measuredSize
and I don’t see any way to influence that… It would be nice to have something like clipInsets
property in the scope, which would be taken into account to calculate clip rectangle. I understand I can use another node around with some padding, but I’d like to do it via Modifier
Colton Idle
03/27/2021, 7:04 PMRow(modifier = Modifier.fillMaxWidth()) {
Box(modifier = Modifier.border(1.dp, Color.Blue).aspectRatio(16/9F))
Box(modifier = Modifier.border(1.dp, Color.Blue).aspectRatio(16/9F))
}
FunkyMuse
03/27/2021, 8:36 PMColton Idle
03/27/2021, 10:11 PMColton Idle
03/28/2021, 12:03 AMShivam Sethi
03/28/2021, 1:43 AMelye
03/28/2021, 6:58 AMmmaillot
03/28/2021, 1:29 PMImage
to move to a specific point ? I have an image at the top of my screen and an another image at the bottom. I want to translate the top image to the bottom. I’m starting with animation and I’m looking if there is an easy way to do that. I found the translateY
method but how to get the dp between the top image and the bottom image ?Tymmm1
03/28/2021, 3:04 PMLazyColumn
. Anyone knows how to do this? What I'm trying to achieve is getting to the selected state on a click (not a long click).Se7eN
03/28/2021, 7:17 PMfree
and pro
. How can I make a different composable with the same name for each flavor?Marco Pierucci
03/28/2021, 8:12 PMSanendak
03/29/2021, 10:57 AMescodro
03/29/2021, 1:03 PMSnackBar
. I have a list of items with Checkbox
and when the user clicks, it “completes” the item and removes from the list.
My implementation tries to shown an “Undo Snackbar” when the user performs this action, which brings the item back to the list.
The problem is that the Snackbar
disappears in less than one second due to the recompostion when the item disappears from the list.
LazyColumn() {
items(
items = taskList,
itemContent = { task ->
TaskItem(
task = task,
onItemClick = onItemClick,
onCheckedChange = {
onCheckedChange(it)
coroutineScope.launch { snackbarHostState.showSnackbar("Task Completed", "Undo") }
}
)
}
)
}
I tried using LaunchedEffect
but AFAIK, this will associate the effect to a state, not the user click, right?
Do you have any idea on how to make the Snackbar
keep visible while the screen is recomposing?
Thanks a lot in advance! ❤️oscarg798
03/29/2021, 1:46 PMviewModel
methodNthily
03/29/2021, 2:08 PMAbhishek Dewan
03/29/2021, 2:20 PMSe7eN
03/29/2021, 2:48 PMvar bannerView by remember { mutableStateOf<MoPubView?>(null) }
val context = LocalContext.current
DisposableEffect(null) {
bannerView = MoPubView(context).also {
it.setAdUnitId("...")
it.adSize = MoPubView.MoPubAdSize.HEIGHT_50
it.loadAd()
}
onDispose {
bannerView?.destroy()
bannerView = null
}
}
bannerView?.let { view ->
AndroidView(
factory = { view }
)
}
Arkadii Ivanov
03/29/2021, 2:58 PMBox
implementation has changed at some point after beta01
release. It was using the BoxScope
object but now looks like it became an interface, and there is BoxScopeInstance
object instead. As a result there is a crash when a library compiled against beta01
is used with the most recent version of Desktop compose (0.4.0-build177). Writing here because Desktop compose releases are ahead of Jetpack Compose. Checked beta03
version - it is still fine (not affected). Is it expected or by an accident?Arkadii Ivanov
03/29/2021, 2:58 PMBox
implementation has changed at some point after beta01
release. It was using the BoxScope
object but now looks like it became an interface, and there is BoxScopeInstance
object instead. As a result there is a crash when a library compiled against beta01
is used with the most recent version of Desktop compose (0.4.0-build177). Writing here because Desktop compose releases are ahead of Jetpack Compose. Checked beta03
version - it is still fine (not affected). Is it expected or by an accident?jim
03/29/2021, 3:04 PMtheapache64
03/29/2021, 3:06 PMmatvei
03/29/2021, 3:06 PMjim
03/29/2021, 3:06 PMmatvei
03/29/2021, 3:07 PMArkadii Ivanov
03/29/2021, 3:10 PMZach Klippenstein (he/him) [MOD]
03/29/2021, 3:24 PM