What is better multiple Bottomsheet or one sheet but change content ? #113
-
Hi, At begin I create multiple sheets but I notice the sheet never remove from memory so I want to be sure is it better to create multiple sheet ? The problem BottomSheet doesn't have |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes they are not removed from memory as long as the view they belong to is visible (like with other views), they are only hidden. I suggest you to add the BottomSheets to the lowest navigation layer possible so that they get removed when the navigation layer they belong to also gets removed. Also it makes sense to give often used views their own dedicated BottomSheet and to have a bottom sheet with really used content that gets repopulated. A way to achieve this is to return different content views based on some state variable. A switch or if statements inside a group could be helpful. |
Beta Was this translation helpful? Give feedback.
Yes they are not removed from memory as long as the view they belong to is visible (like with other views), they are only hidden. I suggest you to add the BottomSheets to the lowest navigation layer possible so that they get removed when the navigation layer they belong to also gets removed. Also it makes sense to give often used views their own dedicated BottomSheet and to have a bottom sheet with really used content that gets repopulated. A way to achieve this is to return different content views based on some state variable. A switch or if statements inside a group could be helpful.