DroidFS
DroidFS copied to clipboard
Do not show fullscreen indicator when using fullscreen gestures
In fact, I'd like to keep the navigation bar visible even in fullscreen mode. I find this makes it easier to navigate the UI. Perhaps we could make your changes optional via a switch in the app settings?
You are right...
In my opinion, it would be even better to switch to fullscreen (without navigation bar) only when the controls are not visible. If the controls are visible, then the navigation and status bar will appear. For example, NewPipe do it well.
What do you think of it?
Yes that's a great idea.
Cool but the video frame jumps when navigation bar appears and disappears and it doesn't work for ImageViewer. Also, I think we can keep the navigation bar visible in AudioPlayer since controls are never hidden.
Thank you for your feedback. Actually, I haven't finished to handle all cases (I will message you when it will be OK)
So, to sum up, we want:
- video and image: hide navigation bar when controls are hidden. Show navigation bar when controls are visible.
- audio: the navigation bar remains
Regarding the video frame jumps issue, it shouldn't happen with the legacy fullscreen mode (since we use the SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
and the SYSTEM_UI_FLAG_LAYOUT_STABLE
)
It only occurs with WindowInsetsController, right?
There are still remaining issues:
- I don't think we handle correctly displays that have a DisplayCutout (I'll test it)
- When we use the 3-button navigation on Android, the navigation bar hides the rotate button. I will try to fix that.
@hardcore-sushi I have implemented the fullscreen on the image viewer and fixed the "jump" issue.
But I am still having hard time figuring out why fitSystemWindows do not behave as expected on the activity_video_viewer (unlike the activity_image_viewer). FitSystemWindows is useful to set the ui layout size correctly to always see it when the navigation bar appears. For now, I have edited the exo_styled_player_control_view as a workaround. But with the 3-button navigation, the nav bar can hide either the rotate button or some part of the video title, depending of the screen orientation.
If you have any ideas, I am more than interrested! (otherwise, I will continue to investigate)
The jumping issue is only fixed for me in legacy fullscreen mode. I tried to fix the problem but I can't find a way to hide then show the navigation bar with the WindowInsetsControllerCompat
API without making the video jump. Maybe that's why NewPipe only uses the deprecated API.
What is the version of Android you are testing with?
For example, Just Video Player uses the new API starting Android 12 https://github.com/moneytoo/Player/blob/8ec8fd5ca91dc9c59b9eb6f98b612d8024c47cce/app/src/main/java/com/brouken/player/Utils.java#L120-L147
You're right in fact the old API is used up to API level 29: WindowInsetsControllerCompat.java I think we need to set legacy fullscreen mode automatically, not with a switch in settings.
So the jumping issue seems to have been fixed, at least up to Android 10. However I still have this problems:
- the rotate button is hidden in landscape mode when the navigation bar is visible
- when showing the status bar by scrolling down from the top it overlaps the title
Indeed, I think it's a good idea to remove the switch in the settings, too. I will do it (if API <= 29, use legacy mode)
Those problems are the same. It's related to the fitSystemWindows
(I mention it in my previous message). I'm working on it.
I will try to see how it works with Just (Video) Player.
I fixed the button overlap issue by programmatically setting a margin equal to the height of the navigation bar in landscape mode. Not elegant but it does the job.
Also, I have noticed that images and videos are no longer centered in the screen, I think this is due to my display cutout.
Okay, great! (I was thinking of that idea too but I hope we will find a better way)
Can you commit your work so I can test on my smartphone?
It's just this code in VideoPlayer.kt
:
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
binding.topBar.updateLayoutParams {
(this as RelativeLayout.LayoutParams).marginEnd =
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
resources.getDimensionPixelSize(
resources.getIdentifier(
"navigation_bar_height",
"dimen",
"android"
)
)
} else {
0
}
}
}
Thank you.
I have still some issues with fullscreen using gestures, so I will use the same logic as Just Video Player by using the windowInsetsController when Build.VERSION.SDK_INT >= 31.
I tested your latest changes and it looks good. However the left margin of the title in video player is not the same as the right margin of the rotate button in portrait mode, and the status bar still overlaps the title when it shows up. The image viewer is almost perfect, I just have to try to fix the centering bug due to the display cutout. We also have to test on Android 12 before merging.
OK, I'll take a look Can you take a screenshot when the status bar overlaps the title when it shows up, please
I get this when the title is visible and I pull down to show the status bar.
Great, the issues seem to have been resolved. However, why did you change the video player UI?
Thank you. Actually, it was a code I had worked on about two months ago, to modernize the video UI a little bit.
Should I revert the UI? 😅
Yes please. I created this custom layout so that we can see the video even when the controls are visible.
Is it OK for you?
Great! I tested on Android 12 and it also works fine. I will just make some edits, try to fix the display cutout issue, and then merge your PR. Thanks a lot for your work!
Unfortunately, I just found another bug. In landscape mode, the ImageViewer controls are a bit offset from the image. It looks like they are centered considering the height of the navbar while the image is centered ignoring it.
OK, I'll look into it
I am working on a fix, but I have a weird behavior when the ImageView goes in fullscreen. The ImageView shifts down (y coordinate = 75dp instead of 0).
I'm still trying to figure out why.
I implemented the feature with 821c853a226ac2bdffb77b39f98123cc3cede5c2. The implementation is not perfect but it does the job. Your contribution has helped me a lot, thank you very much.