Fix mini keyboard position

This change adjusts popup mini keyboard X-coordinate not to be clipped
out of the display.

Bug: 4442045
Cherry-Pick: Ibdf4e2d0a79cddbeb89ed8ded81a2db9af9797b8
Change-Id: I1c3ce7b1c6a6d247b796a1cdcd821bf88321ddef
main
Tadashi G. Takaoka 2011-06-03 21:28:24 +09:00
parent c0fdabcd85
commit f03883025f
1 changed files with 5 additions and 3 deletions

View File

@ -76,9 +76,11 @@ public class PopupMiniKeyboardView extends KeyboardView implements PopupPanel {
final int pointX = (mConfigShowMiniKeyboardAtTouchedPoint) ? tracker.getLastX()
: parentKey.mX + parentKey.mWidth / 2;
final int pointY = parentKey.mY;
final int miniKeyboardX = pointX - miniKeyboard.getDefaultCoordX()
- container.getPaddingLeft()
+ parentKeyboardView.getPaddingLeft() + mCoordinates[0];
final int miniKeyboardLeft = pointX - miniKeyboard.getDefaultCoordX()
+ parentKeyboardView.getPaddingLeft();
final int miniKeyboardX = Math.max(0, Math.min(miniKeyboardLeft,
parentKeyboardView.getWidth() - miniKeyboard.getMinWidth()))
- container.getPaddingLeft() + mCoordinates[0];
final int miniKeyboardY = pointY - parentKeyboard.getVerticalGap()
- (container.getMeasuredHeight() - container.getPaddingBottom())
+ parentKeyboardView.getPaddingTop() + mCoordinates[1];