Cleanup Keyboard related code and rename some classes
This is a follow up change of I90ffbde0 Bug: 5023981 Change-Id: I3a6b862d05f5f907dee954cd6d6fee983b20ab5e
This commit is contained in:
parent
047f63f559
commit
1be29abab2
16 changed files with 122 additions and 128 deletions
|
@ -31,6 +31,6 @@
|
||||||
*;
|
*;
|
||||||
}
|
}
|
||||||
|
|
||||||
-keep class com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder$MiniKeyboardLayoutParams {
|
-keep class com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder$MiniKeyboardParams {
|
||||||
<init>(...);
|
<init>(...);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
package com.android.inputmethod.deprecated.languageswitcher;
|
package com.android.inputmethod.deprecated.languageswitcher;
|
||||||
|
|
||||||
import com.android.inputmethod.keyboard.internal.KeyboardParser;
|
import com.android.inputmethod.keyboard.internal.KeyboardBuilder;
|
||||||
import com.android.inputmethod.latin.DictionaryFactory;
|
import com.android.inputmethod.latin.DictionaryFactory;
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
import com.android.inputmethod.latin.Settings;
|
import com.android.inputmethod.latin.Settings;
|
||||||
|
@ -162,7 +162,7 @@ public class InputLanguageSelection extends PreferenceActivity {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final String localeStr = locale.toString();
|
final String localeStr = locale.toString();
|
||||||
final String[] layoutCountryCodes = KeyboardParser.parseKeyboardLocale(
|
final String[] layoutCountryCodes = KeyboardBuilder.parseKeyboardLocale(
|
||||||
this, R.xml.kbd_qwerty).split(",", -1);
|
this, R.xml.kbd_qwerty).split(",", -1);
|
||||||
if (!TextUtils.isEmpty(localeStr) && layoutCountryCodes.length > 0) {
|
if (!TextUtils.isEmpty(localeStr) && layoutCountryCodes.length > 0) {
|
||||||
for (String s : layoutCountryCodes) {
|
for (String s : layoutCountryCodes) {
|
||||||
|
|
|
@ -28,8 +28,8 @@ import com.android.inputmethod.keyboard.internal.KeyStyles;
|
||||||
import com.android.inputmethod.keyboard.internal.KeyStyles.KeyStyle;
|
import com.android.inputmethod.keyboard.internal.KeyStyles.KeyStyle;
|
||||||
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
|
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
|
||||||
import com.android.inputmethod.keyboard.internal.KeyboardParams;
|
import com.android.inputmethod.keyboard.internal.KeyboardParams;
|
||||||
import com.android.inputmethod.keyboard.internal.KeyboardParser;
|
import com.android.inputmethod.keyboard.internal.KeyboardBuilder;
|
||||||
import com.android.inputmethod.keyboard.internal.KeyboardParser.ParseException;
|
import com.android.inputmethod.keyboard.internal.KeyboardBuilder.ParseException;
|
||||||
import com.android.inputmethod.keyboard.internal.PopupCharactersParser;
|
import com.android.inputmethod.keyboard.internal.PopupCharactersParser;
|
||||||
import com.android.inputmethod.keyboard.internal.Row;
|
import com.android.inputmethod.keyboard.internal.Row;
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
|
@ -235,14 +235,14 @@ public class Key {
|
||||||
R.styleable.Keyboard);
|
R.styleable.Keyboard);
|
||||||
int keyWidth;
|
int keyWidth;
|
||||||
try {
|
try {
|
||||||
mHeight = KeyboardParser.getDimensionOrFraction(keyboardAttr,
|
mHeight = KeyboardBuilder.getDimensionOrFraction(keyboardAttr,
|
||||||
R.styleable.Keyboard_rowHeight,
|
R.styleable.Keyboard_rowHeight,
|
||||||
params.mHeight, row.mRowHeight) - params.mVerticalGap;
|
params.mHeight, row.mRowHeight) - params.mVerticalGap;
|
||||||
mHorizontalGap = KeyboardParser.getDimensionOrFraction(keyboardAttr,
|
mHorizontalGap = KeyboardBuilder.getDimensionOrFraction(keyboardAttr,
|
||||||
R.styleable.Keyboard_horizontalGap,
|
R.styleable.Keyboard_horizontalGap,
|
||||||
params.mWidth, params.mHorizontalGap);
|
params.mWidth, params.mHorizontalGap);
|
||||||
mVerticalGap = params.mVerticalGap;
|
mVerticalGap = params.mVerticalGap;
|
||||||
keyWidth = KeyboardParser.getDimensionOrFraction(keyboardAttr,
|
keyWidth = KeyboardBuilder.getDimensionOrFraction(keyboardAttr,
|
||||||
R.styleable.Keyboard_keyWidth,
|
R.styleable.Keyboard_keyWidth,
|
||||||
params.mWidth, row.mDefaultKeyWidth);
|
params.mWidth, row.mDefaultKeyWidth);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -263,7 +263,7 @@ public class Key {
|
||||||
}
|
}
|
||||||
|
|
||||||
final int keyboardWidth = params.mOccupiedWidth;
|
final int keyboardWidth = params.mOccupiedWidth;
|
||||||
int keyXPos = KeyboardParser.getDimensionOrFraction(keyAttr,
|
int keyXPos = KeyboardBuilder.getDimensionOrFraction(keyAttr,
|
||||||
R.styleable.Keyboard_Key_keyXPos, keyboardWidth, x);
|
R.styleable.Keyboard_Key_keyXPos, keyboardWidth, x);
|
||||||
if (keyXPos < 0) {
|
if (keyXPos < 0) {
|
||||||
// If keyXPos is negative, the actual x-coordinate will be k + keyXPos.
|
// If keyXPos is negative, the actual x-coordinate will be k + keyXPos.
|
||||||
|
@ -317,9 +317,9 @@ public class Key {
|
||||||
mEdgeFlags = 0;
|
mEdgeFlags = 0;
|
||||||
|
|
||||||
final KeyboardIconsSet iconsSet = params.mIconsSet;
|
final KeyboardIconsSet iconsSet = params.mIconsSet;
|
||||||
mVisualInsetsLeft = KeyboardParser.getDimensionOrFraction(keyAttr,
|
mVisualInsetsLeft = KeyboardBuilder.getDimensionOrFraction(keyAttr,
|
||||||
R.styleable.Keyboard_Key_visualInsetsLeft, keyboardWidth, 0);
|
R.styleable.Keyboard_Key_visualInsetsLeft, keyboardWidth, 0);
|
||||||
mVisualInsetsRight = KeyboardParser.getDimensionOrFraction(keyAttr,
|
mVisualInsetsRight = KeyboardBuilder.getDimensionOrFraction(keyAttr,
|
||||||
R.styleable.Keyboard_Key_visualInsetsRight, keyboardWidth, 0);
|
R.styleable.Keyboard_Key_visualInsetsRight, keyboardWidth, 0);
|
||||||
mPreviewIcon = iconsSet.getIcon(style.getInt(
|
mPreviewIcon = iconsSet.getIcon(style.getInt(
|
||||||
keyAttr, R.styleable.Keyboard_Key_keyIconPreview,
|
keyAttr, R.styleable.Keyboard_Key_keyIconPreview,
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class KeyDetector {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getNearbyKeyCodes(final int[] allCodes) {
|
private void getNearbyKeyCodes(final int[] allCodes) {
|
||||||
final List<Key> keys = getKeyboard().getKeys();
|
final List<Key> keys = getKeyboard().mKeys;
|
||||||
final int[] indices = mIndices;
|
final int[] indices = mIndices;
|
||||||
|
|
||||||
// allCodes[0] should always have the key code even if it is a non-letter key.
|
// allCodes[0] should always have the key code even if it is a non-letter key.
|
||||||
|
@ -187,7 +187,7 @@ public class KeyDetector {
|
||||||
* @return The nearest key index
|
* @return The nearest key index
|
||||||
*/
|
*/
|
||||||
public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) {
|
public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) {
|
||||||
final List<Key> keys = getKeyboard().getKeys();
|
final List<Key> keys = getKeyboard().mKeys;
|
||||||
final int touchX = getTouchX(x);
|
final int touchX = getTouchX(x);
|
||||||
final int touchY = getTouchY(y);
|
final int touchY = getTouchY(y);
|
||||||
|
|
||||||
|
|
|
@ -153,11 +153,6 @@ public class Keyboard {
|
||||||
return mProximityInfo.getNativeProximityInfo();
|
return mProximityInfo.getNativeProximityInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Access mKeys directly
|
|
||||||
public List<Key> getKeys() {
|
|
||||||
return mKeys;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasShiftLockKey() {
|
public boolean hasShiftLockKey() {
|
||||||
return !mShiftLockKeys.isEmpty();
|
return !mShiftLockKeys.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
|
@ -448,7 +448,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
|
||||||
canvas.translate(-keyDrawX, -keyDrawY);
|
canvas.translate(-keyDrawX, -keyDrawY);
|
||||||
} else {
|
} else {
|
||||||
// Draw all keys.
|
// Draw all keys.
|
||||||
for (final Key key : mKeyboard.getKeys()) {
|
for (final Key key : mKeyboard.mKeys) {
|
||||||
final int keyDrawX = key.mX + key.mVisualInsetsLeft + getPaddingLeft();
|
final int keyDrawX = key.mX + key.mVisualInsetsLeft + getPaddingLeft();
|
||||||
final int keyDrawY = key.mY + getPaddingTop();
|
final int keyDrawY = key.mY + getPaddingTop();
|
||||||
canvas.translate(keyDrawX, keyDrawY);
|
canvas.translate(keyDrawX, keyDrawY);
|
||||||
|
|
|
@ -31,8 +31,8 @@ import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.android.inputmethod.keyboard.internal.KeyboardBuilder;
|
||||||
import com.android.inputmethod.keyboard.internal.KeyboardParams;
|
import com.android.inputmethod.keyboard.internal.KeyboardParams;
|
||||||
import com.android.inputmethod.keyboard.internal.KeyboardParser;
|
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
import com.android.inputmethod.latin.SubtypeSwitcher;
|
import com.android.inputmethod.latin.SubtypeSwitcher;
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ public class LatinKeyboard extends Keyboard {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends KeyboardParser<LatinKeyboardParams> {
|
public static class Builder extends KeyboardBuilder<LatinKeyboardParams> {
|
||||||
public Builder(Context context) {
|
public Builder(Context context) {
|
||||||
super(context, new LatinKeyboardParams());
|
super(context, new LatinKeyboardParams());
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,12 +16,12 @@
|
||||||
|
|
||||||
package com.android.inputmethod.keyboard;
|
package com.android.inputmethod.keyboard;
|
||||||
|
|
||||||
import com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder.MiniKeyboardLayoutParams;
|
import com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder.MiniKeyboardParams;
|
||||||
|
|
||||||
public class MiniKeyboard extends Keyboard {
|
public class MiniKeyboard extends Keyboard {
|
||||||
private final int mDefaultKeyCoordX;
|
private final int mDefaultKeyCoordX;
|
||||||
|
|
||||||
public MiniKeyboard(MiniKeyboardLayoutParams params) {
|
public MiniKeyboard(MiniKeyboardParams params) {
|
||||||
super(params);
|
super(params);
|
||||||
mDefaultKeyCoordX = params.getDefaultKeyCoordX() + params.mDefaultKeyWidth / 2;
|
mDefaultKeyCoordX = params.getDefaultKeyCoordX() + params.mDefaultKeyWidth / 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class MiniKeyboardKeyDetector extends KeyDetector {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) {
|
public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) {
|
||||||
final List<Key> keys = getKeyboard().getKeys();
|
final List<Key> keys = getKeyboard().mKeys;
|
||||||
final int touchX = getTouchX(x);
|
final int touchX = getTouchX(x);
|
||||||
final int touchY = getTouchY(y);
|
final int touchY = getTouchY(y);
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ public class PointerTracker {
|
||||||
public void setKeyDetectorInner(KeyDetector keyDetector) {
|
public void setKeyDetectorInner(KeyDetector keyDetector) {
|
||||||
mKeyDetector = keyDetector;
|
mKeyDetector = keyDetector;
|
||||||
mKeyboard = keyDetector.getKeyboard();
|
mKeyboard = keyDetector.getKeyboard();
|
||||||
mKeys = mKeyboard.getKeys();
|
mKeys = mKeyboard.mKeys;
|
||||||
final int keyQuarterWidth = mKeyboard.mMostCommonKeyWidth / 4;
|
final int keyQuarterWidth = mKeyboard.mMostCommonKeyWidth / 4;
|
||||||
mKeyQuarterWidthSquared = keyQuarterWidth * keyQuarterWidth;
|
mKeyQuarterWidthSquared = keyQuarterWidth * keyQuarterWidth;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ import android.content.res.TypedArray;
|
||||||
import android.content.res.XmlResourceParser;
|
import android.content.res.XmlResourceParser;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.android.inputmethod.keyboard.internal.KeyboardParser.ParseException;
|
import com.android.inputmethod.keyboard.internal.KeyboardBuilder.ParseException;
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -214,7 +214,7 @@ public class KeyStyles {
|
||||||
XmlResourceParser parser) {
|
XmlResourceParser parser) {
|
||||||
final String styleName = keyStyleAttr.getString(R.styleable.Keyboard_KeyStyle_styleName);
|
final String styleName = keyStyleAttr.getString(R.styleable.Keyboard_KeyStyle_styleName);
|
||||||
if (DEBUG) Log.d(TAG, String.format("<%s styleName=%s />",
|
if (DEBUG) Log.d(TAG, String.format("<%s styleName=%s />",
|
||||||
KeyboardParser.TAG_KEY_STYLE, styleName));
|
KeyboardBuilder.TAG_KEY_STYLE, styleName));
|
||||||
if (mStyles.containsKey(styleName))
|
if (mStyles.containsKey(styleName))
|
||||||
throw new ParseException("duplicate key style declared: " + styleName, parser);
|
throw new ParseException("duplicate key style declared: " + styleName, parser);
|
||||||
|
|
||||||
|
|
|
@ -37,12 +37,11 @@ import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parser for BaseKeyboard.
|
* Keyboard Building helper.
|
||||||
*
|
*
|
||||||
* This class parses Keyboard XML file and fill out keys in Keyboard.
|
* This class parses Keyboard XML file and eventually build a Keyboard.
|
||||||
* The Keyboard XML file looks like:
|
* The Keyboard XML file looks like:
|
||||||
* <pre>
|
* <pre>
|
||||||
* >!-- xml/keyboard.xml --<
|
* >!-- xml/keyboard.xml --<
|
||||||
|
@ -108,8 +107,8 @@ import java.util.List;
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class KeyboardParser<KP extends KeyboardParams> {
|
public class KeyboardBuilder<KP extends KeyboardParams> {
|
||||||
private static final String TAG = KeyboardParser.class.getSimpleName();
|
private static final String TAG = KeyboardBuilder.class.getSimpleName();
|
||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = false;
|
||||||
|
|
||||||
// Keyboard XML Tags
|
// Keyboard XML Tags
|
||||||
|
@ -136,7 +135,7 @@ public class KeyboardParser<KP extends KeyboardParams> {
|
||||||
private Key mRightEdgeKey = null;
|
private Key mRightEdgeKey = null;
|
||||||
private final KeyStyles mKeyStyles = new KeyStyles();
|
private final KeyStyles mKeyStyles = new KeyStyles();
|
||||||
|
|
||||||
public KeyboardParser(Context context, KP params) {
|
public KeyboardBuilder(Context context, KP params) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
final Resources res = context.getResources();
|
final Resources res = context.getResources();
|
||||||
mResources = res;
|
mResources = res;
|
||||||
|
@ -150,7 +149,7 @@ public class KeyboardParser<KP extends KeyboardParams> {
|
||||||
mParams.GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height);
|
mParams.GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeyboardParser<KP> load(KeyboardId id) {
|
public KeyboardBuilder<KP> load(KeyboardId id) {
|
||||||
mParams.mId = id;
|
mParams.mId = id;
|
||||||
try {
|
try {
|
||||||
parseKeyboard(id.getXmlId());
|
parseKeyboard(id.getXmlId());
|
||||||
|
@ -253,10 +252,12 @@ public class KeyboardParser<KP extends KeyboardParams> {
|
||||||
mParams.mVerticalGap = getDimensionOrFraction(keyboardAttr,
|
mParams.mVerticalGap = getDimensionOrFraction(keyboardAttr,
|
||||||
R.styleable.Keyboard_verticalGap, height, 0);
|
R.styleable.Keyboard_verticalGap, height, 0);
|
||||||
|
|
||||||
mParams.mIsRtlKeyboard = keyboardAttr.getBoolean(R.styleable.Keyboard_isRtlKeyboard, false);
|
mParams.mIsRtlKeyboard = keyboardAttr.getBoolean(
|
||||||
|
R.styleable.Keyboard_isRtlKeyboard, false);
|
||||||
mParams.mPopupKeyboardResId = keyboardAttr.getResourceId(
|
mParams.mPopupKeyboardResId = keyboardAttr.getResourceId(
|
||||||
R.styleable.Keyboard_popupKeyboardTemplate, 0);
|
R.styleable.Keyboard_popupKeyboardTemplate, 0);
|
||||||
mParams.mMaxPopupColumn = keyAttr.getInt(R.styleable.Keyboard_Key_maxPopupKeyboardColumn, 5);
|
mParams.mMaxPopupColumn = keyAttr.getInt(
|
||||||
|
R.styleable.Keyboard_Key_maxPopupKeyboardColumn, 5);
|
||||||
|
|
||||||
mParams.mIconsSet.loadIcons(keyboardAttr);
|
mParams.mIconsSet.loadIcons(keyboardAttr);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -389,7 +390,7 @@ public class KeyboardParser<KP extends KeyboardParams> {
|
||||||
|
|
||||||
final TypedArray keyAttr = mResources.obtainAttributes(Xml.asAttributeSet(parser),
|
final TypedArray keyAttr = mResources.obtainAttributes(Xml.asAttributeSet(parser),
|
||||||
R.styleable.Keyboard_Key);
|
R.styleable.Keyboard_Key);
|
||||||
int keyXPos = KeyboardParser.getDimensionOrFraction(keyAttr,
|
int keyXPos = KeyboardBuilder.getDimensionOrFraction(keyAttr,
|
||||||
R.styleable.Keyboard_Key_keyXPos, keyboardWidth, mCurrentX);
|
R.styleable.Keyboard_Key_keyXPos, keyboardWidth, mCurrentX);
|
||||||
if (keyXPos < 0) {
|
if (keyXPos < 0) {
|
||||||
// If keyXPos is negative, the actual x-coordinate will be display_width + keyXPos.
|
// If keyXPos is negative, the actual x-coordinate will be display_width + keyXPos.
|
|
@ -26,21 +26,21 @@ import com.android.inputmethod.keyboard.MiniKeyboard;
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
|
|
||||||
public class MiniKeyboardBuilder extends
|
public class MiniKeyboardBuilder extends
|
||||||
KeyboardParser<MiniKeyboardBuilder.MiniKeyboardLayoutParams> {
|
KeyboardBuilder<MiniKeyboardBuilder.MiniKeyboardParams> {
|
||||||
private final CharSequence[] mPopupCharacters;
|
private final CharSequence[] mPopupCharacters;
|
||||||
|
|
||||||
public static class MiniKeyboardLayoutParams extends KeyboardParams {
|
public static class MiniKeyboardParams extends KeyboardParams {
|
||||||
/* package */ int mTopRowAdjustment;
|
/* package */ int mTopRowAdjustment;
|
||||||
public int mNumRows;
|
public int mNumRows;
|
||||||
public int mNumColumns;
|
public int mNumColumns;
|
||||||
public int mLeftKeys;
|
public int mLeftKeys;
|
||||||
public int mRightKeys; // includes default key.
|
public int mRightKeys; // includes default key.
|
||||||
|
|
||||||
public MiniKeyboardLayoutParams() {
|
public MiniKeyboardParams() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* package for test */ MiniKeyboardLayoutParams(int numKeys, int maxColumns, int keyWidth,
|
/* package for test */ MiniKeyboardParams(int numKeys, int maxColumns, int keyWidth,
|
||||||
int rowHeight, int coordXInParent, int parentKeyboardWidth) {
|
int rowHeight, int coordXInParent, int parentKeyboardWidth) {
|
||||||
super();
|
super();
|
||||||
setParameters(
|
setParameters(
|
||||||
|
@ -194,7 +194,7 @@ public class MiniKeyboardBuilder extends
|
||||||
|
|
||||||
public MiniKeyboardBuilder(KeyboardView view, int xmlId, Key parentKey,
|
public MiniKeyboardBuilder(KeyboardView view, int xmlId, Key parentKey,
|
||||||
Keyboard parentKeyboard) {
|
Keyboard parentKeyboard) {
|
||||||
super(view.getContext(), new MiniKeyboardLayoutParams());
|
super(view.getContext(), new MiniKeyboardParams());
|
||||||
load(parentKeyboard.mId.cloneWithNewXml(mResources.getResourceEntryName(xmlId), xmlId));
|
load(parentKeyboard.mId.cloneWithNewXml(mResources.getResourceEntryName(xmlId), xmlId));
|
||||||
|
|
||||||
// HACK: Current mini keyboard design totally relies on the 9-patch padding about horizontal
|
// HACK: Current mini keyboard design totally relies on the 9-patch padding about horizontal
|
||||||
|
@ -246,7 +246,7 @@ public class MiniKeyboardBuilder extends
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MiniKeyboard build() {
|
public MiniKeyboard build() {
|
||||||
final MiniKeyboardLayoutParams params = mParams;
|
final MiniKeyboardParams params = mParams;
|
||||||
for (int n = 0; n < mPopupCharacters.length; n++) {
|
for (int n = 0; n < mPopupCharacters.length; n++) {
|
||||||
final CharSequence label = mPopupCharacters[n];
|
final CharSequence label = mPopupCharacters[n];
|
||||||
final int row = n / params.mNumColumns;
|
final int row = n / params.mNumColumns;
|
||||||
|
|
|
@ -40,9 +40,9 @@ public class Row {
|
||||||
final int keyboardHeight = params.mHeight;
|
final int keyboardHeight = params.mHeight;
|
||||||
TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
|
TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
|
||||||
R.styleable.Keyboard);
|
R.styleable.Keyboard);
|
||||||
mDefaultKeyWidth = KeyboardParser.getDimensionOrFraction(a,
|
mDefaultKeyWidth = KeyboardBuilder.getDimensionOrFraction(a,
|
||||||
R.styleable.Keyboard_keyWidth, keyboardWidth, params.mDefaultKeyWidth);
|
R.styleable.Keyboard_keyWidth, keyboardWidth, params.mDefaultKeyWidth);
|
||||||
mRowHeight = KeyboardParser.getDimensionOrFraction(a,
|
mRowHeight = KeyboardBuilder.getDimensionOrFraction(a,
|
||||||
R.styleable.Keyboard_rowHeight, keyboardHeight, params.mDefaultRowHeight);
|
R.styleable.Keyboard_rowHeight, keyboardHeight, params.mDefaultRowHeight);
|
||||||
a.recycle();
|
a.recycle();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
package com.android.inputmethod.keyboard.internal;
|
package com.android.inputmethod.keyboard.internal;
|
||||||
|
|
||||||
import com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder.MiniKeyboardLayoutParams;
|
import com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder.MiniKeyboardParams;
|
||||||
|
|
||||||
import android.test.AndroidTestCase;
|
import android.test.AndroidTestCase;
|
||||||
|
|
||||||
|
@ -41,9 +41,9 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testLayoutError() {
|
public void testLayoutError() {
|
||||||
MiniKeyboardLayoutParams params = null;
|
MiniKeyboardParams params = null;
|
||||||
try {
|
try {
|
||||||
params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS + 1, WIDTH, HEIGHT, WIDTH * 2,
|
params = new MiniKeyboardParams(10, MAX_COLUMNS + 1, WIDTH, HEIGHT, WIDTH * 2,
|
||||||
WIDTH * MAX_COLUMNS);
|
WIDTH * MAX_COLUMNS);
|
||||||
fail("Should throw IllegalArgumentException");
|
fail("Should throw IllegalArgumentException");
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
|
@ -58,7 +58,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [1]
|
// [1]
|
||||||
public void testLayout1KeyM0() {
|
public void testLayout1KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("1 key M0 columns", 1, params.mNumColumns);
|
assertEquals("1 key M0 columns", 1, params.mNumColumns);
|
||||||
assertEquals("1 key M0 rows", 1, params.mNumRows);
|
assertEquals("1 key M0 rows", 1, params.mNumRows);
|
||||||
|
@ -71,7 +71,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |[1]
|
// |[1]
|
||||||
public void testLayout1KeyL0() {
|
public void testLayout1KeyL0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
||||||
assertEquals("1 key L0 columns", 1, params.mNumColumns);
|
assertEquals("1 key L0 columns", 1, params.mNumColumns);
|
||||||
assertEquals("1 key L0 rows", 1, params.mNumRows);
|
assertEquals("1 key L0 rows", 1, params.mNumRows);
|
||||||
|
@ -84,7 +84,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |___ [1]
|
// |___ [1]
|
||||||
public void testLayout1KeyL1() {
|
public void testLayout1KeyL1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
||||||
assertEquals("1 key L1 columns", 1, params.mNumColumns);
|
assertEquals("1 key L1 columns", 1, params.mNumColumns);
|
||||||
assertEquals("1 key L1 rows", 1, params.mNumRows);
|
assertEquals("1 key L1 rows", 1, params.mNumRows);
|
||||||
|
@ -97,7 +97,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |___ ___ [1]
|
// |___ ___ [1]
|
||||||
public void testLayout1KeyL2() {
|
public void testLayout1KeyL2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
||||||
assertEquals("1 key L2 columns", 1, params.mNumColumns);
|
assertEquals("1 key L2 columns", 1, params.mNumColumns);
|
||||||
assertEquals("1 key L2 rows", 1, params.mNumRows);
|
assertEquals("1 key L2 rows", 1, params.mNumRows);
|
||||||
|
@ -110,7 +110,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [1]|
|
// [1]|
|
||||||
public void testLayout1KeyR0() {
|
public void testLayout1KeyR0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
||||||
assertEquals("1 key R0 columns", 1, params.mNumColumns);
|
assertEquals("1 key R0 columns", 1, params.mNumColumns);
|
||||||
assertEquals("1 key R0 rows", 1, params.mNumRows);
|
assertEquals("1 key R0 rows", 1, params.mNumRows);
|
||||||
|
@ -123,7 +123,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [1] ___|
|
// [1] ___|
|
||||||
public void testLayout1KeyR1() {
|
public void testLayout1KeyR1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
||||||
assertEquals("1 key R1 columns", 1, params.mNumColumns);
|
assertEquals("1 key R1 columns", 1, params.mNumColumns);
|
||||||
assertEquals("1 key R1 rows", 1, params.mNumRows);
|
assertEquals("1 key R1 rows", 1, params.mNumRows);
|
||||||
|
@ -136,7 +136,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [1] ___ ___|
|
// [1] ___ ___|
|
||||||
public void testLayout1KeyR2() {
|
public void testLayout1KeyR2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
||||||
assertEquals("1 key R2 columns", 1, params.mNumColumns);
|
assertEquals("1 key R2 columns", 1, params.mNumColumns);
|
||||||
assertEquals("1 key R2 rows", 1, params.mNumRows);
|
assertEquals("1 key R2 rows", 1, params.mNumRows);
|
||||||
|
@ -149,7 +149,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [1] [2]
|
// [1] [2]
|
||||||
public void testLayout2KeyM0() {
|
public void testLayout2KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("2 key M0 columns", 2, params.mNumColumns);
|
assertEquals("2 key M0 columns", 2, params.mNumColumns);
|
||||||
assertEquals("2 key M0 rows", 1, params.mNumRows);
|
assertEquals("2 key M0 rows", 1, params.mNumRows);
|
||||||
|
@ -163,7 +163,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |[1] [2]
|
// |[1] [2]
|
||||||
public void testLayout2KeyL0() {
|
public void testLayout2KeyL0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
||||||
assertEquals("2 key L0 columns", 2, params.mNumColumns);
|
assertEquals("2 key L0 columns", 2, params.mNumColumns);
|
||||||
assertEquals("2 key L0 rows", 1, params.mNumRows);
|
assertEquals("2 key L0 rows", 1, params.mNumRows);
|
||||||
|
@ -177,7 +177,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |___ [1] [2]
|
// |___ [1] [2]
|
||||||
public void testLayout2KeyL1() {
|
public void testLayout2KeyL1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
||||||
assertEquals("2 key L1 columns", 2, params.mNumColumns);
|
assertEquals("2 key L1 columns", 2, params.mNumColumns);
|
||||||
assertEquals("2 key L1 rows", 1, params.mNumRows);
|
assertEquals("2 key L1 rows", 1, params.mNumRows);
|
||||||
|
@ -191,7 +191,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |___ ___ [1] [2]
|
// |___ ___ [1] [2]
|
||||||
public void testLayout2KeyL2() {
|
public void testLayout2KeyL2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
||||||
assertEquals("2 key L2 columns", 2, params.mNumColumns);
|
assertEquals("2 key L2 columns", 2, params.mNumColumns);
|
||||||
assertEquals("2 key L2 rows", 1, params.mNumRows);
|
assertEquals("2 key L2 rows", 1, params.mNumRows);
|
||||||
|
@ -205,7 +205,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [2] [1]|
|
// [2] [1]|
|
||||||
public void testLayout2KeyR0() {
|
public void testLayout2KeyR0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
||||||
assertEquals("2 key R0 columns", 2, params.mNumColumns);
|
assertEquals("2 key R0 columns", 2, params.mNumColumns);
|
||||||
assertEquals("2 key R0 rows", 1, params.mNumRows);
|
assertEquals("2 key R0 rows", 1, params.mNumRows);
|
||||||
|
@ -219,7 +219,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [2] [1] ___|
|
// [2] [1] ___|
|
||||||
public void testLayout2KeyR1() {
|
public void testLayout2KeyR1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
||||||
assertEquals("2 key R1 columns", 2, params.mNumColumns);
|
assertEquals("2 key R1 columns", 2, params.mNumColumns);
|
||||||
assertEquals("2 key R1 rows", 1, params.mNumRows);
|
assertEquals("2 key R1 rows", 1, params.mNumRows);
|
||||||
|
@ -233,7 +233,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [1] [2] ___ ___|
|
// [1] [2] ___ ___|
|
||||||
public void testLayout2KeyR2() {
|
public void testLayout2KeyR2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
||||||
assertEquals("2 key R2 columns", 2, params.mNumColumns);
|
assertEquals("2 key R2 columns", 2, params.mNumColumns);
|
||||||
assertEquals("2 key R2 rows", 1, params.mNumRows);
|
assertEquals("2 key R2 rows", 1, params.mNumRows);
|
||||||
|
@ -247,7 +247,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [3] [1] [2]
|
// [3] [1] [2]
|
||||||
public void testLayout3KeyM0() {
|
public void testLayout3KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("3 key columns", 3, params.mNumColumns);
|
assertEquals("3 key columns", 3, params.mNumColumns);
|
||||||
assertEquals("3 key rows", 1, params.mNumRows);
|
assertEquals("3 key rows", 1, params.mNumRows);
|
||||||
|
@ -262,7 +262,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |[1] [2] [3]
|
// |[1] [2] [3]
|
||||||
public void testLayout3KeyL0() {
|
public void testLayout3KeyL0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
||||||
assertEquals("3 key L0 columns", 3, params.mNumColumns);
|
assertEquals("3 key L0 columns", 3, params.mNumColumns);
|
||||||
assertEquals("3 key L0 rows", 1, params.mNumRows);
|
assertEquals("3 key L0 rows", 1, params.mNumRows);
|
||||||
|
@ -277,7 +277,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |___ [1] [2] [3]
|
// |___ [1] [2] [3]
|
||||||
public void testLayout3KeyL1() {
|
public void testLayout3KeyL1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
||||||
assertEquals("3 key L1 columns", 3, params.mNumColumns);
|
assertEquals("3 key L1 columns", 3, params.mNumColumns);
|
||||||
assertEquals("3 key L1 rows", 1, params.mNumRows);
|
assertEquals("3 key L1 rows", 1, params.mNumRows);
|
||||||
|
@ -292,7 +292,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |___ ___ [3] [1] [2]
|
// |___ ___ [3] [1] [2]
|
||||||
public void testLayout3KeyL2() {
|
public void testLayout3KeyL2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
||||||
assertEquals("3 key L2 columns", 3, params.mNumColumns);
|
assertEquals("3 key L2 columns", 3, params.mNumColumns);
|
||||||
assertEquals("3 key L2 rows", 1, params.mNumRows);
|
assertEquals("3 key L2 rows", 1, params.mNumRows);
|
||||||
|
@ -307,7 +307,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [3] [2] [1]|
|
// [3] [2] [1]|
|
||||||
public void testLayout3KeyR0() {
|
public void testLayout3KeyR0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
||||||
assertEquals("3 key R0 columns", 3, params.mNumColumns);
|
assertEquals("3 key R0 columns", 3, params.mNumColumns);
|
||||||
assertEquals("3 key R0 rows", 1, params.mNumRows);
|
assertEquals("3 key R0 rows", 1, params.mNumRows);
|
||||||
|
@ -322,7 +322,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [3] [2] [1] ___|
|
// [3] [2] [1] ___|
|
||||||
public void testLayout3KeyR1() {
|
public void testLayout3KeyR1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
||||||
assertEquals("3 key R1 columns", 3, params.mNumColumns);
|
assertEquals("3 key R1 columns", 3, params.mNumColumns);
|
||||||
assertEquals("3 key R1 rows", 1, params.mNumRows);
|
assertEquals("3 key R1 rows", 1, params.mNumRows);
|
||||||
|
@ -337,7 +337,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [3] [1] [2] ___ ___|
|
// [3] [1] [2] ___ ___|
|
||||||
public void testLayout3KeyR2() {
|
public void testLayout3KeyR2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
||||||
assertEquals("3 key R2 columns", 3, params.mNumColumns);
|
assertEquals("3 key R2 columns", 3, params.mNumColumns);
|
||||||
assertEquals("3 key R2 rows", 1, params.mNumRows);
|
assertEquals("3 key R2 rows", 1, params.mNumRows);
|
||||||
|
@ -352,7 +352,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [3] [1] [2] [4]
|
// [3] [1] [2] [4]
|
||||||
public void testLayout4KeyM0() {
|
public void testLayout4KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("4 key columns", 4, params.mNumColumns);
|
assertEquals("4 key columns", 4, params.mNumColumns);
|
||||||
assertEquals("4 key rows", 1, params.mNumRows);
|
assertEquals("4 key rows", 1, params.mNumRows);
|
||||||
|
@ -368,7 +368,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |[1] [2] [3] [4]
|
// |[1] [2] [3] [4]
|
||||||
public void testLayout4KeyL0() {
|
public void testLayout4KeyL0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
||||||
assertEquals("4 key L0 columns", 4, params.mNumColumns);
|
assertEquals("4 key L0 columns", 4, params.mNumColumns);
|
||||||
assertEquals("4 key L0 rows", 1, params.mNumRows);
|
assertEquals("4 key L0 rows", 1, params.mNumRows);
|
||||||
|
@ -384,7 +384,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |___ [1] [2] [3] [4]
|
// |___ [1] [2] [3] [4]
|
||||||
public void testLayout4KeyL1() {
|
public void testLayout4KeyL1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
||||||
assertEquals("4 key L1 columns", 4, params.mNumColumns);
|
assertEquals("4 key L1 columns", 4, params.mNumColumns);
|
||||||
assertEquals("4 key L1 rows", 1, params.mNumRows);
|
assertEquals("4 key L1 rows", 1, params.mNumRows);
|
||||||
|
@ -400,7 +400,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |___ ___ [3] [1] [2] [4]
|
// |___ ___ [3] [1] [2] [4]
|
||||||
public void testLayout4KeyL2() {
|
public void testLayout4KeyL2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
||||||
assertEquals("4 key L2 columns", 4, params.mNumColumns);
|
assertEquals("4 key L2 columns", 4, params.mNumColumns);
|
||||||
assertEquals("4 key L2 rows", 1, params.mNumRows);
|
assertEquals("4 key L2 rows", 1, params.mNumRows);
|
||||||
|
@ -416,7 +416,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [4] [3] [2] [1]|
|
// [4] [3] [2] [1]|
|
||||||
public void testLayout4KeyR0() {
|
public void testLayout4KeyR0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
||||||
assertEquals("4 key R0 columns", 4, params.mNumColumns);
|
assertEquals("4 key R0 columns", 4, params.mNumColumns);
|
||||||
assertEquals("4 key R0 rows", 1, params.mNumRows);
|
assertEquals("4 key R0 rows", 1, params.mNumRows);
|
||||||
|
@ -432,7 +432,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [4] [3] [2] [1] ___|
|
// [4] [3] [2] [1] ___|
|
||||||
public void testLayout4KeyR1() {
|
public void testLayout4KeyR1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
||||||
assertEquals("4 key R1 columns", 4, params.mNumColumns);
|
assertEquals("4 key R1 columns", 4, params.mNumColumns);
|
||||||
assertEquals("4 key R1 rows", 1, params.mNumRows);
|
assertEquals("4 key R1 rows", 1, params.mNumRows);
|
||||||
|
@ -448,7 +448,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [4] [3] [1] [2] ___ ___|
|
// [4] [3] [1] [2] ___ ___|
|
||||||
public void testLayout4KeyR2() {
|
public void testLayout4KeyR2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
||||||
assertEquals("4 key R2 columns", 4, params.mNumColumns);
|
assertEquals("4 key R2 columns", 4, params.mNumColumns);
|
||||||
assertEquals("4 key R2 rows", 1, params.mNumRows);
|
assertEquals("4 key R2 rows", 1, params.mNumRows);
|
||||||
|
@ -464,7 +464,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [5] [3] [1] [2] [4]
|
// [5] [3] [1] [2] [4]
|
||||||
public void testLayout5KeyM0() {
|
public void testLayout5KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("5 key columns", 5, params.mNumColumns);
|
assertEquals("5 key columns", 5, params.mNumColumns);
|
||||||
assertEquals("5 key rows", 1, params.mNumRows);
|
assertEquals("5 key rows", 1, params.mNumRows);
|
||||||
|
@ -481,7 +481,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |[1] [2] [3] [4] [5]
|
// |[1] [2] [3] [4] [5]
|
||||||
public void testLayout5KeyL0() {
|
public void testLayout5KeyL0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
||||||
assertEquals("5 key L0 columns", 5, params.mNumColumns);
|
assertEquals("5 key L0 columns", 5, params.mNumColumns);
|
||||||
assertEquals("5 key L0 rows", 1, params.mNumRows);
|
assertEquals("5 key L0 rows", 1, params.mNumRows);
|
||||||
|
@ -498,7 +498,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |___ [1] [2] [3] [4] [5]
|
// |___ [1] [2] [3] [4] [5]
|
||||||
public void testLayout5KeyL1() {
|
public void testLayout5KeyL1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
||||||
assertEquals("5 key L1 columns", 5, params.mNumColumns);
|
assertEquals("5 key L1 columns", 5, params.mNumColumns);
|
||||||
assertEquals("5 key L1 rows", 1, params.mNumRows);
|
assertEquals("5 key L1 rows", 1, params.mNumRows);
|
||||||
|
@ -515,7 +515,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// |___ ___ [3] [1] [2] [4] [5]
|
// |___ ___ [3] [1] [2] [4] [5]
|
||||||
public void testLayout5KeyL2() {
|
public void testLayout5KeyL2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
||||||
assertEquals("5 key L2 columns", 5, params.mNumColumns);
|
assertEquals("5 key L2 columns", 5, params.mNumColumns);
|
||||||
assertEquals("5 key L2 rows", 1, params.mNumRows);
|
assertEquals("5 key L2 rows", 1, params.mNumRows);
|
||||||
|
@ -532,7 +532,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [5] [4] [3] [2] [1]|
|
// [5] [4] [3] [2] [1]|
|
||||||
public void testLayout5KeyR0() {
|
public void testLayout5KeyR0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
||||||
assertEquals("5 key R0 columns", 5, params.mNumColumns);
|
assertEquals("5 key R0 columns", 5, params.mNumColumns);
|
||||||
assertEquals("5 key R0 rows", 1, params.mNumRows);
|
assertEquals("5 key R0 rows", 1, params.mNumRows);
|
||||||
|
@ -549,7 +549,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [5] [4] [3] [2] [1] ___|
|
// [5] [4] [3] [2] [1] ___|
|
||||||
public void testLayout5KeyR1() {
|
public void testLayout5KeyR1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
||||||
assertEquals("5 key R1 columns", 5, params.mNumColumns);
|
assertEquals("5 key R1 columns", 5, params.mNumColumns);
|
||||||
assertEquals("5 key R1 rows", 1, params.mNumRows);
|
assertEquals("5 key R1 rows", 1, params.mNumRows);
|
||||||
|
@ -566,7 +566,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [5] [4] [3] [1] [2] ___ ___|
|
// [5] [4] [3] [1] [2] ___ ___|
|
||||||
public void testLayout5KeyR2() {
|
public void testLayout5KeyR2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
||||||
assertEquals("5 key R2 columns", 5, params.mNumColumns);
|
assertEquals("5 key R2 columns", 5, params.mNumColumns);
|
||||||
assertEquals("5 key R2 rows", 1, params.mNumRows);
|
assertEquals("5 key R2 rows", 1, params.mNumRows);
|
||||||
|
@ -584,7 +584,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [6] [4] [5]
|
// [6] [4] [5]
|
||||||
// [3] [1] [2]
|
// [3] [1] [2]
|
||||||
public void testLayout6KeyM0() {
|
public void testLayout6KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("6 key columns", 3, params.mNumColumns);
|
assertEquals("6 key columns", 3, params.mNumColumns);
|
||||||
assertEquals("6 key rows", 2, params.mNumRows);
|
assertEquals("6 key rows", 2, params.mNumRows);
|
||||||
|
@ -603,7 +603,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |[4] [5] [6]
|
// |[4] [5] [6]
|
||||||
// |[1] [2] [3]
|
// |[1] [2] [3]
|
||||||
public void testLayout6KeyL0() {
|
public void testLayout6KeyL0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
||||||
assertEquals("6 key L0 columns", 3, params.mNumColumns);
|
assertEquals("6 key L0 columns", 3, params.mNumColumns);
|
||||||
assertEquals("6 key L0 rows", 2, params.mNumRows);
|
assertEquals("6 key L0 rows", 2, params.mNumRows);
|
||||||
|
@ -622,7 +622,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |___ [4] [5] [6]
|
// |___ [4] [5] [6]
|
||||||
// |___ [1] [2] [3]
|
// |___ [1] [2] [3]
|
||||||
public void testLayout6KeyL1() {
|
public void testLayout6KeyL1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
||||||
assertEquals("6 key L1 columns", 3, params.mNumColumns);
|
assertEquals("6 key L1 columns", 3, params.mNumColumns);
|
||||||
assertEquals("6 key L1 rows", 2, params.mNumRows);
|
assertEquals("6 key L1 rows", 2, params.mNumRows);
|
||||||
|
@ -641,7 +641,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |___ ___ [6] [4] [5]
|
// |___ ___ [6] [4] [5]
|
||||||
// |___ ___ [3] [1] [2]
|
// |___ ___ [3] [1] [2]
|
||||||
public void testLayout6KeyL2() {
|
public void testLayout6KeyL2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
||||||
assertEquals("6 key L2 columns", 3, params.mNumColumns);
|
assertEquals("6 key L2 columns", 3, params.mNumColumns);
|
||||||
assertEquals("6 key L2 rows", 2, params.mNumRows);
|
assertEquals("6 key L2 rows", 2, params.mNumRows);
|
||||||
|
@ -660,7 +660,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [6] [5] [4]|
|
// [6] [5] [4]|
|
||||||
// [3] [2] [1]|
|
// [3] [2] [1]|
|
||||||
public void testLayout6KeyR0() {
|
public void testLayout6KeyR0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
||||||
assertEquals("6 key R0 columns", 3, params.mNumColumns);
|
assertEquals("6 key R0 columns", 3, params.mNumColumns);
|
||||||
assertEquals("6 key R0 rows", 2, params.mNumRows);
|
assertEquals("6 key R0 rows", 2, params.mNumRows);
|
||||||
|
@ -679,7 +679,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [6] [5] [4] ___|
|
// [6] [5] [4] ___|
|
||||||
// [3] [2] [1] ___|
|
// [3] [2] [1] ___|
|
||||||
public void testLayout6KeyR1() {
|
public void testLayout6KeyR1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
||||||
assertEquals("6 key R1 columns", 3, params.mNumColumns);
|
assertEquals("6 key R1 columns", 3, params.mNumColumns);
|
||||||
assertEquals("6 key R1 rows", 2, params.mNumRows);
|
assertEquals("6 key R1 rows", 2, params.mNumRows);
|
||||||
|
@ -698,7 +698,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [6] [4] [5] ___ ___|
|
// [6] [4] [5] ___ ___|
|
||||||
// [3] [1] [2] ___ ___|
|
// [3] [1] [2] ___ ___|
|
||||||
public void testLayout6KeyR2() {
|
public void testLayout6KeyR2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
||||||
assertEquals("6 key R2 columns", 3, params.mNumColumns);
|
assertEquals("6 key R2 columns", 3, params.mNumColumns);
|
||||||
assertEquals("6 key R2 rows", 2, params.mNumRows);
|
assertEquals("6 key R2 rows", 2, params.mNumRows);
|
||||||
|
@ -717,7 +717,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [7] [5] [6]
|
// [7] [5] [6]
|
||||||
// [3] [1] [2] [4]
|
// [3] [1] [2] [4]
|
||||||
public void testLayout7KeyM0() {
|
public void testLayout7KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("7 key columns", 4, params.mNumColumns);
|
assertEquals("7 key columns", 4, params.mNumColumns);
|
||||||
assertEquals("7 key rows", 2, params.mNumRows);
|
assertEquals("7 key rows", 2, params.mNumRows);
|
||||||
|
@ -737,7 +737,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |[5] [6] [7]
|
// |[5] [6] [7]
|
||||||
// |[1] [2] [3] [4]
|
// |[1] [2] [3] [4]
|
||||||
public void testLayout7KeyL0() {
|
public void testLayout7KeyL0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
||||||
assertEquals("7 key L0 columns", 4, params.mNumColumns);
|
assertEquals("7 key L0 columns", 4, params.mNumColumns);
|
||||||
assertEquals("7 key L0 rows", 2, params.mNumRows);
|
assertEquals("7 key L0 rows", 2, params.mNumRows);
|
||||||
|
@ -757,7 +757,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |___ [5] [6] [7]
|
// |___ [5] [6] [7]
|
||||||
// |___ [1] [2] [3] [4]
|
// |___ [1] [2] [3] [4]
|
||||||
public void testLayout7KeyL1() {
|
public void testLayout7KeyL1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
||||||
assertEquals("7 key L1 columns", 4, params.mNumColumns);
|
assertEquals("7 key L1 columns", 4, params.mNumColumns);
|
||||||
assertEquals("7 key L1 rows", 2, params.mNumRows);
|
assertEquals("7 key L1 rows", 2, params.mNumRows);
|
||||||
|
@ -777,7 +777,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |___ ___ [7] [5] [6]
|
// |___ ___ [7] [5] [6]
|
||||||
// |___ ___ [3] [1] [2] [4]
|
// |___ ___ [3] [1] [2] [4]
|
||||||
public void testLayout7KeyL2() {
|
public void testLayout7KeyL2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
||||||
assertEquals("7 key L2 columns", 4, params.mNumColumns);
|
assertEquals("7 key L2 columns", 4, params.mNumColumns);
|
||||||
assertEquals("7 key L2 rows", 2, params.mNumRows);
|
assertEquals("7 key L2 rows", 2, params.mNumRows);
|
||||||
|
@ -797,7 +797,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [7] [6] [5]|
|
// [7] [6] [5]|
|
||||||
// [4] [3] [2] [1]|
|
// [4] [3] [2] [1]|
|
||||||
public void testLayout7KeyR0() {
|
public void testLayout7KeyR0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
||||||
assertEquals("7 key R0 columns", 4, params.mNumColumns);
|
assertEquals("7 key R0 columns", 4, params.mNumColumns);
|
||||||
assertEquals("7 key R0 rows", 2, params.mNumRows);
|
assertEquals("7 key R0 rows", 2, params.mNumRows);
|
||||||
|
@ -817,7 +817,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [7] [6] [5] ___|
|
// [7] [6] [5] ___|
|
||||||
// [4] [3] [2] [1] ___|
|
// [4] [3] [2] [1] ___|
|
||||||
public void testLayout7KeyR1() {
|
public void testLayout7KeyR1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
||||||
assertEquals("7 key R1 columns", 4, params.mNumColumns);
|
assertEquals("7 key R1 columns", 4, params.mNumColumns);
|
||||||
assertEquals("7 key R1 rows", 2, params.mNumRows);
|
assertEquals("7 key R1 rows", 2, params.mNumRows);
|
||||||
|
@ -837,7 +837,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [7] [5] [6] ___ ___|
|
// [7] [5] [6] ___ ___|
|
||||||
// [4] [3] [1] [2] ___ ___|
|
// [4] [3] [1] [2] ___ ___|
|
||||||
public void testLayout7KeyR2() {
|
public void testLayout7KeyR2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
||||||
assertEquals("7 key R2 columns", 4, params.mNumColumns);
|
assertEquals("7 key R2 columns", 4, params.mNumColumns);
|
||||||
assertEquals("7 key R2 rows", 2, params.mNumRows);
|
assertEquals("7 key R2 rows", 2, params.mNumRows);
|
||||||
|
@ -856,7 +856,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
|
|
||||||
// [7] [6] [5] [3] [1] [2] [4] ___|
|
// [7] [6] [5] [3] [1] [2] [4] ___|
|
||||||
public void testLayout7KeyR3Max7() {
|
public void testLayout7KeyR3Max7() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, 7, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(7, 7, WIDTH,
|
||||||
HEIGHT, XPOS_R3, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R3, KEYBOARD_WIDTH);
|
||||||
assertEquals("7 key R2 columns", 7, params.mNumColumns);
|
assertEquals("7 key R2 columns", 7, params.mNumColumns);
|
||||||
assertEquals("7 key R2 rows", 1, params.mNumRows);
|
assertEquals("7 key R2 rows", 1, params.mNumRows);
|
||||||
|
@ -876,7 +876,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [7] [5] [6] [8]
|
// [7] [5] [6] [8]
|
||||||
// [3] [1] [2] [4]
|
// [3] [1] [2] [4]
|
||||||
public void testLayout8KeyM0() {
|
public void testLayout8KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("8 key M0 columns", 4, params.mNumColumns);
|
assertEquals("8 key M0 columns", 4, params.mNumColumns);
|
||||||
assertEquals("8 key M0 rows", 2, params.mNumRows);
|
assertEquals("8 key M0 rows", 2, params.mNumRows);
|
||||||
|
@ -897,7 +897,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |[5] [6] [7] [8]
|
// |[5] [6] [7] [8]
|
||||||
// |[1] [2] [3] [4]
|
// |[1] [2] [3] [4]
|
||||||
public void testLayout8KeyL0() {
|
public void testLayout8KeyL0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
||||||
assertEquals("8 key L0 columns", 4, params.mNumColumns);
|
assertEquals("8 key L0 columns", 4, params.mNumColumns);
|
||||||
assertEquals("8 key L0 rows", 2, params.mNumRows);
|
assertEquals("8 key L0 rows", 2, params.mNumRows);
|
||||||
|
@ -918,7 +918,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |___ [5] [6] [7] [8]
|
// |___ [5] [6] [7] [8]
|
||||||
// |___ [1] [2] [3] [4]
|
// |___ [1] [2] [3] [4]
|
||||||
public void testLayout8KeyL1() {
|
public void testLayout8KeyL1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
||||||
assertEquals("8 key L1 columns", 4, params.mNumColumns);
|
assertEquals("8 key L1 columns", 4, params.mNumColumns);
|
||||||
assertEquals("8 key L1 rows", 2, params.mNumRows);
|
assertEquals("8 key L1 rows", 2, params.mNumRows);
|
||||||
|
@ -939,7 +939,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |___ ___ [7] [5] [6] [8]
|
// |___ ___ [7] [5] [6] [8]
|
||||||
// |___ ___ [3] [1] [2] [4]
|
// |___ ___ [3] [1] [2] [4]
|
||||||
public void testLayout8KeyL2() {
|
public void testLayout8KeyL2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
||||||
assertEquals("8 key L2 columns", 4, params.mNumColumns);
|
assertEquals("8 key L2 columns", 4, params.mNumColumns);
|
||||||
assertEquals("8 key L2 rows", 2, params.mNumRows);
|
assertEquals("8 key L2 rows", 2, params.mNumRows);
|
||||||
|
@ -960,7 +960,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [8] [7] [6] [5]|
|
// [8] [7] [6] [5]|
|
||||||
// [4] [3] [2] [1]|
|
// [4] [3] [2] [1]|
|
||||||
public void testLayout8KeyR0() {
|
public void testLayout8KeyR0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
||||||
assertEquals("8 key R0 columns", 4, params.mNumColumns);
|
assertEquals("8 key R0 columns", 4, params.mNumColumns);
|
||||||
assertEquals("8 key R0 rows", 2, params.mNumRows);
|
assertEquals("8 key R0 rows", 2, params.mNumRows);
|
||||||
|
@ -981,7 +981,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [8] [7] [6] [5] ___|
|
// [8] [7] [6] [5] ___|
|
||||||
// [4] [3] [2] [1] ___|
|
// [4] [3] [2] [1] ___|
|
||||||
public void testLayout8KeyR1() {
|
public void testLayout8KeyR1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
||||||
assertEquals("8 key R1 columns", 4, params.mNumColumns);
|
assertEquals("8 key R1 columns", 4, params.mNumColumns);
|
||||||
assertEquals("8 key R1 rows", 2, params.mNumRows);
|
assertEquals("8 key R1 rows", 2, params.mNumRows);
|
||||||
|
@ -1002,7 +1002,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [8] [7] [5] [6] ___ ___|
|
// [8] [7] [5] [6] ___ ___|
|
||||||
// [4] [3] [1] [2] ___ ___|
|
// [4] [3] [1] [2] ___ ___|
|
||||||
public void testLayout8KeyR2() {
|
public void testLayout8KeyR2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
||||||
assertEquals("8 key R2 columns", 4, params.mNumColumns);
|
assertEquals("8 key R2 columns", 4, params.mNumColumns);
|
||||||
assertEquals("8 key R2 rows", 2, params.mNumRows);
|
assertEquals("8 key R2 rows", 2, params.mNumRows);
|
||||||
|
@ -1023,7 +1023,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [8] [6] [7] [9]
|
// [8] [6] [7] [9]
|
||||||
// [5] [3] [1] [2] [4]
|
// [5] [3] [1] [2] [4]
|
||||||
public void testLayout9KeyM0() {
|
public void testLayout9KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("9 key M0 columns", 5, params.mNumColumns);
|
assertEquals("9 key M0 columns", 5, params.mNumColumns);
|
||||||
assertEquals("9 key M0 rows", 2, params.mNumRows);
|
assertEquals("9 key M0 rows", 2, params.mNumRows);
|
||||||
|
@ -1045,7 +1045,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |[6] [7] [8] [9]
|
// |[6] [7] [8] [9]
|
||||||
// |[1] [2] [3] [4] [5]
|
// |[1] [2] [3] [4] [5]
|
||||||
public void testLayout9KeyL0() {
|
public void testLayout9KeyL0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
||||||
assertEquals("9 key L0 columns", 5, params.mNumColumns);
|
assertEquals("9 key L0 columns", 5, params.mNumColumns);
|
||||||
assertEquals("9 key L0 rows", 2, params.mNumRows);
|
assertEquals("9 key L0 rows", 2, params.mNumRows);
|
||||||
|
@ -1067,7 +1067,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |___ [6] [7] [8] [9]
|
// |___ [6] [7] [8] [9]
|
||||||
// |___ [1] [2] [3] [4] [5]
|
// |___ [1] [2] [3] [4] [5]
|
||||||
public void testLayout9KeyL1() {
|
public void testLayout9KeyL1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
||||||
assertEquals("9 key L1 columns", 5, params.mNumColumns);
|
assertEquals("9 key L1 columns", 5, params.mNumColumns);
|
||||||
assertEquals("9 key L1 rows", 2, params.mNumRows);
|
assertEquals("9 key L1 rows", 2, params.mNumRows);
|
||||||
|
@ -1089,7 +1089,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |___ ___ [8] [6] [7] [9]
|
// |___ ___ [8] [6] [7] [9]
|
||||||
// |___ ___ [3] [1] [2] [4] [5]
|
// |___ ___ [3] [1] [2] [4] [5]
|
||||||
public void testLayout9KeyL2() {
|
public void testLayout9KeyL2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
||||||
assertEquals("9 key L2 columns", 5, params.mNumColumns);
|
assertEquals("9 key L2 columns", 5, params.mNumColumns);
|
||||||
assertEquals("9 key L2 rows", 2, params.mNumRows);
|
assertEquals("9 key L2 rows", 2, params.mNumRows);
|
||||||
|
@ -1111,7 +1111,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [9] [8] [7] [6]|
|
// [9] [8] [7] [6]|
|
||||||
// [5] [4] [3] [2] [1]|
|
// [5] [4] [3] [2] [1]|
|
||||||
public void testLayout9KeyR0() {
|
public void testLayout9KeyR0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
||||||
assertEquals("9 key R0 columns", 5, params.mNumColumns);
|
assertEquals("9 key R0 columns", 5, params.mNumColumns);
|
||||||
assertEquals("9 key R0 rows", 2, params.mNumRows);
|
assertEquals("9 key R0 rows", 2, params.mNumRows);
|
||||||
|
@ -1133,7 +1133,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [9] [8] [7] [6] ___|
|
// [9] [8] [7] [6] ___|
|
||||||
// [5] [4] [3] [2] [1] ___|
|
// [5] [4] [3] [2] [1] ___|
|
||||||
public void testLayout9KeyR1() {
|
public void testLayout9KeyR1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
||||||
assertEquals("9 key R1 columns", 5, params.mNumColumns);
|
assertEquals("9 key R1 columns", 5, params.mNumColumns);
|
||||||
assertEquals("9 key R1 rows", 2, params.mNumRows);
|
assertEquals("9 key R1 rows", 2, params.mNumRows);
|
||||||
|
@ -1155,7 +1155,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [9] [8] [6] [7] ___ ___|
|
// [9] [8] [6] [7] ___ ___|
|
||||||
// [5] [4] [3] [1] [2] ___ ___|
|
// [5] [4] [3] [1] [2] ___ ___|
|
||||||
public void testLayout9KeyR2() {
|
public void testLayout9KeyR2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
||||||
assertEquals("9 key R2 columns", 5, params.mNumColumns);
|
assertEquals("9 key R2 columns", 5, params.mNumColumns);
|
||||||
assertEquals("9 key R2 rows", 2, params.mNumRows);
|
assertEquals("9 key R2 rows", 2, params.mNumRows);
|
||||||
|
@ -1177,7 +1177,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [A] [8] [6] [7] [9]
|
// [A] [8] [6] [7] [9]
|
||||||
// [5] [3] [1] [2] [4]
|
// [5] [3] [1] [2] [4]
|
||||||
public void testLayout10KeyM0() {
|
public void testLayout10KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("10 key M0 columns", 5, params.mNumColumns);
|
assertEquals("10 key M0 columns", 5, params.mNumColumns);
|
||||||
assertEquals("10 key M0 rows", 2, params.mNumRows);
|
assertEquals("10 key M0 rows", 2, params.mNumRows);
|
||||||
|
@ -1200,7 +1200,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |[6] [7] [8] [9] [A]
|
// |[6] [7] [8] [9] [A]
|
||||||
// |[1] [2] [3] [4] [5]
|
// |[1] [2] [3] [4] [5]
|
||||||
public void testLayout10KeyL0() {
|
public void testLayout10KeyL0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
|
||||||
assertEquals("10 key L0 columns", 5, params.mNumColumns);
|
assertEquals("10 key L0 columns", 5, params.mNumColumns);
|
||||||
assertEquals("10 key L0 rows", 2, params.mNumRows);
|
assertEquals("10 key L0 rows", 2, params.mNumRows);
|
||||||
|
@ -1223,7 +1223,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |___ [6] [7] [8] [9] [A]
|
// |___ [6] [7] [8] [9] [A]
|
||||||
// |___ [1] [2] [3] [4] [5]
|
// |___ [1] [2] [3] [4] [5]
|
||||||
public void testLayout10KeyL1() {
|
public void testLayout10KeyL1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
|
||||||
assertEquals("10 key L1 columns", 5, params.mNumColumns);
|
assertEquals("10 key L1 columns", 5, params.mNumColumns);
|
||||||
assertEquals("10 key L1 rows", 2, params.mNumRows);
|
assertEquals("10 key L1 rows", 2, params.mNumRows);
|
||||||
|
@ -1246,7 +1246,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// |___ ___ [8] [6] [7] [9] [A]
|
// |___ ___ [8] [6] [7] [9] [A]
|
||||||
// |___ ___ [3] [1] [2] [4] [5]
|
// |___ ___ [3] [1] [2] [4] [5]
|
||||||
public void testLayout10KeyL2() {
|
public void testLayout10KeyL2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
|
||||||
assertEquals("10 key L2 columns", 5, params.mNumColumns);
|
assertEquals("10 key L2 columns", 5, params.mNumColumns);
|
||||||
assertEquals("10 key L2 rows", 2, params.mNumRows);
|
assertEquals("10 key L2 rows", 2, params.mNumRows);
|
||||||
|
@ -1269,7 +1269,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [A] [9] [8] [7] [6]|
|
// [A] [9] [8] [7] [6]|
|
||||||
// [5] [4] [3] [2] [1]|
|
// [5] [4] [3] [2] [1]|
|
||||||
public void testLayout10KeyR0() {
|
public void testLayout10KeyR0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
|
||||||
assertEquals("10 key R0 columns", 5, params.mNumColumns);
|
assertEquals("10 key R0 columns", 5, params.mNumColumns);
|
||||||
assertEquals("10 key R0 rows", 2, params.mNumRows);
|
assertEquals("10 key R0 rows", 2, params.mNumRows);
|
||||||
|
@ -1292,7 +1292,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [A] [9] [8] [7] [6] ___|
|
// [A] [9] [8] [7] [6] ___|
|
||||||
// [5] [4] [3] [2] [1] ___|
|
// [5] [4] [3] [2] [1] ___|
|
||||||
public void testLayout10KeyR1() {
|
public void testLayout10KeyR1() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
|
||||||
assertEquals("10 key R1 columns", 5, params.mNumColumns);
|
assertEquals("10 key R1 columns", 5, params.mNumColumns);
|
||||||
assertEquals("10 key R1 rows", 2, params.mNumRows);
|
assertEquals("10 key R1 rows", 2, params.mNumRows);
|
||||||
|
@ -1315,7 +1315,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [A] [9] [8] [6] [7] ___ ___|
|
// [A] [9] [8] [6] [7] ___ ___|
|
||||||
// [5] [4] [3] [1] [2] ___ ___|
|
// [5] [4] [3] [1] [2] ___ ___|
|
||||||
public void testLayout10KeyR2() {
|
public void testLayout10KeyR2() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
|
||||||
assertEquals("10 key R2 columns", 5, params.mNumColumns);
|
assertEquals("10 key R2 columns", 5, params.mNumColumns);
|
||||||
assertEquals("10 key R2 rows", 2, params.mNumRows);
|
assertEquals("10 key R2 rows", 2, params.mNumRows);
|
||||||
|
@ -1339,7 +1339,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [7] [5] [6] [8]
|
// [7] [5] [6] [8]
|
||||||
// [3] [1] [2] [4]
|
// [3] [1] [2] [4]
|
||||||
public void testLayout11KeyM0() {
|
public void testLayout11KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(11, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(11, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("11 key M0 columns", 4, params.mNumColumns);
|
assertEquals("11 key M0 columns", 4, params.mNumColumns);
|
||||||
assertEquals("11 key M0 rows", 3, params.mNumRows);
|
assertEquals("11 key M0 rows", 3, params.mNumRows);
|
||||||
|
@ -1364,7 +1364,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [7] [5] [6] [8]
|
// [7] [5] [6] [8]
|
||||||
// [3] [1] [2] [4]
|
// [3] [1] [2] [4]
|
||||||
public void testLayout12KeyM0() {
|
public void testLayout12KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(12, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(12, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("12 key M0 columns", 4, params.mNumColumns);
|
assertEquals("12 key M0 columns", 4, params.mNumColumns);
|
||||||
assertEquals("12 key M0 rows", 3, params.mNumRows);
|
assertEquals("12 key M0 rows", 3, params.mNumRows);
|
||||||
|
@ -1391,7 +1391,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase {
|
||||||
// [A] [8] [6] [7] [9]
|
// [A] [8] [6] [7] [9]
|
||||||
// [5] [3] [1] [2] [4]
|
// [5] [3] [1] [2] [4]
|
||||||
public void testLayout13KeyM0() {
|
public void testLayout13KeyM0() {
|
||||||
MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(13, MAX_COLUMNS, WIDTH,
|
MiniKeyboardParams params = new MiniKeyboardParams(13, MAX_COLUMNS, WIDTH,
|
||||||
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
|
||||||
assertEquals("13 key M0 columns", 5, params.mNumColumns);
|
assertEquals("13 key M0 columns", 5, params.mNumColumns);
|
||||||
assertEquals("13 key M0 rows", 3, params.mNumRows);
|
assertEquals("13 key M0 rows", 3, params.mNumRows);
|
||||||
|
|
|
@ -16,16 +16,15 @@
|
||||||
|
|
||||||
package com.android.inputmethod.latin;
|
package com.android.inputmethod.latin;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.android.inputmethod.keyboard.Key;
|
import com.android.inputmethod.keyboard.Key;
|
||||||
import com.android.inputmethod.keyboard.KeyDetector;
|
import com.android.inputmethod.keyboard.KeyDetector;
|
||||||
import com.android.inputmethod.keyboard.KeyboardId;
|
import com.android.inputmethod.keyboard.KeyboardId;
|
||||||
import com.android.inputmethod.keyboard.LatinKeyboard;
|
import com.android.inputmethod.keyboard.LatinKeyboard;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class SuggestHelper {
|
public class SuggestHelper {
|
||||||
protected final Suggest mSuggest;
|
protected final Suggest mSuggest;
|
||||||
|
@ -66,8 +65,7 @@ public class SuggestHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addKeyInfo(WordComposer word, char c) {
|
private void addKeyInfo(WordComposer word, char c) {
|
||||||
final List<Key> keys = mKeyboard.getKeys();
|
for (final Key key : mKeyboard.mKeys) {
|
||||||
for (final Key key : keys) {
|
|
||||||
if (key.mCode == c) {
|
if (key.mCode == c) {
|
||||||
final int x = key.mX + key.mWidth / 2;
|
final int x = key.mX + key.mWidth / 2;
|
||||||
final int y = key.mY + key.mHeight / 2;
|
final int y = key.mY + key.mHeight / 2;
|
||||||
|
|
Loading…
Reference in a new issue