aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/MoreSuggestions.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-09-28 18:51:57 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-09-28 19:31:37 +0900
commit2fc4248700023853980b0006c12425079e3f9257 (patch)
tree5b945f065bfc73dc79bdf76300f2d4356bbf9524 /java/src/com/android/inputmethod/latin/MoreSuggestions.java
parenta59f65ad0cadfd2e71ebbe7ca8b14285a4db6ae2 (diff)
downloadlatinime-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.java17
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);