diff options
author | 2013-08-30 07:50:37 +0000 | |
---|---|---|
committer | 2013-08-30 07:50:37 +0000 | |
commit | c160a3932f74fea72c5347798c001d4ae961864c (patch) | |
tree | 6b6b344a2e68c03f5dc6f5ac002ae3bdeea6444e /java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java | |
parent | 2dfcfc5013eee2fbd19a5830ff70943bd6c1bee2 (diff) | |
download | latinime-c160a3932f74fea72c5347798c001d4ae961864c.tar.gz latinime-c160a3932f74fea72c5347798c001d4ae961864c.tar.xz latinime-c160a3932f74fea72c5347798c001d4ae961864c.zip |
Revert "Remove key preview backing view"
This reverts commit 2dfcfc5013eee2fbd19a5830ff70943bd6c1bee2.
Change-Id: I96c691b2e9c92be456420196cd7361d03ea4f3e9
bug: 10541453
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 bcf64a8e8..1dd04fc4d 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java @@ -177,9 +177,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, |