koreader / android-luajit-launcher

Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
MIT License
131 stars 85 forks source link

Reverted cutout and fix rotations #439

Closed hugleo closed 10 months ago

hugleo commented 1 year ago

This change is Reviewable

hugleo commented 1 year ago

Wondering why the changes for Android 14 don't work for me after I merged the changes with the checks and then I went to logging.

09-24 09:50:34.558 20926 20926 V Android_Version: onAttachedToWindow Android version is: 33 09-24 09:50:34.595 20926 20926 V Android_Version: surfaceChanged Android version is: 33 09-24 09:50:34.649 20926 20959 V Android_Version: getScreenWidth Android version is: 33 09-24 09:50:34.649 20926 20959 V Android_Version: getScreenHeight Android version is: 33

It is because my device is Android 13. DUH, DUH, DUH. I feel so dumb. That Xiaomi version screen really tricks me out."

Screenshot_2023-09-24-09-57-03-291_com android settings

Now the discussion about Android 14 doesn't make any sense since I actually have an Android 13 device.

@pazos Should I then apply my working changes to Android 13 then since I simulate the problem now on a real device?

Oh boy....

pazos commented 10 months ago

@hugleo: sorry for the delay.

two nitpicks and this can be merged.

Please add a log statement in the new condition, too. Use exactly the same string, so logs provide the same feedback in all android versions.

Please fix https://app.codacy.com/gh/koreader/android-luajit-launcher/pullRequest?prid=12685762

hugleo commented 10 months ago

@pazos nitpicks addressed

jospalau commented 8 months ago

This broke the screen for my Xiaomi. I don't read on the phone. Just letting you know. MIUI 14 too.

I am using the patch I used to use previously to the original fix that this is reverting to add the missing height.

hugleo commented 8 months ago

Do you have a screenshot of the problem?

jospalau commented 8 months ago

Sure.

Screenshot_2024-02-14-22-11-36-977_org koreader launcher

hugleo commented 8 months ago

If you rotate to landscape in KOReader options and then back to portrait, does the problem go away?

hugleo commented 8 months ago

Also tell which device model

jospalau commented 8 months ago

No. In landscape mode the cut is on the right side. Screenshot_2024-02-14-22-26-18-349_com android settings

hugleo commented 8 months ago

This device has a hole at the top just like mine. The black bar is supposed to fill the hole and should be drawn at the top. However, on yours, it is being drawn at the bottom. Unless, of course, you have a rotation configured like the picture below, this should be the normal behavior.

rotation

jospalau commented 8 months ago

I have it by default but I don't know why the order of the icons is different than in yours. IMG_20240214_224916

I think I know what you mean but I want it full screen like the rests of the apps.

Previous code reverted and the patch makes it work: local screen = require("android").screen screen.height = screen.height +90

hugleo commented 8 months ago

I have it by default but I don't know why the order of the icons is different than in yours. IMG_20240214_224916

I think I know what you mean but I want it full screen like the rests of the apps.

Previous code reverted and the patch makes it work: local screen = require("android").screen screen.height = screen.height +90

Your default setting is correct; in my case, I intentionally changed it. Your black bar should be at the top for this rotation mode.

jospalau commented 8 months ago

It is not a problem to be honest. Just curious. Thanks