diff options
author | 2011-09-28 18:51:57 +0900 | |
---|---|---|
committer | 2011-09-28 19:31:37 +0900 | |
commit | 2fc4248700023853980b0006c12425079e3f9257 (patch) | |
tree | 5b945f065bfc73dc79bdf76300f2d4356bbf9524 /java/src/com/android/inputmethod/latin/MoreSuggestions.java | |
parent | a59f65ad0cadfd2e71ebbe7ca8b14285a4db6ae2 (diff) | |
download | latinime-2fc4248700023853980b0006c12425079e3f9257.tar.gz latinime-2fc4248700023853980b0006c12425079e3f9257.tar.xz latinime-2fc4248700023853980b0006c12425079e3f9257.zip |
Introduce hit box to Key and get rid of edge flags
Change-Id: I2b78d2ca756223b5497d01127c3a0190dcc81e57
Diffstat (limited to 'java/src/com/android/inputmethod/latin/MoreSuggestions.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/MoreSuggestions.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/latin/MoreSuggestions.java b/java/src/com/android/inputmethod/latin/MoreSuggestions.java index 1afa07214..9a59ef2e0 100644 --- a/java/src/com/android/inputmethod/latin/MoreSuggestions.java +++ b/java/src/com/android/inputmethod/latin/MoreSuggestions.java @@ -153,23 +153,19 @@ public class MoreSuggestions extends Keyboard { return (mOccupiedWidth - mDividerWidth * (numColumnInRow - 1)) / numColumnInRow; } - public int getFlags(int pos) { - int rowFlags = 0; - + public void markAsEdgeKey(Key key, int pos) { final int row = mRowNumbers[pos]; if (row == 0) - rowFlags |= Keyboard.EDGE_BOTTOM; + key.markAsBottomEdge(this); if (row == mNumRows - 1) - rowFlags |= Keyboard.EDGE_TOP; + key.markAsTopEdge(this); final int numColumnInRow = mNumColumnsInRow[row]; final int column = getColumnNumber(pos); if (column == 0) - rowFlags |= Keyboard.EDGE_LEFT; + key.markAsLeftEdge(this); if (column == numColumnInRow - 1) - rowFlags |= Keyboard.EDGE_RIGHT; - - return rowFlags; + key.markAsRightEdge(this); } } @@ -214,7 +210,8 @@ public class MoreSuggestions extends Keyboard { final int index = pos + SUGGESTION_CODE_BASE; final Key key = new Key( params, word, info, null, index, null, x, y, width, - params.mDefaultRowHeight, params.getFlags(pos)); + params.mDefaultRowHeight); + params.markAsEdgeKey(key, pos); params.onAddKey(key); final int columnNumber = params.getColumnNumber(pos); final int numColumnInRow = params.getNumColumnInRow(pos); |