From 2c47080e7b4b9b2a6c2dbf1444e041c1b7943316 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 18 Oct 2011 12:08:49 +0900 Subject: Update suggestions strip divider Bug: 5142447 Change-Id: I275a304e46456e3b80968fb5de330a3b04bd2035 --- java/src/com/android/inputmethod/latin/SuggestionsView.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'java/src') 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); -- cgit v1.2.3-83-g751a