sheets icon indicating copy to clipboard operation
sheets copied to clipboard

[Feature Request] Composable function for Fullscreen { }

Open rvp-diconium opened this issue 2 years ago • 1 comments

The code in BottomSheet.kt is very similar (most likely copy-paste-modified) from the android Dialog { } function.

Both those code have the base setup of getting LocalView, remember composition context, have a wrapper, with apply setContent with some type of DialogLayout or BottomSheetLayout. In the wrapper it sets view tree owner for several components. In the layout sets an ID with a tag with compose_view_saveable_id_tag.

This whole complex iteration could be also used by other developers on different layouts that are not just BottomSheet or Dialog, and that's the feature request.

If you could decouple BottomSheet from the underlying platform methods to create this full-screen UI function and expose it from your library like a @Composable fun Fullscreen { } might need some optional parameters like the onBackPress. The @Composable fun BottomSheet { } would use this Fullscreen.

[ I'll try to also add a feature request for that in the Android bug-tracker but we know it's less likely to be implemented (: ]

Thanks!

rvp-diconium avatar Jun 13 '23 14:06 rvp-diconium

Thanks for the idea! You are right, the dialog part is copied from the compose-ui package, modified the original source code to remove the background dim.

Decoupling and exposing a fullscreen function is possible, but I don't know if exposing such a composable is a proper practice since this library is just a bottom sheet library.

It might be a better practice to create or find another standalone compose dialog library for fully customizable dialogs. But for now, refactoring doesn't seem to be coming soon, as I need to take some time off to refocus on Android.

dokar3 avatar Jun 14 '23 05:06 dokar3