aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java12
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestionsView.java11
2 files changed, 20 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index c05913baa..05aa305f5 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -765,14 +765,24 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
if (attribute == null)
return;
final int inputType = attribute.inputType;
+ if (inputType == InputType.TYPE_NULL) {
+ // TODO: We should honor TYPE_NULL specification.
+ Log.i(TAG, "InputType.TYPE_NULL is specified");
+ }
+ final int inputClass = inputType & InputType.TYPE_MASK_CLASS;
final int variation = inputType & InputType.TYPE_MASK_VARIATION;
+ if (inputClass == 0) {
+ Log.w(TAG, String.format("Unexpected input class: inputType=0x%08x imeOptions=0x%08x",
+ inputType, attribute.imeOptions));
+ }
+
mShouldInsertMagicSpace = false;
mInputTypeNoAutoCorrect = false;
mIsSettingsSuggestionStripOn = false;
mApplicationSpecifiedCompletionOn = false;
mApplicationSpecifiedCompletions = null;
- if ((inputType & InputType.TYPE_MASK_CLASS) == InputType.TYPE_CLASS_TEXT) {
+ if (inputClass == InputType.TYPE_CLASS_TEXT) {
mIsSettingsSuggestionStripOn = true;
// Make sure that passwords are not displayed in {@link SuggestionsView}.
if (InputTypeCompatUtils.isPasswordInputType(inputType)
diff --git a/java/src/com/android/inputmethod/latin/SuggestionsView.java b/java/src/com/android/inputmethod/latin/SuggestionsView.java
index 937c2c9ff..c25ecb382 100644
--- a/java/src/com/android/inputmethod/latin/SuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/SuggestionsView.java
@@ -324,6 +324,13 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
return Color.argb(newAlpha, Color.red(color), Color.green(color), Color.blue(color));
}
+ private static void addDivider(final ViewGroup stripView, final View divider) {
+ stripView.addView(divider);
+ final LinearLayout.LayoutParams params =
+ (LinearLayout.LayoutParams)divider.getLayoutParams();
+ params.gravity = Gravity.CENTER;
+ }
+
public void layout(SuggestedWords suggestions, ViewGroup stripView, ViewGroup placer,
int stripWidth) {
if (suggestions.isPunctuationSuggestions()) {
@@ -341,7 +348,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
if (index != 0) {
final View divider = mDividers.get(pos);
// Add divider if this isn't the left most suggestion in suggestions strip.
- stripView.addView(divider);
+ addDivider(stripView, divider);
x += divider.getMeasuredWidth();
}
@@ -421,7 +428,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
for (int index = 0; index < countInStrip; index++) {
if (index != 0) {
// Add divider if this isn't the left most suggestion in suggestions strip.
- stripView.addView(mDividers.get(index));
+ addDivider(stripView, mDividers.get(index));
}
final TextView word = mWords.get(index);