diff --git a/java/proguard.flags b/java/proguard.flags index 44416ecba..395950033 100644 --- a/java/proguard.flags +++ b/java/proguard.flags @@ -31,6 +31,6 @@ *; } --keep class com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder$MiniKeyboardLayoutParams { +-keep class com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder$MiniKeyboardParams { (...); } diff --git a/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java b/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java index cf6cd0f5e..e75559e62 100644 --- a/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java +++ b/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java @@ -16,7 +16,7 @@ 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.R; import com.android.inputmethod.latin.Settings; @@ -162,7 +162,7 @@ public class InputLanguageSelection extends PreferenceActivity { try { final String localeStr = locale.toString(); - final String[] layoutCountryCodes = KeyboardParser.parseKeyboardLocale( + final String[] layoutCountryCodes = KeyboardBuilder.parseKeyboardLocale( this, R.xml.kbd_qwerty).split(",", -1); if (!TextUtils.isEmpty(localeStr) && layoutCountryCodes.length > 0) { for (String s : layoutCountryCodes) { diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index 8bc7e43b4..57a354ecf 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -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.KeyboardIconsSet; import com.android.inputmethod.keyboard.internal.KeyboardParams; -import com.android.inputmethod.keyboard.internal.KeyboardParser; -import com.android.inputmethod.keyboard.internal.KeyboardParser.ParseException; +import com.android.inputmethod.keyboard.internal.KeyboardBuilder; +import com.android.inputmethod.keyboard.internal.KeyboardBuilder.ParseException; import com.android.inputmethod.keyboard.internal.PopupCharactersParser; import com.android.inputmethod.keyboard.internal.Row; import com.android.inputmethod.latin.R; @@ -235,14 +235,14 @@ public class Key { R.styleable.Keyboard); int keyWidth; try { - mHeight = KeyboardParser.getDimensionOrFraction(keyboardAttr, + mHeight = KeyboardBuilder.getDimensionOrFraction(keyboardAttr, R.styleable.Keyboard_rowHeight, params.mHeight, row.mRowHeight) - params.mVerticalGap; - mHorizontalGap = KeyboardParser.getDimensionOrFraction(keyboardAttr, + mHorizontalGap = KeyboardBuilder.getDimensionOrFraction(keyboardAttr, R.styleable.Keyboard_horizontalGap, params.mWidth, params.mHorizontalGap); mVerticalGap = params.mVerticalGap; - keyWidth = KeyboardParser.getDimensionOrFraction(keyboardAttr, + keyWidth = KeyboardBuilder.getDimensionOrFraction(keyboardAttr, R.styleable.Keyboard_keyWidth, params.mWidth, row.mDefaultKeyWidth); } finally { @@ -263,7 +263,7 @@ public class Key { } final int keyboardWidth = params.mOccupiedWidth; - int keyXPos = KeyboardParser.getDimensionOrFraction(keyAttr, + int keyXPos = KeyboardBuilder.getDimensionOrFraction(keyAttr, R.styleable.Keyboard_Key_keyXPos, keyboardWidth, x); if (keyXPos < 0) { // If keyXPos is negative, the actual x-coordinate will be k + keyXPos. @@ -317,9 +317,9 @@ public class Key { mEdgeFlags = 0; final KeyboardIconsSet iconsSet = params.mIconsSet; - mVisualInsetsLeft = KeyboardParser.getDimensionOrFraction(keyAttr, + mVisualInsetsLeft = KeyboardBuilder.getDimensionOrFraction(keyAttr, R.styleable.Keyboard_Key_visualInsetsLeft, keyboardWidth, 0); - mVisualInsetsRight = KeyboardParser.getDimensionOrFraction(keyAttr, + mVisualInsetsRight = KeyboardBuilder.getDimensionOrFraction(keyAttr, R.styleable.Keyboard_Key_visualInsetsRight, keyboardWidth, 0); mPreviewIcon = iconsSet.getIcon(style.getInt( keyAttr, R.styleable.Keyboard_Key_keyIconPreview, diff --git a/java/src/com/android/inputmethod/keyboard/KeyDetector.java b/java/src/com/android/inputmethod/keyboard/KeyDetector.java index 53d46a344..0a3acb48b 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyDetector.java +++ b/java/src/com/android/inputmethod/keyboard/KeyDetector.java @@ -153,7 +153,7 @@ public class KeyDetector { } private void getNearbyKeyCodes(final int[] allCodes) { - final List keys = getKeyboard().getKeys(); + final List keys = getKeyboard().mKeys; final int[] indices = mIndices; // 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 */ public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) { - final List keys = getKeyboard().getKeys(); + final List keys = getKeyboard().mKeys; final int touchX = getTouchX(x); final int touchY = getTouchY(y); diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java index 809c949df..d5e75d01b 100644 --- a/java/src/com/android/inputmethod/keyboard/Keyboard.java +++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java @@ -153,11 +153,6 @@ public class Keyboard { return mProximityInfo.getNativeProximityInfo(); } - // TODO: Access mKeys directly - public List getKeys() { - return mKeys; - } - public boolean hasShiftLockKey() { return !mShiftLockKeys.isEmpty(); } diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 0fb510948..d1fd7e3ca 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -448,7 +448,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { canvas.translate(-keyDrawX, -keyDrawY); } else { // 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 keyDrawY = key.mY + getPaddingTop(); canvas.translate(keyDrawX, keyDrawY); diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java index 9a13608fd..3cba5295e 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java @@ -31,8 +31,8 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.text.TextUtils; +import com.android.inputmethod.keyboard.internal.KeyboardBuilder; 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.SubtypeSwitcher; @@ -118,7 +118,7 @@ public class LatinKeyboard extends Keyboard { } } - public static class Builder extends KeyboardParser { + public static class Builder extends KeyboardBuilder { public Builder(Context context) { super(context, new LatinKeyboardParams()); } diff --git a/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java b/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java index 7f5339de5..08e7d7e19 100644 --- a/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java +++ b/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java @@ -16,12 +16,12 @@ 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 { private final int mDefaultKeyCoordX; - public MiniKeyboard(MiniKeyboardLayoutParams params) { + public MiniKeyboard(MiniKeyboardParams params) { super(params); mDefaultKeyCoordX = params.getDefaultKeyCoordX() + params.mDefaultKeyWidth / 2; } diff --git a/java/src/com/android/inputmethod/keyboard/MiniKeyboardKeyDetector.java b/java/src/com/android/inputmethod/keyboard/MiniKeyboardKeyDetector.java index 1ec0dda15..84bd44c30 100644 --- a/java/src/com/android/inputmethod/keyboard/MiniKeyboardKeyDetector.java +++ b/java/src/com/android/inputmethod/keyboard/MiniKeyboardKeyDetector.java @@ -37,7 +37,7 @@ public class MiniKeyboardKeyDetector extends KeyDetector { @Override public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) { - final List keys = getKeyboard().getKeys(); + final List keys = getKeyboard().mKeys; final int touchX = getTouchX(x); final int touchY = getTouchY(y); diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index 3d8a9cfc6..dc2d6e4b0 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -285,7 +285,7 @@ public class PointerTracker { public void setKeyDetectorInner(KeyDetector keyDetector) { mKeyDetector = keyDetector; mKeyboard = keyDetector.getKeyboard(); - mKeys = mKeyboard.getKeys(); + mKeys = mKeyboard.mKeys; final int keyQuarterWidth = mKeyboard.mMostCommonKeyWidth / 4; mKeyQuarterWidthSquared = keyQuarterWidth * keyQuarterWidth; } diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java index 3f9f35993..c0dba4173 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java @@ -20,7 +20,7 @@ import android.content.res.TypedArray; import android.content.res.XmlResourceParser; 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 java.util.ArrayList; @@ -214,7 +214,7 @@ public class KeyStyles { XmlResourceParser parser) { final String styleName = keyStyleAttr.getString(R.styleable.Keyboard_KeyStyle_styleName); if (DEBUG) Log.d(TAG, String.format("<%s styleName=%s />", - KeyboardParser.TAG_KEY_STYLE, styleName)); + KeyboardBuilder.TAG_KEY_STYLE, styleName)); if (mStyles.containsKey(styleName)) throw new ParseException("duplicate key style declared: " + styleName, parser); diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java similarity index 97% rename from java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java rename to java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java index 42e290f8c..de04ecd6c 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java @@ -37,12 +37,11 @@ import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; 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: *
  *   >!-- xml/keyboard.xml --<
@@ -108,8 +107,8 @@ import java.util.List;
  * 
*/ -public class KeyboardParser { - private static final String TAG = KeyboardParser.class.getSimpleName(); +public class KeyboardBuilder { + private static final String TAG = KeyboardBuilder.class.getSimpleName(); private static final boolean DEBUG = false; // Keyboard XML Tags @@ -136,7 +135,7 @@ public class KeyboardParser { private Key mRightEdgeKey = null; private final KeyStyles mKeyStyles = new KeyStyles(); - public KeyboardParser(Context context, KP params) { + public KeyboardBuilder(Context context, KP params) { mContext = context; final Resources res = context.getResources(); mResources = res; @@ -150,7 +149,7 @@ public class KeyboardParser { mParams.GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height); } - public KeyboardParser load(KeyboardId id) { + public KeyboardBuilder load(KeyboardId id) { mParams.mId = id; try { parseKeyboard(id.getXmlId()); @@ -253,10 +252,12 @@ public class KeyboardParser { mParams.mVerticalGap = getDimensionOrFraction(keyboardAttr, 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( 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); } finally { @@ -389,7 +390,7 @@ public class KeyboardParser { final TypedArray keyAttr = mResources.obtainAttributes(Xml.asAttributeSet(parser), R.styleable.Keyboard_Key); - int keyXPos = KeyboardParser.getDimensionOrFraction(keyAttr, + int keyXPos = KeyboardBuilder.getDimensionOrFraction(keyAttr, R.styleable.Keyboard_Key_keyXPos, keyboardWidth, mCurrentX); if (keyXPos < 0) { // If keyXPos is negative, the actual x-coordinate will be display_width + keyXPos. diff --git a/java/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilder.java index bad7a1772..31a291cef 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilder.java +++ b/java/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilder.java @@ -26,21 +26,21 @@ import com.android.inputmethod.keyboard.MiniKeyboard; import com.android.inputmethod.latin.R; public class MiniKeyboardBuilder extends - KeyboardParser { + KeyboardBuilder { private final CharSequence[] mPopupCharacters; - public static class MiniKeyboardLayoutParams extends KeyboardParams { + public static class MiniKeyboardParams extends KeyboardParams { /* package */ int mTopRowAdjustment; public int mNumRows; public int mNumColumns; public int mLeftKeys; public int mRightKeys; // includes default key. - public MiniKeyboardLayoutParams() { + public MiniKeyboardParams() { 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) { super(); setParameters( @@ -194,7 +194,7 @@ public class MiniKeyboardBuilder extends public MiniKeyboardBuilder(KeyboardView view, int xmlId, Key parentKey, Keyboard parentKeyboard) { - super(view.getContext(), new MiniKeyboardLayoutParams()); + 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 @@ -246,7 +246,7 @@ public class MiniKeyboardBuilder extends @Override public MiniKeyboard build() { - final MiniKeyboardLayoutParams params = mParams; + final MiniKeyboardParams params = mParams; for (int n = 0; n < mPopupCharacters.length; n++) { final CharSequence label = mPopupCharacters[n]; final int row = n / params.mNumColumns; diff --git a/java/src/com/android/inputmethod/keyboard/internal/Row.java b/java/src/com/android/inputmethod/keyboard/internal/Row.java index 9299cc261..d53fe12e2 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/Row.java +++ b/java/src/com/android/inputmethod/keyboard/internal/Row.java @@ -40,9 +40,9 @@ public class Row { final int keyboardHeight = params.mHeight; TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser), R.styleable.Keyboard); - mDefaultKeyWidth = KeyboardParser.getDimensionOrFraction(a, + mDefaultKeyWidth = KeyboardBuilder.getDimensionOrFraction(a, R.styleable.Keyboard_keyWidth, keyboardWidth, params.mDefaultKeyWidth); - mRowHeight = KeyboardParser.getDimensionOrFraction(a, + mRowHeight = KeyboardBuilder.getDimensionOrFraction(a, R.styleable.Keyboard_rowHeight, keyboardHeight, params.mDefaultRowHeight); a.recycle(); } diff --git a/tests/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilderTests.java b/tests/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilderTests.java index 0d2802d53..1c5661bf0 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilderTests.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilderTests.java @@ -16,7 +16,7 @@ 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; @@ -41,9 +41,9 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { } public void testLayoutError() { - MiniKeyboardLayoutParams params = null; + MiniKeyboardParams params = null; 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); fail("Should throw IllegalArgumentException"); } catch (IllegalArgumentException e) { @@ -58,7 +58,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [1] public void testLayout1KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("1 key M0 columns", 1, params.mNumColumns); assertEquals("1 key M0 rows", 1, params.mNumRows); @@ -71,7 +71,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |[1] public void testLayout1KeyL0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L0, KEYBOARD_WIDTH); assertEquals("1 key L0 columns", 1, params.mNumColumns); assertEquals("1 key L0 rows", 1, params.mNumRows); @@ -84,7 +84,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ [1] public void testLayout1KeyL1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L1, KEYBOARD_WIDTH); assertEquals("1 key L1 columns", 1, params.mNumColumns); assertEquals("1 key L1 rows", 1, params.mNumRows); @@ -97,7 +97,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ ___ [1] public void testLayout1KeyL2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L2, KEYBOARD_WIDTH); assertEquals("1 key L2 columns", 1, params.mNumColumns); assertEquals("1 key L2 rows", 1, params.mNumRows); @@ -110,7 +110,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [1]| public void testLayout1KeyR0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R0, KEYBOARD_WIDTH); assertEquals("1 key R0 columns", 1, params.mNumColumns); assertEquals("1 key R0 rows", 1, params.mNumRows); @@ -123,7 +123,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [1] ___| public void testLayout1KeyR1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R1, KEYBOARD_WIDTH); assertEquals("1 key R1 columns", 1, params.mNumColumns); assertEquals("1 key R1 rows", 1, params.mNumRows); @@ -136,7 +136,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [1] ___ ___| public void testLayout1KeyR2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R2, KEYBOARD_WIDTH); assertEquals("1 key R2 columns", 1, params.mNumColumns); assertEquals("1 key R2 rows", 1, params.mNumRows); @@ -149,7 +149,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [1] [2] public void testLayout2KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("2 key M0 columns", 2, params.mNumColumns); assertEquals("2 key M0 rows", 1, params.mNumRows); @@ -163,7 +163,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |[1] [2] public void testLayout2KeyL0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L0, KEYBOARD_WIDTH); assertEquals("2 key L0 columns", 2, params.mNumColumns); assertEquals("2 key L0 rows", 1, params.mNumRows); @@ -177,7 +177,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ [1] [2] public void testLayout2KeyL1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L1, KEYBOARD_WIDTH); assertEquals("2 key L1 columns", 2, params.mNumColumns); assertEquals("2 key L1 rows", 1, params.mNumRows); @@ -191,7 +191,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ ___ [1] [2] public void testLayout2KeyL2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L2, KEYBOARD_WIDTH); assertEquals("2 key L2 columns", 2, params.mNumColumns); assertEquals("2 key L2 rows", 1, params.mNumRows); @@ -205,7 +205,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [2] [1]| public void testLayout2KeyR0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R0, KEYBOARD_WIDTH); assertEquals("2 key R0 columns", 2, params.mNumColumns); assertEquals("2 key R0 rows", 1, params.mNumRows); @@ -219,7 +219,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [2] [1] ___| public void testLayout2KeyR1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R1, KEYBOARD_WIDTH); assertEquals("2 key R1 columns", 2, params.mNumColumns); assertEquals("2 key R1 rows", 1, params.mNumRows); @@ -233,7 +233,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [1] [2] ___ ___| public void testLayout2KeyR2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R2, KEYBOARD_WIDTH); assertEquals("2 key R2 columns", 2, params.mNumColumns); assertEquals("2 key R2 rows", 1, params.mNumRows); @@ -247,7 +247,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [3] [1] [2] public void testLayout3KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("3 key columns", 3, params.mNumColumns); assertEquals("3 key rows", 1, params.mNumRows); @@ -262,7 +262,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |[1] [2] [3] public void testLayout3KeyL0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L0, KEYBOARD_WIDTH); assertEquals("3 key L0 columns", 3, params.mNumColumns); assertEquals("3 key L0 rows", 1, params.mNumRows); @@ -277,7 +277,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ [1] [2] [3] public void testLayout3KeyL1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L1, KEYBOARD_WIDTH); assertEquals("3 key L1 columns", 3, params.mNumColumns); assertEquals("3 key L1 rows", 1, params.mNumRows); @@ -292,7 +292,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ ___ [3] [1] [2] public void testLayout3KeyL2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L2, KEYBOARD_WIDTH); assertEquals("3 key L2 columns", 3, params.mNumColumns); assertEquals("3 key L2 rows", 1, params.mNumRows); @@ -307,7 +307,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [3] [2] [1]| public void testLayout3KeyR0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R0, KEYBOARD_WIDTH); assertEquals("3 key R0 columns", 3, params.mNumColumns); assertEquals("3 key R0 rows", 1, params.mNumRows); @@ -322,7 +322,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [3] [2] [1] ___| public void testLayout3KeyR1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R1, KEYBOARD_WIDTH); assertEquals("3 key R1 columns", 3, params.mNumColumns); assertEquals("3 key R1 rows", 1, params.mNumRows); @@ -337,7 +337,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [3] [1] [2] ___ ___| public void testLayout3KeyR2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R2, KEYBOARD_WIDTH); assertEquals("3 key R2 columns", 3, params.mNumColumns); assertEquals("3 key R2 rows", 1, params.mNumRows); @@ -352,7 +352,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [3] [1] [2] [4] public void testLayout4KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("4 key columns", 4, params.mNumColumns); assertEquals("4 key rows", 1, params.mNumRows); @@ -368,7 +368,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |[1] [2] [3] [4] public void testLayout4KeyL0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L0, KEYBOARD_WIDTH); assertEquals("4 key L0 columns", 4, params.mNumColumns); assertEquals("4 key L0 rows", 1, params.mNumRows); @@ -384,7 +384,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ [1] [2] [3] [4] public void testLayout4KeyL1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L1, KEYBOARD_WIDTH); assertEquals("4 key L1 columns", 4, params.mNumColumns); assertEquals("4 key L1 rows", 1, params.mNumRows); @@ -400,7 +400,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ ___ [3] [1] [2] [4] public void testLayout4KeyL2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L2, KEYBOARD_WIDTH); assertEquals("4 key L2 columns", 4, params.mNumColumns); assertEquals("4 key L2 rows", 1, params.mNumRows); @@ -416,7 +416,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [4] [3] [2] [1]| public void testLayout4KeyR0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R0, KEYBOARD_WIDTH); assertEquals("4 key R0 columns", 4, params.mNumColumns); assertEquals("4 key R0 rows", 1, params.mNumRows); @@ -432,7 +432,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [4] [3] [2] [1] ___| public void testLayout4KeyR1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R1, KEYBOARD_WIDTH); assertEquals("4 key R1 columns", 4, params.mNumColumns); assertEquals("4 key R1 rows", 1, params.mNumRows); @@ -448,7 +448,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [4] [3] [1] [2] ___ ___| public void testLayout4KeyR2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R2, KEYBOARD_WIDTH); assertEquals("4 key R2 columns", 4, params.mNumColumns); assertEquals("4 key R2 rows", 1, params.mNumRows); @@ -464,7 +464,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [5] [3] [1] [2] [4] public void testLayout5KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("5 key columns", 5, params.mNumColumns); assertEquals("5 key rows", 1, params.mNumRows); @@ -481,7 +481,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |[1] [2] [3] [4] [5] public void testLayout5KeyL0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L0, KEYBOARD_WIDTH); assertEquals("5 key L0 columns", 5, params.mNumColumns); assertEquals("5 key L0 rows", 1, params.mNumRows); @@ -498,7 +498,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ [1] [2] [3] [4] [5] public void testLayout5KeyL1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L1, KEYBOARD_WIDTH); assertEquals("5 key L1 columns", 5, params.mNumColumns); assertEquals("5 key L1 rows", 1, params.mNumRows); @@ -515,7 +515,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ ___ [3] [1] [2] [4] [5] public void testLayout5KeyL2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L2, KEYBOARD_WIDTH); assertEquals("5 key L2 columns", 5, params.mNumColumns); assertEquals("5 key L2 rows", 1, params.mNumRows); @@ -532,7 +532,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [5] [4] [3] [2] [1]| public void testLayout5KeyR0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R0, KEYBOARD_WIDTH); assertEquals("5 key R0 columns", 5, params.mNumColumns); assertEquals("5 key R0 rows", 1, params.mNumRows); @@ -549,7 +549,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [5] [4] [3] [2] [1] ___| public void testLayout5KeyR1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R1, KEYBOARD_WIDTH); assertEquals("5 key R1 columns", 5, params.mNumColumns); assertEquals("5 key R1 rows", 1, params.mNumRows); @@ -566,7 +566,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [5] [4] [3] [1] [2] ___ ___| public void testLayout5KeyR2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R2, KEYBOARD_WIDTH); assertEquals("5 key R2 columns", 5, params.mNumColumns); assertEquals("5 key R2 rows", 1, params.mNumRows); @@ -584,7 +584,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [6] [4] [5] // [3] [1] [2] public void testLayout6KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("6 key columns", 3, params.mNumColumns); assertEquals("6 key rows", 2, params.mNumRows); @@ -603,7 +603,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |[4] [5] [6] // |[1] [2] [3] public void testLayout6KeyL0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L0, KEYBOARD_WIDTH); assertEquals("6 key L0 columns", 3, params.mNumColumns); assertEquals("6 key L0 rows", 2, params.mNumRows); @@ -622,7 +622,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ [4] [5] [6] // |___ [1] [2] [3] public void testLayout6KeyL1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L1, KEYBOARD_WIDTH); assertEquals("6 key L1 columns", 3, params.mNumColumns); assertEquals("6 key L1 rows", 2, params.mNumRows); @@ -641,7 +641,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ ___ [6] [4] [5] // |___ ___ [3] [1] [2] public void testLayout6KeyL2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L2, KEYBOARD_WIDTH); assertEquals("6 key L2 columns", 3, params.mNumColumns); assertEquals("6 key L2 rows", 2, params.mNumRows); @@ -660,7 +660,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [6] [5] [4]| // [3] [2] [1]| public void testLayout6KeyR0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R0, KEYBOARD_WIDTH); assertEquals("6 key R0 columns", 3, params.mNumColumns); assertEquals("6 key R0 rows", 2, params.mNumRows); @@ -679,7 +679,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [6] [5] [4] ___| // [3] [2] [1] ___| public void testLayout6KeyR1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R1, KEYBOARD_WIDTH); assertEquals("6 key R1 columns", 3, params.mNumColumns); assertEquals("6 key R1 rows", 2, params.mNumRows); @@ -698,7 +698,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [6] [4] [5] ___ ___| // [3] [1] [2] ___ ___| public void testLayout6KeyR2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R2, KEYBOARD_WIDTH); assertEquals("6 key R2 columns", 3, params.mNumColumns); assertEquals("6 key R2 rows", 2, params.mNumRows); @@ -717,7 +717,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [7] [5] [6] // [3] [1] [2] [4] public void testLayout7KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("7 key columns", 4, params.mNumColumns); assertEquals("7 key rows", 2, params.mNumRows); @@ -737,7 +737,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |[5] [6] [7] // |[1] [2] [3] [4] public void testLayout7KeyL0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L0, KEYBOARD_WIDTH); assertEquals("7 key L0 columns", 4, params.mNumColumns); assertEquals("7 key L0 rows", 2, params.mNumRows); @@ -757,7 +757,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ [5] [6] [7] // |___ [1] [2] [3] [4] public void testLayout7KeyL1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L1, KEYBOARD_WIDTH); assertEquals("7 key L1 columns", 4, params.mNumColumns); assertEquals("7 key L1 rows", 2, params.mNumRows); @@ -777,7 +777,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ ___ [7] [5] [6] // |___ ___ [3] [1] [2] [4] public void testLayout7KeyL2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L2, KEYBOARD_WIDTH); assertEquals("7 key L2 columns", 4, params.mNumColumns); assertEquals("7 key L2 rows", 2, params.mNumRows); @@ -797,7 +797,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [7] [6] [5]| // [4] [3] [2] [1]| public void testLayout7KeyR0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R0, KEYBOARD_WIDTH); assertEquals("7 key R0 columns", 4, params.mNumColumns); assertEquals("7 key R0 rows", 2, params.mNumRows); @@ -817,7 +817,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [7] [6] [5] ___| // [4] [3] [2] [1] ___| public void testLayout7KeyR1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R1, KEYBOARD_WIDTH); assertEquals("7 key R1 columns", 4, params.mNumColumns); assertEquals("7 key R1 rows", 2, params.mNumRows); @@ -837,7 +837,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [7] [5] [6] ___ ___| // [4] [3] [1] [2] ___ ___| public void testLayout7KeyR2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R2, KEYBOARD_WIDTH); assertEquals("7 key R2 columns", 4, params.mNumColumns); assertEquals("7 key R2 rows", 2, params.mNumRows); @@ -856,7 +856,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [7] [6] [5] [3] [1] [2] [4] ___| public void testLayout7KeyR3Max7() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, 7, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(7, 7, WIDTH, HEIGHT, XPOS_R3, KEYBOARD_WIDTH); assertEquals("7 key R2 columns", 7, params.mNumColumns); assertEquals("7 key R2 rows", 1, params.mNumRows); @@ -876,7 +876,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [7] [5] [6] [8] // [3] [1] [2] [4] public void testLayout8KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("8 key M0 columns", 4, params.mNumColumns); assertEquals("8 key M0 rows", 2, params.mNumRows); @@ -897,7 +897,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |[5] [6] [7] [8] // |[1] [2] [3] [4] public void testLayout8KeyL0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L0, KEYBOARD_WIDTH); assertEquals("8 key L0 columns", 4, params.mNumColumns); assertEquals("8 key L0 rows", 2, params.mNumRows); @@ -918,7 +918,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ [5] [6] [7] [8] // |___ [1] [2] [3] [4] public void testLayout8KeyL1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L1, KEYBOARD_WIDTH); assertEquals("8 key L1 columns", 4, params.mNumColumns); assertEquals("8 key L1 rows", 2, params.mNumRows); @@ -939,7 +939,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ ___ [7] [5] [6] [8] // |___ ___ [3] [1] [2] [4] public void testLayout8KeyL2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L2, KEYBOARD_WIDTH); assertEquals("8 key L2 columns", 4, params.mNumColumns); assertEquals("8 key L2 rows", 2, params.mNumRows); @@ -960,7 +960,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [8] [7] [6] [5]| // [4] [3] [2] [1]| public void testLayout8KeyR0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R0, KEYBOARD_WIDTH); assertEquals("8 key R0 columns", 4, params.mNumColumns); assertEquals("8 key R0 rows", 2, params.mNumRows); @@ -981,7 +981,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [8] [7] [6] [5] ___| // [4] [3] [2] [1] ___| public void testLayout8KeyR1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R1, KEYBOARD_WIDTH); assertEquals("8 key R1 columns", 4, params.mNumColumns); assertEquals("8 key R1 rows", 2, params.mNumRows); @@ -1002,7 +1002,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [8] [7] [5] [6] ___ ___| // [4] [3] [1] [2] ___ ___| public void testLayout8KeyR2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R2, KEYBOARD_WIDTH); assertEquals("8 key R2 columns", 4, params.mNumColumns); assertEquals("8 key R2 rows", 2, params.mNumRows); @@ -1023,7 +1023,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [8] [6] [7] [9] // [5] [3] [1] [2] [4] public void testLayout9KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("9 key M0 columns", 5, params.mNumColumns); assertEquals("9 key M0 rows", 2, params.mNumRows); @@ -1045,7 +1045,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |[6] [7] [8] [9] // |[1] [2] [3] [4] [5] public void testLayout9KeyL0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L0, KEYBOARD_WIDTH); assertEquals("9 key L0 columns", 5, params.mNumColumns); assertEquals("9 key L0 rows", 2, params.mNumRows); @@ -1067,7 +1067,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ [6] [7] [8] [9] // |___ [1] [2] [3] [4] [5] public void testLayout9KeyL1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L1, KEYBOARD_WIDTH); assertEquals("9 key L1 columns", 5, params.mNumColumns); assertEquals("9 key L1 rows", 2, params.mNumRows); @@ -1089,7 +1089,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ ___ [8] [6] [7] [9] // |___ ___ [3] [1] [2] [4] [5] public void testLayout9KeyL2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L2, KEYBOARD_WIDTH); assertEquals("9 key L2 columns", 5, params.mNumColumns); assertEquals("9 key L2 rows", 2, params.mNumRows); @@ -1111,7 +1111,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [9] [8] [7] [6]| // [5] [4] [3] [2] [1]| public void testLayout9KeyR0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R0, KEYBOARD_WIDTH); assertEquals("9 key R0 columns", 5, params.mNumColumns); assertEquals("9 key R0 rows", 2, params.mNumRows); @@ -1133,7 +1133,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [9] [8] [7] [6] ___| // [5] [4] [3] [2] [1] ___| public void testLayout9KeyR1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R1, KEYBOARD_WIDTH); assertEquals("9 key R1 columns", 5, params.mNumColumns); assertEquals("9 key R1 rows", 2, params.mNumRows); @@ -1155,7 +1155,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [9] [8] [6] [7] ___ ___| // [5] [4] [3] [1] [2] ___ ___| public void testLayout9KeyR2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R2, KEYBOARD_WIDTH); assertEquals("9 key R2 columns", 5, params.mNumColumns); assertEquals("9 key R2 rows", 2, params.mNumRows); @@ -1177,7 +1177,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [A] [8] [6] [7] [9] // [5] [3] [1] [2] [4] public void testLayout10KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("10 key M0 columns", 5, params.mNumColumns); assertEquals("10 key M0 rows", 2, params.mNumRows); @@ -1200,7 +1200,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |[6] [7] [8] [9] [A] // |[1] [2] [3] [4] [5] public void testLayout10KeyL0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L0, KEYBOARD_WIDTH); assertEquals("10 key L0 columns", 5, params.mNumColumns); assertEquals("10 key L0 rows", 2, params.mNumRows); @@ -1223,7 +1223,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ [6] [7] [8] [9] [A] // |___ [1] [2] [3] [4] [5] public void testLayout10KeyL1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L1, KEYBOARD_WIDTH); assertEquals("10 key L1 columns", 5, params.mNumColumns); assertEquals("10 key L1 rows", 2, params.mNumRows); @@ -1246,7 +1246,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // |___ ___ [8] [6] [7] [9] [A] // |___ ___ [3] [1] [2] [4] [5] public void testLayout10KeyL2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_L2, KEYBOARD_WIDTH); assertEquals("10 key L2 columns", 5, params.mNumColumns); assertEquals("10 key L2 rows", 2, params.mNumRows); @@ -1269,7 +1269,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [A] [9] [8] [7] [6]| // [5] [4] [3] [2] [1]| public void testLayout10KeyR0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R0, KEYBOARD_WIDTH); assertEquals("10 key R0 columns", 5, params.mNumColumns); assertEquals("10 key R0 rows", 2, params.mNumRows); @@ -1292,7 +1292,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [A] [9] [8] [7] [6] ___| // [5] [4] [3] [2] [1] ___| public void testLayout10KeyR1() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R1, KEYBOARD_WIDTH); assertEquals("10 key R1 columns", 5, params.mNumColumns); assertEquals("10 key R1 rows", 2, params.mNumRows); @@ -1315,7 +1315,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [A] [9] [8] [6] [7] ___ ___| // [5] [4] [3] [1] [2] ___ ___| public void testLayout10KeyR2() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_R2, KEYBOARD_WIDTH); assertEquals("10 key R2 columns", 5, params.mNumColumns); assertEquals("10 key R2 rows", 2, params.mNumRows); @@ -1339,7 +1339,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [7] [5] [6] [8] // [3] [1] [2] [4] public void testLayout11KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(11, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(11, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("11 key M0 columns", 4, params.mNumColumns); assertEquals("11 key M0 rows", 3, params.mNumRows); @@ -1364,7 +1364,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [7] [5] [6] [8] // [3] [1] [2] [4] public void testLayout12KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(12, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(12, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("12 key M0 columns", 4, params.mNumColumns); assertEquals("12 key M0 rows", 3, params.mNumRows); @@ -1391,7 +1391,7 @@ public class MiniKeyboardBuilderTests extends AndroidTestCase { // [A] [8] [6] [7] [9] // [5] [3] [1] [2] [4] public void testLayout13KeyM0() { - MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(13, MAX_COLUMNS, WIDTH, + MiniKeyboardParams params = new MiniKeyboardParams(13, MAX_COLUMNS, WIDTH, HEIGHT, XPOS_M0, KEYBOARD_WIDTH); assertEquals("13 key M0 columns", 5, params.mNumColumns); assertEquals("13 key M0 rows", 3, params.mNumRows); diff --git a/tests/src/com/android/inputmethod/latin/SuggestHelper.java b/tests/src/com/android/inputmethod/latin/SuggestHelper.java index f9ea1805a..773674384 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestHelper.java +++ b/tests/src/com/android/inputmethod/latin/SuggestHelper.java @@ -16,16 +16,15 @@ package com.android.inputmethod.latin; +import android.content.Context; +import android.text.TextUtils; + import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.KeyDetector; import com.android.inputmethod.keyboard.KeyboardId; import com.android.inputmethod.keyboard.LatinKeyboard; -import android.content.Context; -import android.text.TextUtils; - import java.io.File; -import java.util.List; public class SuggestHelper { protected final Suggest mSuggest; @@ -66,8 +65,7 @@ public class SuggestHelper { } private void addKeyInfo(WordComposer word, char c) { - final List keys = mKeyboard.getKeys(); - for (final Key key : keys) { + for (final Key key : mKeyboard.mKeys) { if (key.mCode == c) { final int x = key.mX + key.mWidth / 2; final int y = key.mY + key.mHeight / 2;