NewPipe
NewPipe copied to clipboard
Use WindowCompat.
What is it?
- [x] Codebase improvement (dev facing)
Description of the changes in your PR
- Use
WindowCompat
to replace the deprecated UI visibility flags, and to toggle the keyboard on/off.
Fixes the following issue(s)
- Fixes #
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Due diligence
- [x] I read the contribution guidelines.
In fullscreen the system back&home&recent buttons do not show up when the system ui is shown. I could reproduce on API 27 and 30. I was completely unable to test on API 22 as the player seems to crash when going fullscreen...
I didn't encounter that issue when I tested the changes on my end. I'll check again, thanks for the info.
In each place where you switched from flags to
WindowCompat
, could you explain why you expect the two code snippets to do the same thing? I.e. which flag turned into whichWindowCompat
call, ...
Sure, the setDecorFitsSystemWindows
call replaces the SYSTEM_UI_FLAG_LAYOUT_STABLE
, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
and SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
flags (the compat call uses them on API 16-29) and the insets controller calls replace the system bar immersive flags.
https://developer.android.com/reference/androidx/core/view/WindowCompat#setDecorFitsSystemWindows(android.view.Window,boolean) https://developer.android.com/develop/ui/views/layout/immersive
In fullscreen the system back&home&recent buttons do not show up when the system ui is shown. I could reproduce on API 27 and 30.
It was already like that in the main player UI (it only shows the status bar when tapping the video view).
That's not true, see this screenshot from nightly-26:
Okay, thanks. I checked on an API 23 emulator and it didn't show the navigation bar (I probably didn't deploy the dev branch correctly). I'll update the flag.