Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java +14 −0 Original line number Diff line number Diff line Loading @@ -21,7 +21,9 @@ import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; import android.annotation.IntDef; import android.content.Context; import android.content.res.Resources; import android.view.ViewConfiguration; import android.view.WindowManagerPolicyConstants; import com.android.internal.policy.ScreenDecorationsUtils; Loading Loading @@ -100,6 +102,18 @@ public class QuickStepContract { return str.toString(); } /** * Ratio of quickstep touch slop (when system takes over the touch) to view touch slop */ public static final float QUICKSTEP_TOUCH_SLOP_RATIO = 3; /** * Touch slop for quickstep gesture */ public static final float getQuickStepTouchSlopPx(Context context) { return QUICKSTEP_TOUCH_SLOP_RATIO * ViewConfiguration.get(context).getScaledTouchSlop(); } /** * Touch slopes and thresholds for quick step operations. Drag slop is the point where the * home button press/long press over are ignored and will start to drag when exceeded and the Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +2 −7 Original line number Diff line number Diff line Loading @@ -249,13 +249,8 @@ public class KeyButtonView extends ImageView implements ButtonInterface { x = (int)ev.getRawX(); y = (int)ev.getRawY(); boolean exceededTouchSlopX = Math.abs(x - mTouchDownX) > (mIsVertical ? QuickStepContract.getQuickScrubTouchSlopPx() : QuickStepContract.getQuickStepTouchSlopPx()); boolean exceededTouchSlopY = Math.abs(y - mTouchDownY) > (mIsVertical ? QuickStepContract.getQuickStepTouchSlopPx() : QuickStepContract.getQuickScrubTouchSlopPx()); if (exceededTouchSlopX || exceededTouchSlopY) { float slop = QuickStepContract.getQuickStepTouchSlopPx(getContext()); if (Math.abs(x - mTouchDownX) > slop || Math.abs(y - mTouchDownY) > slop) { // When quick step is enabled, prevent animating the ripple triggered by // setPressed and decide to run it on touch up setPressed(false); Loading Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java +14 −0 Original line number Diff line number Diff line Loading @@ -21,7 +21,9 @@ import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; import android.annotation.IntDef; import android.content.Context; import android.content.res.Resources; import android.view.ViewConfiguration; import android.view.WindowManagerPolicyConstants; import com.android.internal.policy.ScreenDecorationsUtils; Loading Loading @@ -100,6 +102,18 @@ public class QuickStepContract { return str.toString(); } /** * Ratio of quickstep touch slop (when system takes over the touch) to view touch slop */ public static final float QUICKSTEP_TOUCH_SLOP_RATIO = 3; /** * Touch slop for quickstep gesture */ public static final float getQuickStepTouchSlopPx(Context context) { return QUICKSTEP_TOUCH_SLOP_RATIO * ViewConfiguration.get(context).getScaledTouchSlop(); } /** * Touch slopes and thresholds for quick step operations. Drag slop is the point where the * home button press/long press over are ignored and will start to drag when exceeded and the Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +2 −7 Original line number Diff line number Diff line Loading @@ -249,13 +249,8 @@ public class KeyButtonView extends ImageView implements ButtonInterface { x = (int)ev.getRawX(); y = (int)ev.getRawY(); boolean exceededTouchSlopX = Math.abs(x - mTouchDownX) > (mIsVertical ? QuickStepContract.getQuickScrubTouchSlopPx() : QuickStepContract.getQuickStepTouchSlopPx()); boolean exceededTouchSlopY = Math.abs(y - mTouchDownY) > (mIsVertical ? QuickStepContract.getQuickStepTouchSlopPx() : QuickStepContract.getQuickScrubTouchSlopPx()); if (exceededTouchSlopX || exceededTouchSlopY) { float slop = QuickStepContract.getQuickStepTouchSlopPx(getContext()); if (Math.abs(x - mTouchDownX) > slop || Math.abs(y - mTouchDownY) > slop) { // When quick step is enabled, prevent animating the ripple triggered by // setPressed and decide to run it on touch up setPressed(false); Loading