Skip to content

Commit

Permalink
Improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Brais Gabin committed Dec 20, 2012
1 parent d57f612 commit b18a797
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions library/src/com/inqbarna/tablefixheaders/TableFixHeaders.java
Expand Up @@ -142,15 +142,19 @@ public boolean onTouchEvent(MotionEvent event) {
maxScrollX = bodyLinearLayout.getWidth() - (scrollView.getWidth() - headerColumnLinearLayout.getWidth());
maxScrollY = bodyLinearLayout.getHeight() - (scrollView.getHeight() - headerRowLinearLayout.getHeight());

if (scrollX < 0) {
scrollX = Math.max(scrollX, 0);
} else {
scrollX = Math.min(scrollX, maxScrollX);
if (scrollX != 0) {
if (scrollX < 0) {
scrollX = Math.max(scrollX, 0);
} else {
scrollX = Math.min(scrollX, maxScrollX);
}
}
if (scrollY < 0) {
scrollY = Math.max(scrollY, 0);
} else {
scrollY = Math.min(scrollY, maxScrollY);
if (scrollY != 0) {
if (scrollY < 0) {
scrollY = Math.max(scrollY, 0);
} else {
scrollY = Math.min(scrollY, maxScrollY);
}
}

headerRowLinearLayout.scrollTo(scrollX, 0);
Expand Down

0 comments on commit b18a797

Please sign in to comment.