Code example for Layout

Methods: getLineBottom, getLineForOffset

0
 
			Layout layout = this.childView.getLayout();
 
			if (layout != null) {
				int pos = Math.max(0, this.storedPosition);
				int line = layout.getLineForOffset(pos);
 
				if (line > 0) {
					int newPos = layout.getLineBottom(line - 1);
					bookView.scrollTo(0, newPos);
				} else { 
					bookView.scrollTo(0, 0);
				} 
			} 
		} 
	} 
 
	@Override 
	public Spanned getText() {
		return text;
	}