am 61aebb0a
: Merge "Update suggestions strip divider" into ics-mr0
* commit '61aebb0a1e3d12cd5287c9be3c2e37df565af888': Update suggestions strip divider
Before Width: | Height: | Size: 1,012 B After Width: | Height: | Size: 73 B |
Before Width: | Height: | Size: 951 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 846 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 843 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 671 B After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 630 B |
Before Width: | Height: | Size: 795 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1,020 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 880 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 813 B |
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 870 B |
Before Width: | Height: | Size: 623 B After Width: | Height: | Size: 940 B |
Before Width: | Height: | Size: 547 B After Width: | Height: | Size: 850 B |
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 505 B |
Before Width: | Height: | Size: 589 B After Width: | Height: | Size: 801 B |
Before Width: | Height: | Size: 695 B After Width: | Height: | Size: 843 B |
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 784 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 909 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 523 B After Width: | Height: | Size: 675 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.6 KiB |
|
@ -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);
|
||||
|
|