aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-02-10 12:18:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-02-10 12:18:10 +0000
commitf9e5b1ee4ffa08fd10f8685cceff34daf2258ae0 (patch)
tree049cf5fba6453c872c2f9afe54598e1976e190c6 /java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
parent64faafbb0e0a048997cc52e7198e789baa14e85c (diff)
parent8dda9e480b6519ca57565c8aa507e14bff739b60 (diff)
downloadlatinime-f9e5b1ee4ffa08fd10f8685cceff34daf2258ae0.tar.gz
latinime-f9e5b1ee4ffa08fd10f8685cceff34daf2258ae0.tar.xz
latinime-f9e5b1ee4ffa08fd10f8685cceff34daf2258ae0.zip
Merge "Show important notice strip"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java')
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java14
1 files changed, 4 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
index a89f70e1f..4063edccc 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
@@ -504,15 +504,9 @@ final class SuggestionStripLayoutHelper {
titleView, infoIcon, null, moreIcon, null);
final CharSequence importantNoticeTitle = titleView.getText();
titleView.setTextScaleX(1.0f); // Reset textScaleX.
- // When the suggestions strip is displayed first time, stripWidth may be zero.
- // Then importantNoticeTitle will be displayed as is without auto text scaleX.
- // TODO: Fix the logic to always have a correct value of stripWidth.
- if (width > 0) {
- // Auto text scaleX to show entire important notice title should be on the strip.
- final float titleScaleX = getTextScaleX(
- importantNoticeTitle, width, titleView.getPaint());
- titleView.setTextScaleX(titleScaleX);
- }
+ final float titleScaleX = getTextScaleX(
+ importantNoticeTitle, width, titleView.getPaint());
+ titleView.setTextScaleX(titleScaleX);
}
static void setLayoutWeight(final View v, final float weight, final int height) {
@@ -529,7 +523,7 @@ final class SuggestionStripLayoutHelper {
final TextPaint paint) {
paint.setTextScaleX(1.0f);
final int width = getTextWidth(text, paint);
- if (width <= maxWidth) {
+ if (width <= maxWidth || maxWidth <= 0) {
return 1.0f;
}
return maxWidth / (float)width;