Implement synchronous horizontal scroll - #111
Conversation
4493228 to
25f1a56
Compare
| val isSwapKeys: Boolean | ||
| get() = getBooleanProperty(SWAP_KEYS, false) | ||
|
|
||
| val isSyncXScroll: Boolean |
There was a problem hiding this comment.
@zhmylove here you use old Orion's approach to work with properties, it doesn't reflect changes in setting until application restart. Please take a look on DRAW_PAGE_BORDER property below, it defines OBSERVABLE property that listens all changes in settings
There was a problem hiding this comment.
Sure, I'll update this part of code soon
There was a problem hiding this comment.
@max-kammerer Hello! I've pushed new variant. This time it respects settings change just in time
| var firstXPos = 0f | ||
| activePages.forEach { | ||
| if (it.isOnScreen) { | ||
| if (first) |
There was a problem hiding this comment.
Change in doScrollAndDoRendering is clear, but this one is not. Could you please elaborate it?
There was a problem hiding this comment.
I've noticed that orion-viewer does something like prefetch of the pages: it loads around 3 extra pages to the direction of scrolling and changes in doScrollAndDoRendering properly sync their X-position.
The problem was with other pages being loaded during scrolling. I failed setting their X-position in uploadPrevPage and uploadNextPage, nor inside addPageInPosition — those functions just ignored it and new pages (4+ pages below) got improper position. So the only solution I came across is to synchronize X-position for all the pages being rendered in renderVisiblePages
There was a problem hiding this comment.
The problem was with other pages being loaded during scrolling. I failed setting their X-position in uploadPrevPage and uploadNextPage, nor inside addPageInPosition — those functions just ignored it and new pages (4+ pages below) got improper position. So the only solution I came across is to synchronize X-position for all the pages being rendered in renderVisiblePages
@zhmylove Sorry for long delay in response. It's interesting cause there should be a code that ignores passed value and/or passes default one. Do you have any change to restore from history described above approach and share it via another PR?
There was a problem hiding this comment.
Sorry, I did check my repos and it seems I have no history even in reflog :(
25f1a56 to
0ef4c10
Compare
|
|
||
| val DRAW_PAGE_BORDER = pref("DRAW_PAGE_BORDER", true) | ||
|
|
||
| val SYNC_X_SCROLL = pref("SYNC_X_SCROLL", true) |
There was a problem hiding this comment.
Please use 'false' as default here
Signed-off-by: Sergei Zhmylev <zhmylove@narod.ru>
0ef4c10 to
8acf95e
Compare
|
@max-kammerer I'm afraid, I do not understand #119 :( Despite there is no inertness, horizontal scrolling already works properly in Google Play version. #111 is about making all the pages scroll simultaneously. I mean, I want the whole document scroll whenever I move any it's page as so when I scroll down, all the pages are still aligned |
|
@max-kammerer ah, I see. Thanks for the clarification! No, it looks like #111 and #119 cover different use-cases and can not be used interchangeably |
|
@max-kammerer Can this be merged now. This seems cool. |
|
@nirodhvana I think it requires some additional work |
Addresses #102
Implemented new behaviour parameter: syncXScroll which is disabled by default.
When active, it synchronizes horizontal position of all active pages