/** * Scrolls to a previously stored point. * * <p>Call this after setPosition() to actually go there. */ private void restorePosition() { if (this.storedAnchor != null && this.anchors.containsKey(storedAnchor)) { strategy.setPosition(anchors.get(storedAnchor)); this.storedAnchor = null; } this.strategy.updatePosition(); }
public void goBackInHistory() { this.strategy.clearText(); this.spine.navigateByIndex(this.prevIndex); strategy.setPosition(this.prevPos); this.storedAnchor = null; this.prevIndex = -1; this.prevPos = -1; loadText(); }
public void goBackInHistory() { if (this.prevIndex == this.getIndex()) { strategy.setPosition(prevPos); this.storedAnchor = null; this.prevIndex = -1; this.prevPos = -1; restorePosition(); } else { this.strategy.clearText(); this.spine.navigateByIndex(this.prevIndex); strategy.setPosition(this.prevPos); this.storedAnchor = null; this.prevIndex = -1; this.prevPos = -1; loadText(); } }