gsioteam / kinoko

An online manga browser.
MIT License
260 stars 13 forks source link

Webtoon onNext not working properly #13

Closed winterdl closed 3 years ago

winterdl commented 3 years ago

Android and iOS, if last page of a chapter have a height less than a half of screen height, when we tap next, it will not working properly, and the totals page and last page not the same.

Screen record of android emulator

https://user-images.githubusercontent.com/302480/136736046-d7339bbe-7f95-46c4-9b11-818d198a70d4.mp4

This is another clip, if a page is too height, it will scroll only half of page height when I tap next, I have to drag over that page, the next page also tap next on first half of page.

https://user-images.githubusercontent.com/302480/136757504-5080738f-e308-41cf-b4b3-1e3462865934.mp4

https://user-images.githubusercontent.com/302480/136757970-204246a5-c78f-4562-b886-253763d50a1b.mp4

winterdl commented 3 years ago
void _positionUpdate() {
    if (!_listen) return;
    var list = listener.itemPositions.value;
    ItemPosition current;

    // if scroll down, get last visible item, if scroll up, get first visible item
    if (list != null && list.length > 0) {
      current = list.toList()[list.length - 1];
    }
    if (current != null) {
      _current = current;
      setPage(current.index);
    }
  }