Skip to content

Commit a403cb7

Browse files
author
Luca Zanolin
committed
The x and y position of the pop-up where not calculated correctly when the text view had internal scrolling.
This method is invoked only when the pop-up is currently displayed and the text scrolles. This is scenario is reproducible only with Voice IME (I think), as the text is inserted without touching the screen. Bug: 5290463 Change-Id: I0b842732cc1f115de06e992fbe28cb64eac49b22
1 parent 9f48d63 commit a403cb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/java/android/widget/TextView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9433,8 +9433,8 @@ public boolean isVisible(int positionX, int positionY) {
94339433
return false;
94349434
}
94359435

9436-
int posX = mPositionX + positionX;
9437-
int posY = mPositionY + positionY;
9436+
int posX = mPositionX + positionX - getScrollX();
9437+
int posY = mPositionY + positionY - getScrollY();
94389438

94399439
// Offset by 1 to take into account 0.5 and int rounding around getPrimaryHorizontal.
94409440
return posX >= clip.left - 1 && posX <= clip.right + 1 &&

0 commit comments

Comments
 (0)