🐬 Advanced Compose Multiplatform bottom sheet for segmented sizing, non-modal type, and allows interaction behind the bottom sheet similar to Google Maps.
Apache License 2.0
791
stars
36
forks
source link
When restoring the Sheet with rememberSaveable(), the display state of the Sheet is incorrect. #48
Affected Device(s) : The built-in Android Studio emulator, API 35
Describe the Bug:
Well, you can look this video from below. On the Android side, click the non modal button, and the sheet will be displayed. When the Sheet is in the fullyExpanded state, switch to the Settings app through the task manager interface, open the Display options, and then turn on or off the Dark mode in the Display interface. After returning to the demo app, the Sheet no longer displays. So click the non modal button again, the Sheet shows up, but because it is reloaded from memory, the display state of the Sheet is not the fullyExpanded state, it's intermediatelyExpanded state, which is not the expected result.
Restore to whatever state it was in before the configuration was changed.
btw,In this case, when the variable SheetState is obtained through rememberSaveable(), the Full state is the initial state value, which leads to the value of hasIntermediatelyExpandedState being true. As a result, the targetStateValue becomes the intermediate state. Therefore, calling the show() method in FlexibleBottomSheet will display the sheet in an intermediate state style. I'm not sure whether it's considered a bug or a feature; in any case, I find this mechanism for restoring the state to be confusing and strange. So, is it or add a configuration variable to implement calling other ShowSheet state methods instead of the default show() method?
Please complete the following information:
Describe the Bug:
Well, you can look this video from below. On the Android side, click the non modal button, and the sheet will be displayed. When the Sheet is in the fullyExpanded state, switch to the Settings app through the task manager interface, open the Display options, and then turn on or off the Dark mode in the Display interface. After returning to the demo app, the Sheet no longer displays. So click the non modal button again, the Sheet shows up, but because it is reloaded from memory, the display state of the Sheet is not the fullyExpanded state, it's intermediatelyExpanded state, which is not the expected result.
https://github.com/user-attachments/assets/623682f4-120e-4ab3-827b-f6d443382b7f
Expected Behavior:
Restore to whatever state it was in before the configuration was changed.
btw,In this case, when the variable SheetState is obtained through rememberSaveable(), the Full state is the initial state value, which leads to the value of hasIntermediatelyExpandedState being true. As a result, the targetStateValue becomes the intermediate state. Therefore, calling the show() method in FlexibleBottomSheet will display the sheet in an intermediate state style. I'm not sure whether it's considered a bug or a feature; in any case, I find this mechanism for restoring the state to be confusing and strange. So, is it or add a configuration variable to implement calling other ShowSheet state methods instead of the default show() method?