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

Black bar (where notification bar would be) present in fullscreen portrait mode on foldable phones #1919

Open
4 tasks done
cbeley opened this issue Sep 9, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@cbeley
Copy link

cbeley commented Sep 9, 2024

Steps to reproduce

  1. Set "Cutout area behavior" to "Ignore cutout areas".
  2. Ensure "Fullscreen" is on.
  3. Observe no black bar in portrait mode.
  4. Open to inner display on foldable and rotate to force "portrait" mode.
  5. Observe unexpected black bar on top of screen where notification bar would be.

Expected behavior

I expect no black bar on the top of the screen where the notification bar is when in portrait mode (and ideally in landscape mode too - moot since its a 1:1 screen though)

Actual behavior

A black bar appears where the notification bar would be regardless of device orientation on large screens.

For example, on the Pixel 9 Pro Fold with a 1:1 aspect ratio screen, you can change between portrait and landscape mode for app-compatibility purposes by rotating the screen. This has no effect on Neko.

Interestingly, if you force "portrait" in neko's settings, you almost get the correct behavior when using the inner large screen. The top black bar is missing, but you get very thin black bars on the left and right. This is better, but still not ideal.

This is not an issue with Mihon and it works as expected.

This is possibly related to #534; however, Android should be reporting it as "portrait" mode when I rotate the device, yet the black bar is still there. This also results in a lot of wasted space on the Pixel 9 pro fold -- even if you don't want the notch to cover anything, if not using "full width" or if the comic has margins the notch would not normally cover anything.

Crash logs

No response

Neko version

2.17.1

Android version

Android 14

Device

Pixel 9 Pro Fold

Other details

The behavior of "ignore cutout areas" is confusing. It'd be ideal if Neko matched Mihon and just has a single universal "Show content in cutout areas" option that is either on or off with no other conditions considered.

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I have updated the app to the newest version Latest.
  • I have filled out all of the requested information in this form.
@cbeley cbeley added the bug Something isn't working label Sep 9, 2024
@nonproto
Copy link
Collaborator

nonproto commented Sep 9, 2024

What is your page type set as? I am not seeing back bars when I open my fold

@cbeley
Copy link
Author

cbeley commented Sep 9, 2024

I had it set to "vertical" and "orientation" set to "free".

I also just tried "left to right", "right to left", and "webtoon" and am seeing the same thing regardless of orientation.

@cbeley
Copy link
Author

cbeley commented Sep 9, 2024

This is how it looks with free orientation:

Screenshot_20240908-183000

And this is how it looks if I force portrait in Neko

Screenshot_20240908-183107

@nonproto
Copy link
Collaborator

nonproto commented Sep 9, 2024

So this is part of the design choice inherited from j2k. I am undecided if I will switch to Mihon's implementation

@cbeley
Copy link
Author

cbeley commented Sep 10, 2024

Ah, I thought it was only supposed to pertain to landscape only. So it's currently intended to behave this way in portrait mode on large-screens, but on small screens to be fullscreen?

@nonproto
Copy link
Collaborator

Ah, I thought it was only supposed to pertain to landscape only. So it's currently intended to behave this way in portrait mode on large-screens, but on small screens to be fullscreen?

Could you elaborate. I know the pixel 9 pro fold tends to not trigger tablet or - [ ] landscape when opened. If you could provide side by sides with a phone. I can verify more if it's a bug or intended

@cbeley
Copy link
Author

cbeley commented Sep 10, 2024

The Pixel 9 pro fold lets you switch between landscape and portrait mode by rotating the device. The aspect ratio is the same, but what it reports to the app should be different.

For example, the Relay for Reddit app lets you configured different views based on portrait or landscape mode. I just rotate my fold to switch between the two modes, so the orientation is definitely being sent to the app how I think it is (using what API, I do not know though).

Here's a JavaScript demo that I confirmed works in firefox and chrome on the Pixel 9 Pro fold when unfolded: https://jsfiddle.net/a19r6obh/ . Rotate the device and you'll see it switches between landscape and portrait, even though the aspect ratio is the same.


As an aside, a friend of mine mentioned that there are some changes upcoming in Android 15 that may be relevant here: https://developer.android.com/about/versions/15/behavior-changes-15#edge-to-edge .

@cbeley
Copy link
Author

cbeley commented Sep 10, 2024

I played with this a bit and found out a few interesting things:

If you are like me and simply want to rebuild neko to always use the full screen, a quick and dirty change is to modify https://github.com/nekomangaorg/Neko/blob/main/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt#L1702 to:

private fun setNotchCutoutMode() {
        val params = window.attributes
        params.layoutInDisplayCutoutMode =
            WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
    }

@nonproto
Copy link
Collaborator

Thanks for looking into. Likely a product of the app being partially compose. When I get some time I'll play around and try to optimize it some more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants