NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

Use WindowCompat.

Open Isira-Seneviratne opened this issue 2 years ago • 1 comments

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

Isira-Seneviratne avatar Aug 28 '22 02:08 Isira-Seneviratne

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 which WindowCompat 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

Isira-Seneviratne avatar Jan 02 '23 11:01 Isira-Seneviratne

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).

Isira-Seneviratne avatar Jan 10 '23 13:01 Isira-Seneviratne

That's not true, see this screenshot from nightly-26: Screenshot_20230111-205745_NewPipe_nightly.png

Stypox avatar Jan 11 '23 19:01 Stypox

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.

Isira-Seneviratne avatar Jan 12 '23 00:01 Isira-Seneviratne