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
Leaving a 90° rotated PDF shortens the file browser on Android #6704
Comments
Probably not android related. The screen orientation is changed fine and all the screen is filled with white color. A bad rota on android would mean the half lower part of pic3 is black. |
Can't repro on Kobo, FWIW. |
I think the filebrowser is still 90° rotated while the screen is 0°. It is visible on the top of the third screen. The "KOreader" title is not in the middle of the screen. A logcat is added. I guess one of this two lines is wrong.
|
The surface changes first, then some events are broadcasted to widgets to resize the screen to the new window size. So your two log samples are from two different orientation changes. The first for a portrait -> landscape resize. The second for landscape -> portrait surface change. A surface change is a kind of configuration change and handled in https://github.com/koreader/koreader/blob/master/frontend/device/android/device.lua#L140-L152 Please attach the full log. |
@pazos A new log is attached in the main topic: https://github.com/koreader/koreader/files/5271737/logcat.txt |
Actually the new log makes sense. Could you attach the same log but including verbose messages too? (ie: instead of |
New logcat.txt added to main topic using command 'adb logcat KOReader:V ActivityManager:* AndroidRuntime:* *:F': https://github.com/koreader/koreader/files/5274052/logcat.txt |
Everything seems fine: first config change
second config change
Probably we miss some event to resize the FM in https://github.com/koreader/koreader/blob/master/frontend/device/android/device.lua#L141-L151, but I don't know if something like that is available. |
IIRC, it's as easy as re-init'ing the FM or something. In a hurry right now, but try to dig up the PR where @yparitcher implemented Landscape in the FM, I seem to remember we discussed this at one point in there. |
see: koreader/frontend/apps/filemanager/filemanager.lua Lines 60 to 71 in e169b34
specifically self:reinit(self.instance.path, self.instance.focused_file) you might want to borrow from this, or just broadcast |
also koreader/frontend/device/input.lua Lines 679 to 692 in f0f0cfd
|
@yparitcher: thanks for the hints. Feel free to give it a try if you wish. I'm very much done with android nonsense. Hint: the issue described by OP just affects devices with HW rotation. I cannot reproduce in legacy emulators (API17). |
I fixed HW/SW orientation mismatches in koreader/android-luajit-launcher@00d9e87 What's left is to handle FM rescale to the new screen size in android. I didn't follow the codepath but the way HW orientation works is encapsulated in Any UI resize event that happens before Also, in android, a orientation change triggers a "config change" event. We use that to know when the surface is actually recreated, get its new size and send the UI events needed to rescale the reader TL;DR:
|
try as in the code above #6704 (comment) |
Yup, that would make a loop!!. I will try to do the FM instance reinit when the new surface is ready. |
KOReader version: 2020.09 and 2020.08.1
Device: Tolino Epos with Android 4.4.2 and phone with Android 10
Issue
Leaving a 90° rotated PDF shortens the file browser on Android.
Steps to reproduce
Picture 1. (0°)
Picture 2. (90°)
Picture 3. (0°, there is blank space below the file list an the menu a the top is false alligned)
crash.log
(if applicable)Here is a logcat: Height and width are alternating. The file is opened in 90° and than the file browser will be opened
logcat.txt
The text was updated successfully, but these errors were encountered: