Exemplo n.º 1
0
  @Override
  public void pageUp() {

    this.storedPosition = -1;

    if (isAtStart()) {
      PageTurnerSpine spine = bookView.getSpine();

      if (spine == null || !spine.navigateBack()) {
        return;
      }

      this.clearText();
      this.storedPosition = Integer.MAX_VALUE;
      this.bookView.loadText();
    } else {
      this.pageNum = Math.max(pageNum - 1, 0);
      updatePosition();
    }
  }
Exemplo n.º 2
0
  @Override
  public void pageDown() {

    this.storedPosition = -1;

    if (isAtEnd()) {
      PageTurnerSpine spine = bookView.getSpine();

      if (spine == null || !spine.navigateForward()) {
        return;
      }

      this.clearText();
      this.pageNum = 0;
      bookView.loadText();

    } else {
      this.pageNum = Math.min(pageNum + 1, this.pageOffsets.size() - 1);
      updatePosition();
    }
  }