aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorAndy Wang <andywang@google.com>2014-12-02 13:01:11 +0900
committerAndy Wang <andywang@google.com>2014-12-05 16:21:20 +0900
commit8584db1461d286f8eb966c40eb0bc76e8c9df76a (patch)
tree702f83d695aa9d3e4e4ee319d66ad8453c08b022 /java/src/com/android/inputmethod/latin/LatinIME.java
parentd21db3cf617ce3f3d05bfb7d555338994d3c8c3c (diff)
downloadlatinime-8584db1461d286f8eb966c40eb0bc76e8c9df76a.tar.gz
latinime-8584db1461d286f8eb966c40eb0bc76e8c9df76a.tar.xz
latinime-8584db1461d286f8eb966c40eb0bc76e8c9df76a.zip
Add keyboard margin options to place the keyboard dynamically.
Keyboard location and location can now be set in the debug options section. Change-Id: I87c5a1d679489e12dccf26632c399af28087629e
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 44dffa44e..e20ec88fa 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -100,6 +100,7 @@ import com.android.inputmethod.latin.utils.ImportantNoticeUtils;
import com.android.inputmethod.latin.utils.IntentUtils;
import com.android.inputmethod.latin.utils.JniUtils;
import com.android.inputmethod.latin.utils.LeakGuardHandlerWrapper;
+import com.android.inputmethod.latin.utils.ResourceUtils;
import com.android.inputmethod.latin.utils.StatsUtils;
import com.android.inputmethod.latin.utils.StatsUtilsManager;
import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
@@ -1211,6 +1212,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return;
}
final SettingsValues settingsValues = mSettings.getCurrent();
+ final Resources res = getResources();
final View visibleKeyboardView = mKeyboardSwitcher.getVisibleKeyboardView();
if (visibleKeyboardView == null || !hasSuggestionStripView()) {
return;
@@ -1228,13 +1230,15 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final int suggestionsHeight = (!mKeyboardSwitcher.isShowingEmojiPalettes()
&& mSuggestionStripView.getVisibility() == View.VISIBLE)
? mSuggestionStripView.getHeight() : 0;
- final int visibleTopY = inputHeight - visibleKeyboardView.getHeight() - suggestionsHeight;
+ final int visibleTopY = inputHeight
+ - ResourceUtils.getKeyboardFrameHeight(res, settingsValues)
+ - suggestionsHeight;
mSuggestionStripView.setMoreSuggestionsHeight(visibleTopY);
// Need to set expanded touchable region only if a keyboard view is being shown.
if (visibleKeyboardView.isShown()) {
final int touchLeft = 0;
final int touchTop = mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
- final int touchRight = visibleKeyboardView.getWidth();
+ final int touchRight = ResourceUtils.getKeyboardFrameWidth(res);
final int touchBottom = inputHeight
// Extend touchable region below the keyboard.
+ EXTENDED_TOUCHABLE_REGION_HEIGHT;