aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-10-12 11:02:05 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-12 11:02:05 -0700
commit62fb8a480df325ebc6b2a4dc023a944e3cd0bcef (patch)
treec5ae3905f61d54c5ec1c5312d77025f588aeb8d3 /java/src
parentef0a7b75462c75b756caa09d9dd356309968abf3 (diff)
parentd44647e76f286256515ddac8cfc1ab29a2cbcf82 (diff)
downloadlatinime-62fb8a480df325ebc6b2a4dc023a944e3cd0bcef.tar.gz
latinime-62fb8a480df325ebc6b2a4dc023a944e3cd0bcef.tar.xz
latinime-62fb8a480df325ebc6b2a4dc023a944e3cd0bcef.zip
Merge "Take invisible extractArea height into account" into ics-mr0
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 3c878d0a8..2c4b34f4d 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -160,6 +160,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
private Settings.Values mSettingsValues;
+ private View mExtractArea;
private View mKeyPreviewBackingView;
private View mSuggestionsContainer;
private SuggestionsView mSuggestionsView;
@@ -642,6 +643,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
@Override
public void setInputView(View view) {
super.setInputView(view);
+ mExtractArea = getWindow().getWindow().getDecorView()
+ .findViewById(android.R.id.extractArea);
mKeyPreviewBackingView = view.findViewById(R.id.key_preview_backing);
mSuggestionsContainer = view.findViewById(R.id.suggestions_container);
mSuggestionsView = (SuggestionsView) view.findViewById(R.id.suggestions_view);
@@ -1005,11 +1008,15 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
final KeyboardView inputView = mKeyboardSwitcher.getKeyboardView();
if (inputView == null || mSuggestionsContainer == null)
return;
+ // In fullscreen mode, the height of the extract area managed by InputMethodService should
+ // be considered.
+ // See {@link android.inputmethodservice.InputMethodService#onComputeInsets}.
+ final int extractHeight = isFullscreenMode() ? mExtractArea.getHeight() : 0;
final int backingHeight = (mKeyPreviewBackingView.getVisibility() == View.GONE) ? 0
: mKeyPreviewBackingView.getHeight();
final int suggestionsHeight = (mSuggestionsContainer.getVisibility() == View.GONE) ? 0
: mSuggestionsContainer.getHeight();
- final int extraHeight = backingHeight + suggestionsHeight;
+ final int extraHeight = extractHeight + backingHeight + suggestionsHeight;
int touchY = extraHeight;
// Need to set touchable region only if input view is being shown
if (mKeyboardSwitcher.isInputViewShown()) {
@@ -1050,9 +1057,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
super.updateFullscreenMode();
if (mKeyPreviewBackingView == null) return;
- // In fullscreen mode, no need to have extra space to show the key preview.
+ // In extract mode, no need to have extra space to show the key preview.
// If not, we should have extra space above the keyboard to show the key preview.
- mKeyPreviewBackingView.setVisibility(isFullscreenMode() ? View.GONE : View.VISIBLE);
+ mKeyPreviewBackingView.setVisibility(isExtractViewShown() ? View.GONE : View.VISIBLE);
}
@Override