Status Update
Comments
du...@google.com <du...@google.com> #2
This also brings back dialog content size animations issues :( But on all devices this time.
See attached video
Repro:
Dialog(
onDismissRequest = {
if (dialogState.canDismiss.value) {
dialogNavigator.hide()
}
},
properties = properties,
content = {
Surface(
modifier = modifier
.safeContentPadding()
.fillMaxWidth(0.8f)
.animateContentSize(),
shape = shape,
color = backgroundColor,
contentColor = contentColor,
) {
.....A composable that change it's size
}
},
)
jd...@xooloo.com <jd...@xooloo.com> #3
Can you give a fuller example for the animateContentSize()
problem?
du...@google.com <du...@google.com> #4
It does that for all the cases where the content change.
properties = DialogProperties(usePlatformDefaultWidth = false)
var show by remember { mutableStateOf(false) }
LaunchedEffect(Unit) {
delay(1000)
show = true
}
Column {
Text("X")
if (show) {
Text"Y)
}
}
Edit: This was a well known long time issue when not using usePlatformDefaultWidth = false
so we were forced to workaround with that.
Now even with it it trigger that. (Depending on the phone, it's either super slow, or laggy and jumping).
ap...@google.com <ap...@google.com> #5
I am seeing a problem with decorFitsSystemWindows = false
where it continues to invalidate the layout even after the animation completes. I don't think that's the problem you're worried about, though.
If I understand correctly, the problem you're seeing is something about it being laggy? And it didn't happen in the previous version, right?
That problem is likely due to the Window resizing on every frame, which is more expensive than the window content resizing on every frame. In a previous iteration, the window size was full screen and the content resized itself. You can resolve this yourself by doing this:
Surface(
modifier = Modifier.safeContentPadding()
.fillMaxSize()
.wrapContentHeight()
.fillMaxWidth(0.8f)
.animateContentSize(),
...
I'll see if I can fix the problem with decorFitsSystemWindows = false
invalidating layout continuously.
Description
Component used: Paging3 Version used: alpha06 Devices/Android versions reproduced on: Android 7.1
I'm presenting a list of items using data from a room DB.
Note: The page size is intentionally low to try to debug paging issues, but is higher in production code.
The pager flow is used to produce
PagingData
passed to aPagingAdapter
.The RecyclerView uses a simple LinearLayoutManager.
Everything work mostly fine except that that latest entry may never be loaded while scrolling (especially when scrolling slowly). The PagingData properly provides a placeholder that is shown in the list, but it never trigger the loading of the last data, and so never replace the placeholder when reaching the end of the list.