aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-09-02 12:59:31 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-02 12:59:31 -0700
commit787bac06031f0f1554785cd4f09ef4e0ec121f5d (patch)
treee3bfb5439d79b65249f1cd54f38d28aa888d708e /java/src/com/android/inputmethod
parente197542a57cf6ca9bb20c4f2eff7b85e94862feb (diff)
parentabb0c77af15a22b5d0953e477da8747cd5f2259d (diff)
downloadlatinime-787bac06031f0f1554785cd4f09ef4e0ec121f5d.tar.gz
latinime-787bac06031f0f1554785cd4f09ef4e0ec121f5d.tar.xz
latinime-787bac06031f0f1554785cd4f09ef4e0ec121f5d.zip
Merge "Use separate View for key preview backing"
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index cea59fe0a..191ae5811 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -157,6 +157,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
private Settings.Values mSettingsValues;
+ private View mKeyPreviewBackingView;
private View mSuggestionsContainer;
private int mSuggestionsStripHeight;
private SuggestionsView mSuggestionsView;
@@ -607,6 +608,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
@Override
public void setInputView(View view) {
super.setInputView(view);
+ mKeyPreviewBackingView = view.findViewById(R.id.key_preview_backing);
mSuggestionsContainer = view.findViewById(R.id.suggestions_container);
mSuggestionsView = (SuggestionsView) view.findViewById(R.id.suggestions_view);
if (mSuggestionsView != null)
@@ -945,12 +947,13 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
&& (needsInputViewShown ? mKeyboardSwitcher.isInputViewShown() : true);
if (isFullscreenMode()) {
// No need to have extra space to show the key preview.
- mSuggestionsContainer.setMinimumHeight(0);
+ mKeyPreviewBackingView.setVisibility(View.GONE);
mSuggestionsContainer.setVisibility(
shouldShowSuggestions ? View.VISIBLE : View.GONE);
} else {
// We must control the visibility of the suggestion strip in order to avoid clipped
// key previews, even when we don't show the suggestion strip.
+ mKeyPreviewBackingView.setVisibility(View.VISIBLE);
mSuggestionsContainer.setVisibility(
shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
}
@@ -967,15 +970,17 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
final KeyboardView inputView = mKeyboardSwitcher.getKeyboardView();
if (inputView == null || mSuggestionsContainer == null)
return;
- final int containerHeight = mSuggestionsContainer.getHeight();
- int touchY = containerHeight;
+ final int backingHeight = (mKeyPreviewBackingView.getVisibility() == View.GONE) ? 0
+ : mKeyPreviewBackingView.getHeight();
+ final int extraHeight = mSuggestionsContainer.getHeight() + backingHeight;
+ int touchY = extraHeight;
// Need to set touchable region only if input view is being shown
if (mKeyboardSwitcher.isInputViewShown()) {
if (mSuggestionsContainer.getVisibility() == View.VISIBLE) {
touchY -= mSuggestionsStripHeight;
}
final int touchWidth = inputView.getWidth();
- final int touchHeight = inputView.getHeight() + containerHeight
+ final int touchHeight = inputView.getHeight() + extraHeight
// Extend touchable region below the keyboard.
+ EXTENDED_TOUCHABLE_REGION_HEIGHT;
if (DEBUG) {