aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-09-05 18:58:30 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-09-05 20:36:19 +0900
commitea0c567f86bd19015d53fc038c4579df776cfec3 (patch)
tree3d3d08a3bd6220b9b03a592af7ce7d4ca8f53577 /java/src
parent3f8351e18614c71ac217057ae5ec2baeb3e559fa (diff)
downloadlatinime-ea0c567f86bd19015d53fc038c4579df776cfec3.tar.gz
latinime-ea0c567f86bd19015d53fc038c4579df776cfec3.tar.xz
latinime-ea0c567f86bd19015d53fc038c4579df776cfec3.zip
Tune mini keyboard visual
This change only gets rid of the surrounding paddings of the mini keyboard. Bug: 5248783 Change-Id: Idb95ac1467085c230fd60e4bc0f466fef5700bfb
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/MiniKeyboard.java21
1 files changed, 6 insertions, 15 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java b/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java
index da91b62d9..ad8056cc0 100644
--- a/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java
@@ -123,7 +123,9 @@ public class MiniKeyboard extends Keyboard {
}
mWidth = mOccupiedWidth = mNumColumns * mDefaultKeyWidth;
- mHeight = mOccupiedHeight = mNumRows * mDefaultRowHeight + mVerticalGap;
+ // Need to subtract the bottom row's gutter only.
+ mHeight = mOccupiedHeight = mNumRows * mDefaultRowHeight - mVerticalGap
+ + mTopPadding + mBottomPadding;
}
// Return key position according to column count (0 is default).
@@ -209,20 +211,9 @@ public class MiniKeyboard extends Keyboard {
super(view.getContext(), new MiniKeyboardParams());
load(parentKeyboard.mId.cloneWithNewXml(mResources.getResourceEntryName(xmlId), xmlId));
- // HACK: Current mini keyboard design totally relies on the 9-patch
- // padding about horizontal
- // and vertical key spacing. To keep the visual of mini keyboard as
- // is, these hacks are
- // needed to keep having the same horizontal and vertical key
- // spacing.
- mParams.mHorizontalGap = 0;
- mParams.mVerticalGap = mParams.mTopPadding = parentKeyboard.mVerticalGap / 2;
- // TODO: When we have correctly padded key background 9-patch
- // drawables for mini keyboard,
- // revert the above hacks and uncomment the following lines.
- // mParams.mHorizontalGap = parentKeyboard.mHorizontalGap;
- // mParams.mVerticalGap = parentKeyboard.mVerticalGap;
-
+ // TODO: Mini keyboard's vertical gap is currently calculated heuristically.
+ // Should revise the algorithm.
+ mParams.mVerticalGap = parentKeyboard.mVerticalGap / 2;
mParams.mIsRtlKeyboard = parentKeyboard.mIsRtlKeyboard;
mMoreKeys = parentKey.mMoreKeys;