diff options
author | 2014-02-03 11:49:34 +0900 | |
---|---|---|
committer | 2014-02-10 21:15:35 +0900 | |
commit | 8dda9e480b6519ca57565c8aa507e14bff739b60 (patch) | |
tree | a4283b0102da8f3609381084bb320289bd483832 /java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java | |
parent | 6422f77e9497120fe6b2d7ec012c214c06829bab (diff) | |
download | latinime-8dda9e480b6519ca57565c8aa507e14bff739b60.tar.gz latinime-8dda9e480b6519ca57565c8aa507e14bff739b60.tar.xz latinime-8dda9e480b6519ca57565c8aa507e14bff739b60.zip |
Show important notice strip
Bug: 10587358
Change-Id: I1af3faa59afb2fc4cb90176acff1c2b0b1ba369c
Diffstat (limited to 'java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java | 14 |
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; |