Status Update
Comments
wh...@gmail.com <wh...@gmail.com> #2
This looks really bad but w/o a repro app, we really cannot do anything about it. Is it possible for you to provide a sample app that reproduces your problem ?
[Deleted User] <[Deleted User]> #3
il...@google.com <il...@google.com> #4
Problematic behavior:
1) AsyncPagedListDiffer receives new list, takes snapshot for diffing (ui thread)
2) At roughly the same time:
2a) Diff snapshot of old snapshot vs new snapshot (bg thread)
2b) New data arrives in new list, way earlier in the list, so the list is essentially: new page, lots of empty pages, initial load
3) AsyncPagedListDiffer updates lastLoad position with diffutil position mapping
In 3, we try to map the lastLoad position from old snapshot to new snapshot, but fail to distinguish between new list vs new snapshot. Because of all the empty pages, that's a huge discrepancy. This is why the huge scrollbar + lots of swaps triggers this well - there are lots of swaps to new PagedLists while loads are happening very far away from initial load positions.
Will need to account for pages loaded in between time of snapshot, and time of swap.
jo...@jossiwolf.de <jo...@jossiwolf.de> #5
jo...@jossiwolf.de <jo...@jossiwolf.de> #6
il...@google.com <il...@google.com>
de...@gmail.com <de...@gmail.com> #7
pa...@gmail.com <pa...@gmail.com> #8
il...@google.com <il...@google.com> #9
ap...@google.com <ap...@google.com> #10
Branch: androidx-main
commit d65d5731e4f0dfe560b43eae886a4fabfa949b84
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Feb 21 02:14:42 2024
Add Navigation Material from Accompanists to androidx
Now that the needed compose material API are stable, we can move the
navigation material module from Accompanists to Androidx. This means we
will have a new compose-material-navigation module that provides support
for bottomsheets.
RelNote: "Providing new Compose Material Navigation module that adds
support for Bottomsheets in Compose Material."
Test: Added tests and samples
Bug: 180247978
Change-Id: Ia93eb757a32b04dac8ab3ebd2d73207a68635b80
A compose/material/material-navigation/api/current.txt
A compose/material/material-navigation/api/res-current.txt
A compose/material/material-navigation/api/restricted_current.txt
A compose/material/material-navigation/build.gradle
A compose/material/material-navigation/samples/build.gradle
A compose/material/material-navigation/samples/src/main/java/androidx/compose/material/navigation/samples/ComposeMaterialNavigationSamples.kt
A compose/material/material-navigation/src/androidTest/java/androidx/compose/material/navigation/BottomSheetNavigatorTest.kt
A compose/material/material-navigation/src/androidTest/java/androidx/compose/material/navigation/NavGraphBuilderTest.kt
A compose/material/material-navigation/src/androidTest/java/androidx/compose/material/navigation/SheetContentHostTest.kt
A compose/material/material-navigation/src/main/java/androidx/compose/material/navigation/BottomSheet.kt
A compose/material/material-navigation/src/main/java/androidx/compose/material/navigation/BottomSheetNavigator.kt
A compose/material/material-navigation/src/main/java/androidx/compose/material/navigation/NavGraphBuilder.kt
A compose/material/material-navigation/src/main/java/androidx/compose/material/navigation/SheetContentHost.kt
M compose/material/material/integration-tests/material-demos/build.gradle
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/MaterialDemos.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/ModalBottomSheet.kt
M docs-tip-of-tree/build.gradle
M settings.gradle
jb...@google.com <jb...@google.com> #11
This has been added internally and will be released as part of the compose.material
library, not navigation.
na...@google.com <na...@google.com> #12
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material:material:1.7.0-alpha04
androidx.compose.material:material-android:1.7.0-alpha04
androidx.compose.material:material-desktop:1.7.0-alpha04
d....@gmail.com <d....@gmail.com> #13
gs...@gmail.com <gs...@gmail.com> #14
I guess the release that addresses this is actually:
androidx.compose.material:material-navigation:1.7.0-alpha04
As #13 said, we are missing this for Material3 bottom sheets.
I see that there's another issue tracking that here:
v....@temper.works <v....@temper.works> #15
Some guidance about usage would be very welcome. I get java.lang.IllegalStateException: Could not find Navigator with name "bottomSheet". You must call NavController.addNavigator() for each navigation type.
crash and can't find any proper example of this new extension usage:
Scaffold(
bottomBar = {...}
) { innerPadding ->
NavHost(
navController,
startDestination = "explore_graph",
Modifier.fillMaxSize()
) {
// nested graphs
bottomSheet("profile_bottom_sheet") { // CRASHES
Text("Bottom Sheet", Modifier.padding(16.dp))
}
}
}
}
}
}
}
I use androidx.compose.material:material-navigation:1.7.0-beta01
, but my project is material3, could it be the reason?
il...@google.com <il...@google.com> #16
Re
val bottomSheetNavigator = rememberBottomSheetNavigator()
val navController = rememberNavController(bottomSheetNavigator)
If you don't use those lines, you'd get that error message.
Description
Version used: 1.0.0-alpha06
It would be useful to integrate with BottomSheetScaffold so we could treat bottom sheets as navigation destinations. For example, I could call `navController.navigate(someBottomSheetRoute)` to launch a bottom sheet.