Skip to content

Commit 0058670

Browse files
fix wrong clicks in non fixed headers state
1 parent 4679427 commit 0058670

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableLayout.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,8 +1563,11 @@ private ViewHolder getViewHolderByPosition(int x, int y) {
15631563

15641564
int absX = tempX + mState.getScrollX() - getEmptySpace();
15651565
int absY = tempY + mState.getScrollY();
1566-
1567-
if (!mSettings.isHeaderFixed()) {
1566+
if (!mSettings.isHeaderFixed() && isRTL() && getEmptySpace() == 0) {
1567+
tempX = absX - mState.getScrollX();
1568+
tempY = absY - mState.getScrollY();
1569+
} else if (!mSettings.isHeaderFixed() && !isRTL()) {
1570+
tempX = absX;
15681571
tempY = absY;
15691572
}
15701573

@@ -1594,7 +1597,7 @@ private ViewHolder getViewHolderByPosition(int x, int y) {
15941597
int column = mManager.getColumnByXWithShift(absX, mSettings.getCellMargin());
15951598
viewHolder = mHeaderColumnViewHolders.get(column);
15961599
} else if (absX < mManager.getHeaderRowWidth() && !isRTL()
1597-
|| absX > calculateRowHeadersLeft() && isRTL()) {
1600+
|| absX - mState.getScrollX() > calculateRowHeadersLeft() - getEmptySpace() && isRTL()) {
15981601
// coordinate x, y in the row header's area
15991602
int row = mManager.getRowByYWithShift(absY, mSettings.getCellMargin());
16001603
viewHolder = mHeaderRowViewHolders.get(row);

0 commit comments

Comments
 (0)