aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2013-08-30 07:51:28 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-08-30 07:51:29 +0000
commit2f95baaaf079e778f05ba4539a609a6df43fd342 (patch)
tree8149e0d515e9057930f3e5de0a18ab6dac19317a /java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
parent4445671efc673165979195c13f197128c14fbe7c (diff)
parentc160a3932f74fea72c5347798c001d4ae961864c (diff)
downloadlatinime-2f95baaaf079e778f05ba4539a609a6df43fd342.tar.gz
latinime-2f95baaaf079e778f05ba4539a609a6df43fd342.tar.xz
latinime-2f95baaaf079e778f05ba4539a609a6df43fd342.zip
Merge "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.java13
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,