AM
Size: a a a
AM
MG
MG
public void updatePosition(int dx, int dy) {
documentScrollX += dx;
documentScrollY += dy;
if (!scrolling) scrollThumb();
}
float multiplier2 = 0.0f;
float scrollBarPosition = 0.0f;
void scrollThumb() {
// the absolute position is only updated when the scrollbar itself
// gets scrolled by the touch listener
// so use documentScrollY instead, which is equivilant in that
// it is maintained by a callback from the document view
// specifying relative scroll direction
multiplier2 = documentScrollY / (documentHeight - windowHeight);
scrollBarPosition = clip.getY();
scrollBarPosition = multiplier2 * (getHeight() - scrollBarPosition);
clip.setY(scrollBarPosition);
}
AM
MG
AM
AM
MG
MG
AM
MG
AM
scrollBarPosition = multiplier2 * (getHeight() - scrollThumbHeight);
AM
MG
MG
scrollBarPosition = multiplier2 * (getHeight() - clip.getHeight());
🙂AM
AM
MG
AM
MG