-
Notifications
You must be signed in to change notification settings - Fork 28
Add edge-to-edge support #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
return Dialog(requireActivity(), R.style.Theme_FullScreenDialog).apply { | ||
setCanceledOnTouchOutside(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept the ImageViewerDialogFragment
behavior, just changed the applied theme on the Dialog
instance.
return Dialog(requireActivity(), R.style.Theme_FullScreenDialog).apply { | ||
setCanceledOnTouchOutside(true) | ||
|
||
window?.let { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we enters edge-to-edge, and set the system bars colors based on the chosen theme. It's safe as it operates in a different Window
(the Dialog
one, compared to the MainActivity
one), so it will not mess with SystemBars
, StatusBar
, etc.
good to merge? |
@nandorojo Totally, yes |
edge-to-edge.mp4
Following https://github.com/nandforojo/galeria/issues/16 (ping @hirbod)
This PR add support for edge-to-edge layout. It adds a new prop:
edgeToEdge
, that is alwaystrue
whenreact-native-edge-to-edge
is installed.I would recommand to expose the
edgeToEdge
prop in the TypeScript types for nonreact-native-edge-to-edge
users that also wants edge-to-edge (currently, it's not, check theGaleriaViewProps
type vs the actual acceptedGaleria
props).