diff options
author | Abhisek Devkota <ciwrl@cyanogenmod.com> | 2014-05-07 19:51:05 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2014-05-07 19:51:05 +0000 |
commit | 8d5498eb9450d942faea0fe0b2f31e252a0d08cb (patch) | |
tree | f6cf5990aa5d4305a70d2bbd0a290f9332e8f0e3 | |
parent | f5dbfc96fe2b1e5e9d3f45d5e4dbe93cd3cfc70d (diff) | |
parent | 9ad492a68916ab44037ac02303af99f6889ceb28 (diff) | |
download | android_packages_inputmethods_LatinIME-8d5498eb9450d942faea0fe0b2f31e252a0d08cb.tar.gz android_packages_inputmethods_LatinIME-8d5498eb9450d942faea0fe0b2f31e252a0d08cb.tar.bz2 android_packages_inputmethods_LatinIME-8d5498eb9450d942faea0fe0b2f31e252a0d08cb.zip |
Merge "LatinIME: Add a configuration for preview view transient test" into cm-11.0
-rw-r--r-- | java/res/values/config.xml | 4 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/MainKeyboardView.java | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/java/res/values/config.xml b/java/res/values/config.xml index 61779d4b5..41e47abb5 100644 --- a/java/res/values/config.xml +++ b/java/res/values/config.xml @@ -134,4 +134,8 @@ <bool name="display_notification_for_auto_update">false</bool> <bool name="display_notification_for_user_requested_update">false</bool> + <!-- Fraction of the display height to use to determine whether or not the + current keyboard position is still in a transient state and therefore we + should defer displaying preview views such --> + <integer name="config_custom_keyboard_coordinate_fraction">4</integer> </resources> diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java index 13db47004..0122bea44 100644 --- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java @@ -20,6 +20,7 @@ import android.animation.AnimatorInflater; import android.animation.ObjectAnimator; import android.content.Context; import android.content.SharedPreferences; +import android.content.res.Resources; import android.content.pm.PackageManager; import android.content.res.TypedArray; import android.graphics.Canvas; @@ -148,6 +149,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack private int mAltCodeKeyWhileTypingAnimAlpha = Constants.Color.ALPHA_OPAQUE; // Preview placer view + private final int mCustomKeyboardCoordinateFraction; private final PreviewPlacerView mPreviewPlacerView; private final int[] mOriginCoords = CoordinateUtils.newInstance(); private final GestureFloatingPreviewText mGestureFloatingPreviewText; @@ -434,6 +436,10 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack mNonDistinctMultitouchHelper = hasDistinctMultitouch ? null : new NonDistinctMultitouchHelper(); + final Resources res = context.getResources(); + mCustomKeyboardCoordinateFraction = res.getInteger( + R.integer.config_custom_keyboard_coordinate_fraction); + mPreviewPlacerView = new PreviewPlacerView(context, attrs); final TypedArray mainKeyboardViewAttr = context.obtainStyledAttributes( @@ -653,7 +659,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack } getLocationInWindow(mOriginCoords); final DisplayMetrics dm = getResources().getDisplayMetrics(); - if (CoordinateUtils.y(mOriginCoords) < dm.heightPixels / 4) { + if (CoordinateUtils.y(mOriginCoords) < dm.heightPixels / mCustomKeyboardCoordinateFraction) { // In transient state. return; } |