Fix some comments and rename method and parameter names

This is a follow up change of I12139a925d and I0ac92c56bd

Change-Id: Id6e9f4434fddd5d4274e06da5063606c2ffad932
main
Tadashi G. Takaoka 2014-06-23 13:54:25 -07:00
parent 7d6bc4d063
commit 84405d2a68
3 changed files with 10 additions and 9 deletions

View File

@ -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();

View File

@ -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

View File

@ -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);