Closed ArcherEmiya05 closed 4 months ago
I just tried changing the selected item and rotating in our Catalog app demo for Nav Drawer:
And it retained the selected state as expected. So from the perspective of the NavigationView
component I believe this is working correctly.
@ArcherEmiya05 can you check out our Catalog app and try comparing your setup to see what the difference might be?
Alternatively if you could provide a separate minimal sample app that reproduces your setup and the issue, that would be helpful for debugging.
I don't think the sample you link is having the same setup with the problem, however you may check the sample project below which demonstrate the bug. Note that this is the original sample from Android Studio project wizard for responsive UI, I just remove the image and change the drawer menu items. Again the issue here is the items in second group does not retain selected state. ResponsiveExample.zip
Do you have any idea what the difference is between our sample and what is required to reproduce the bug?
Do you have any idea what the difference is between our sample and what is required to reproduce the bug?
Hi, I already included the sample project which should run on latest Android Studio Jellyfish.
Ah we actually have a pull request that looks like it would fix this bug:
https://github.com/material-components/material-components-android/pull/4155
Will see if I can reproduce the issue and import the PR.
Description:
DrawerLayout selected state not surviving configuration change for menu that has nested group menu items.
Expected behavior:
Should be able to retain selected state.
Source code:
https://github.com/material-components/material-components-android/assets/38008900/cd6b7d86-2922-4e21-8e3a-96434e8a9880
Minimal sample app repro:
Android API version: 21
Material Library version: 1.12.0
Device: Pixel (AVD)