From 784416f73bc5053114ceb8274dba4bdabbbda700 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 19 Aug 2013 11:00:52 +0900 Subject: [PATCH] Make all KeyboardRow attributes private Change-Id: Ifaca6ad5e642964d8c3a77a96a1cd74f363ee996 --- java/src/com/android/inputmethod/keyboard/Key.java | 2 +- .../inputmethod/keyboard/internal/KeyboardBuilder.java | 2 +- .../inputmethod/keyboard/internal/KeyboardRow.java | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index 8098dab37..e6065e6ea 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -234,7 +234,7 @@ public class Key implements Comparable { public Key(final Resources res, final KeyboardParams params, final KeyboardRow row, final XmlPullParser parser) throws XmlPullParserException { final float horizontalGap = isSpacer() ? 0 : params.mHorizontalGap; - final int rowHeight = row.mRowHeight; + final int rowHeight = row.getRowHeight(); mHeight = rowHeight - params.mVerticalGap; final TypedArray keyAttr = res.obtainAttributes(Xml.asAttributeSet(parser), diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java index 9bc52e567..65eb1712a 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java @@ -745,7 +745,7 @@ public class KeyboardBuilder { mRightEdgeKey = null; } addEdgeSpace(mParams.mRightPadding, row); - mCurrentY += row.mRowHeight; + mCurrentY += row.getRowHeight(); mCurrentRow = null; mTopEdge = false; } diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardRow.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardRow.java index edfcec7e1..80fe1eaa0 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardRow.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardRow.java @@ -38,10 +38,10 @@ public final class KeyboardRow { private static final int KEYWIDTH_FILL_RIGHT = -1; private final KeyboardParams mParams; + /** The height of this row. */ + private final int mRowHeight; /** Default width of a key in this row. */ private float mDefaultKeyWidth; - /** Default height of a key in this row. */ - public final int mRowHeight; /** Default keyLabelFlags in this row. */ private int mDefaultKeyLabelFlags; /** Default backgroundType for this row */ @@ -74,6 +74,10 @@ public final class KeyboardRow { mCurrentX = 0.0f; } + public int getRowHeight() { + return mRowHeight; + } + public float getDefaultKeyWidth() { return mDefaultKeyWidth; }