aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-09-02 21:03:18 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-09-03 01:36:26 +0900
commitabb0c77af15a22b5d0953e477da8747cd5f2259d (patch)
tree006eef1f380f3a4de35238f744303d90b3c44a19 /java/src
parentf2bd8a07bb881fb60aab368e7cc3cde30cd7afa8 (diff)
downloadlatinime-abb0c77af15a22b5d0953e477da8747cd5f2259d.tar.gz
latinime-abb0c77af15a22b5d0953e477da8747cd5f2259d.tar.xz
latinime-abb0c77af15a22b5d0953e477da8747cd5f2259d.zip
Use separate View for key preview backing
Bug: 5246982 Change-Id: Icec4281cb01771909fcece36647ee42ba179118c
Diffstat (limited to 'java/src')
-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) {