aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-06-23 13:54:25 -0700
committerTadashi G. Takaoka <takaoka@google.com>2014-06-23 13:56:50 -0700
commit84405d2a6815a99992849e821e073835f2d892e3 (patch)
tree628bc3291bb1c3ca9a526dee9ee8957f5170481b /java/src
parent7d6bc4d06394bf3fc6574c2a8c5e077a91834961 (diff)
downloadlatinime-84405d2a6815a99992849e821e073835f2d892e3.tar.gz
latinime-84405d2a6815a99992849e821e073835f2d892e3.tar.xz
latinime-84405d2a6815a99992849e821e073835f2d892e3.zip
Fix some comments and rename method and parameter names
This is a follow up change of I12139a925d and I0ac92c56bd Change-Id: Id6e9f4434fddd5d4274e06da5063606c2ffad932
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/MainKeyboardView.java6
-rw-r--r--java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java11
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyPreviewChoreographer.java2
3 files changed, 10 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index 81825934f..702efb3d7 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -451,7 +451,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
locatePreviewPlacerView();
getLocationInWindow(mOriginCoords);
- mKeyPreviewChoreographer.placeKeyPreviewAndShow(key, keyboard.mIconsSet, mKeyDrawParams,
+ mKeyPreviewChoreographer.placeAndShowKeyPreview(key, keyboard.mIconsSet, mKeyDrawParams,
getWidth(), mOriginCoords, mDrawingPreviewPlacerView, isHardwareAccelerated());
}
@@ -554,11 +554,11 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
// though there may be some chances that the value is zero. <code>width == 0</code>
// will cause zero-division error at
// {@link MoreKeysKeyboardParams#setParameters(int,int,int,int,int,int,boolean,int)}.
- final boolean singleMoreKeyWithPreview = mKeyPreviewDrawParams.isPopupEnabled()
+ final boolean isSingleMoreKeyWithPreview = mKeyPreviewDrawParams.isPopupEnabled()
&& !key.noKeyPreview() && moreKeys.length == 1
&& mKeyPreviewDrawParams.getVisibleWidth() > 0;
final MoreKeysKeyboard.Builder builder = new MoreKeysKeyboard.Builder(
- context, key, getKeyboard(), singleMoreKeyWithPreview,
+ context, key, getKeyboard(), isSingleMoreKeyWithPreview,
mKeyPreviewDrawParams.getVisibleWidth(),
mKeyPreviewDrawParams.getVisibleHeight(), newLabelPaint(key));
moreKeysKeyboard = builder.build();
diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java
index 353e07cf7..e0184d7f1 100644
--- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java
@@ -261,13 +261,13 @@ public final class MoreKeysKeyboard extends Keyboard {
* @param context the context of {@link MoreKeysKeyboardView}.
* @param key the {@link Key} that invokes more keys keyboard.
* @param keyboard the {@link Keyboard} that contains the parentKey.
- * @param singleMoreKeyWithPreview true if the <code>key</code> has only one more key
- * and key popup preview is enabled.
+ * @param isSingleMoreKeyWithPreview true if the <code>key</code> has just a single
+ * "more key" and its key popup preview is enabled.
* @param keyPreviewDrawParams the parameter to place key preview.
- * @param paintToMeasure the {@link Paint} object to measure a more key width
+ * @param paintToMeasure the {@link Paint} object to measure a "more key" width
*/
public Builder(final Context context, final Key key, final Keyboard keyboard,
- final boolean singleMoreKeyWithPreview, final int keyPreviewVisibleWidth,
+ final boolean isSingleMoreKeyWithPreview, final int keyPreviewVisibleWidth,
final int keyPreviewVisibleHeight, final Paint paintToMeasure) {
super(context, new MoreKeysKeyboardParams());
load(keyboard.mMoreKeysTemplate, keyboard.mId);
@@ -275,10 +275,11 @@ public final class MoreKeysKeyboard extends Keyboard {
// TODO: More keys keyboard's vertical gap is currently calculated heuristically.
// Should revise the algorithm.
mParams.mVerticalGap = keyboard.mVerticalGap / 2;
+ // This {@link MoreKeysKeyboard} is invoked from the <code>key</code>.
mParentKey = key;
final int keyWidth, rowHeight;
- if (singleMoreKeyWithPreview) {
+ if (isSingleMoreKeyWithPreview) {
// Use pre-computed width and height if this more keys keyboard has only one key to
// mitigate visual flicker between key preview and more keys keyboard.
// Caveats for the visual assets: To achieve this effect, both the key preview
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyPreviewChoreographer.java b/java/src/com/android/inputmethod/keyboard/internal/KeyPreviewChoreographer.java
index 6fc300beb..cd29c8d17 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyPreviewChoreographer.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyPreviewChoreographer.java
@@ -105,7 +105,7 @@ public final class KeyPreviewChoreographer {
mFreeKeyPreviewViews.add(keyPreviewView);
}
- public void placeKeyPreviewAndShow(final Key key, final KeyboardIconsSet iconsSet,
+ public void placeAndShowKeyPreview(final Key key, final KeyboardIconsSet iconsSet,
final KeyDrawParams drawParams, final int keyboardViewWidth, final int[] keyboardOrigin,
final ViewGroup placerView, final boolean withAnimation) {
final KeyPreviewView keyPreviewView = getKeyPreviewView(key, placerView);