-
Notifications
You must be signed in to change notification settings - Fork 36
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
fix issue #20 and fix full screen padding #26
fix issue #20 and fix full screen padding #26
Conversation
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.
Thanks for your contribution! I've written down some suggestions, please correct them.
@@ -77,6 +83,9 @@ internal fun VideoPlayerFullScreenDialog( | |||
PlayerView(context) | |||
.also(fullScreenPlayerView) | |||
} | |||
var fullScreenModeEntered by remember { |
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.
@AnandJeyapal I think need to change this variable name fullScreenModeEntered
to isFullScreenModeEntered
. This is my habit, and it is customary to add is
to boolean type variables and has
to boolean return type functions.
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.
Yes that makes sense. I have updated it :)
if (activityWindow != null && dialogWindow != null && !fullScreenModeEntered) { | ||
activityWindow.setFullScreen(true) | ||
dialogWindow.setFullScreen(true) | ||
dialogWindow |
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.
@AnandJeyapal Only variables have been called, but if you don't intend to, it looks better to clear them.
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.
Thanks for the catch. I removed it (also the redundant view variable).
internal fun getDialogWindow(): Window? = (LocalView.current.parent as? DialogWindowProvider)?.window | ||
|
||
@Composable | ||
internal fun getActivityWindow(): Window? = LocalView.current.context.findActivity()?.window |
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.
@AnandJeyapal Please add EOF (End of file). All files in this project must always have a space at the end :)
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.
My bad. I missed it. Thanks :)
} | ||
} | ||
|
||
private fun Window.hideSystemBars() { |
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.
Oh, awesome!
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.
Thank you!
This PR will release version 1.3.0 |
This is for the following issue
#20
What was the issue?
Dialog window has extra padding around it. Hence if there is any content around the video player (top/bottom/right/left),
VideoPlayerFullScreenDialog
shows the content behind it.What is the fix?
We should update the layout properties of the dialog window so that it full occupies the screen's size.
I have copied the attributes from
activityWindow
and applied them to thedialogWindow
.Read more at: https://www.droidcon.com/2024/01/15/camouflage-the-status-bar-with-edge-to-edge-jetpack-compose-screens-and-dialogs/