Skip to content

Commit aad33c4

Browse files
committed
Implemented scrollTo()
1 parent 88571e8 commit aad33c4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

library/src/com/inqbarna/tablefixheaders/TableFixHeaders.java

100644100755
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,15 @@ public boolean onTouchEvent(MotionEvent event) {
229229

230230
@Override
231231
public void scrollTo(int x, int y) {
232-
// TODO implement
232+
if (needRelayout) {
233+
scrollX = x;
234+
firstColumn = 0;
235+
236+
scrollY = y;
237+
firstRow = 0;
238+
} else {
239+
scrollBy(x - sumArray(widths, 1, firstColumn) - scrollX, y - sumArray(heights, 1, firstRow) - scrollY);
240+
}
233241
}
234242

235243
@Override

0 commit comments

Comments
 (0)