diff options
author | 2013-08-30 00:52:34 -0700 | |
---|---|---|
committer | 2013-08-30 00:52:34 -0700 | |
commit | afb8e0706d8eca50be9cbaf23c19190283ea017c (patch) | |
tree | d019562ba756e7ac53f94ea5f802af81d26983a0 /java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java | |
parent | eca8832b92b09fd97c04dbb1262a8152b9dafaa2 (diff) | |
parent | 2f95baaaf079e778f05ba4539a609a6df43fd342 (diff) | |
download | latinime-afb8e0706d8eca50be9cbaf23c19190283ea017c.tar.gz latinime-afb8e0706d8eca50be9cbaf23c19190283ea017c.tar.xz latinime-afb8e0706d8eca50be9cbaf23c19190283ea017c.zip |
am 2f95baaa: Merge "Revert "Remove key preview backing view""
* commit '2f95baaaf079e778f05ba4539a609a6df43fd342':
Revert "Remove key preview backing view"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java index aca249240..8d2689a7d 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java @@ -165,9 +165,20 @@ final class SuggestionStripLayoutHelper { return mMaxMoreSuggestionsRow; } - public void setMoreSuggestionsHeight(final int remainingHeight) { + private int getMoreSuggestionsHeight() { + return mMaxMoreSuggestionsRow * mMoreSuggestionsRowHeight + mMoreSuggestionsBottomGap; + } + + public int setMoreSuggestionsHeight(final int remainingHeight) { + final int currentHeight = getMoreSuggestionsHeight(); + if (currentHeight <= remainingHeight) { + return currentHeight; + } + mMaxMoreSuggestionsRow = (remainingHeight - mMoreSuggestionsBottomGap) / mMoreSuggestionsRowHeight; + final int newHeight = getMoreSuggestionsHeight(); + return newHeight; } private static Drawable getMoreSuggestionsHint(final Resources res, final float textSize, |