Skip to content
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

Respect cutouts when playing in MultiWindow #7451

Merged
merged 1 commit into from
Dec 19, 2021

Conversation

Cheechaii
Copy link
Contributor

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

This fixes the half overlaying cutout on devices with API version 28 and higher. Currently, there are undesirable black bars.

This also respects the cutout when rotating the phone and resizes the video accordingly when in fullscreen. At the moment this leaves undesirable black bars at the top and bottom on devices that have a cutout and a screen that is nearly or exactly the resolution of the video. Maybe a setting can help here or a check for video/device resolution. Let me know what behavior you prefer.

This is my first encounter with Android in about 7 years, so please go easy on me. Let me know if there are bad behaviors or APIs that I missed.

Before/After Screenshots/Screen Record

  • Before:
    before-cutout

  • After:
    after-cutout

Fixes the following issue(s)

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

@litetex litetex added feature request Issue is related to a feature in the app GUI Issue is related to the graphical user interface labels Nov 27, 2021
@litetex
Copy link
Member

litetex commented Nov 27, 2021

Thank you for the PR!

I checked if the problem exists on my device (Android 9; Huawei EMUI 9.1.0) and I'm unable to reproduce it in the first place.
Does this only happen on specific devices/Android versions?

@Cheechaii
Copy link
Contributor Author

Cheechaii commented Nov 27, 2021

I have seen this problem on hardware on a Nokia 7.2 with Android 10 (API 29) and can reproduce this in the emulator for the virtual device definition "Pixel 3 XL" with API lvl 30 (which is in the screenshots) and also when I create a custom device with API lvl 30 resolution 1920x1080 plus enabling the cutout setting in the developer tools.

Maybe the author of the original issue #5787, @desmonk can tell us their device.

@triallax triallax added the player Issues related to any player (main, popup and background) label Nov 27, 2021
@triallax
Copy link
Contributor

triallax commented Dec 2, 2021

@Cheechaii the code seems to be duplicated between two difference places; can you de-duplicate it?

@litetex
Copy link
Member

litetex commented Dec 2, 2021

I'm also pretty sure that the code can be shrunk with the "?:" aka ternary operator

@Cheechaii Cheechaii force-pushed the respect-cutout-in-multiwindow branch 2 times, most recently from 93f4e07 to c92a907 Compare December 9, 2021 19:57
@Cheechaii
Copy link
Contributor Author

I extracted the code and replaced 3 code duplications and used the ternary expression.

Copy link
Member

@Redirion Redirion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. Thank you!

@Redirion Redirion merged commit d3562c7 into TeamNewPipe:dev Dec 19, 2021
This was referenced Feb 11, 2022
@litetex
Copy link
Member

litetex commented Feb 21, 2022

I think we should revert this PR as it causes multiple problems:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app GUI Issue is related to the graphical user interface player Issues related to any player (main, popup and background)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic Notchless Mode View - Just like Netflix
4 participants