aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/SuggestionsView.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-10-19 18:09:17 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-19 18:09:17 -0700
commit61aebb0a1e3d12cd5287c9be3c2e37df565af888 (patch)
tree3cbad43fa2c3544fa52ed1bd28dd6364ccea5493 /java/src/com/android/inputmethod/latin/SuggestionsView.java
parent78674d0ff7f7126da9a2267b6c764f3222232b90 (diff)
parent2c47080e7b4b9b2a6c2dbf1444e041c1b7943316 (diff)
downloadlatinime-61aebb0a1e3d12cd5287c9be3c2e37df565af888.tar.gz
latinime-61aebb0a1e3d12cd5287c9be3c2e37df565af888.tar.xz
latinime-61aebb0a1e3d12cd5287c9be3c2e37df565af888.zip
Merge "Update suggestions strip divider" into ics-mr0
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestionsView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestionsView.java11
1 files changed, 9 insertions, 2 deletions
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);