Implement vertical page panning in paged reader mode when using hardware keys #716
+38
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TLDR; With this change, if the page doesn't fit vertically on the screen, when the user presses "down" the page will be panned down first and then after hitting the bottom, switched to the next page. So it makes vertical panning consistent with horizontal panning of wide images.
My use case is that I'm running Komikku on an Android tablet that has an unusual screen aspect ratio (it's a 7,8 inch
1872x1404 e-ink screen) and when the "Scale type" is set to "Smart fit" the pages fill the screen horizontally but they usually don't fit vertically. As a result, when reading manga I have to first switch to a new page and then scroll down to see the bottom of the page. This is fine when handholding the device but is impossible to do when navigating pages with volume keys or a Bluetooth controller. When looking for a fix for this I found in the source code that the
moveDown()
function doesn't really move the page down but just switches to the next page. But themoveRight()
andmoveLeft()
are implemented correctly with panning first and so I decided that implementingmoveDown()
andmoveUp()
with panning will solve my problems.I tested this change with an emulator that has the specs of my device and it works perfectly as I wanted and it doesn't appear to be breaking anything else.
While this change solves my very narrow use case I still think that making the panning behavior consistent in both axes is logical and beneficial for all users.
Please let me know if I missed anything that is needed for merging PRs from outside contributors