Merge "Reducing the click delay while screen magnification is enabled." into jb-mr1-dev

This commit is contained in:
Svetoslav Ganov
2012-09-10 17:41:28 -07:00
committed by Android (Google) Code Review

View File

@@ -128,6 +128,8 @@ public final class ScreenMagnifier implements EventStreamTransformation {
private static final int DEFAULT_SCREEN_MAGNIFICATION_AUTO_UPDATE = 1; private static final int DEFAULT_SCREEN_MAGNIFICATION_AUTO_UPDATE = 1;
private static final float DEFAULT_WINDOW_ANIMATION_SCALE = 1.0f; private static final float DEFAULT_WINDOW_ANIMATION_SCALE = 1.0f;
private static final int MULTI_TAP_TIME_SLOP_ADJUSTMENT = 50;
private final IWindowManager mWindowManagerService = IWindowManager.Stub.asInterface( private final IWindowManager mWindowManagerService = IWindowManager.Stub.asInterface(
ServiceManager.getService("window")); ServiceManager.getService("window"));
private final WindowManager mWindowManager; private final WindowManager mWindowManager;
@@ -145,7 +147,8 @@ public final class ScreenMagnifier implements EventStreamTransformation {
private final Viewport mViewport; private final Viewport mViewport;
private final int mTapTimeSlop = ViewConfiguration.getTapTimeout(); private final int mTapTimeSlop = ViewConfiguration.getTapTimeout();
private final int mMultiTapTimeSlop = ViewConfiguration.getDoubleTapTimeout(); private final int mMultiTapTimeSlop =
ViewConfiguration.getDoubleTapTimeout() - MULTI_TAP_TIME_SLOP_ADJUSTMENT;
private final int mTapDistanceSlop; private final int mTapDistanceSlop;
private final int mMultiTapDistanceSlop; private final int mMultiTapDistanceSlop;
@@ -617,7 +620,7 @@ public final class ScreenMagnifier implements EventStreamTransformation {
} else if (mTapCount < ACTION_TAP_COUNT) { } else if (mTapCount < ACTION_TAP_COUNT) {
Message message = mHandler.obtainMessage( Message message = mHandler.obtainMessage(
MESSAGE_TRANSITION_TO_DELEGATING_STATE); MESSAGE_TRANSITION_TO_DELEGATING_STATE);
mHandler.sendMessageDelayed(message, mTapTimeSlop + mMultiTapDistanceSlop); mHandler.sendMessageDelayed(message, mMultiTapTimeSlop);
} }
clearLastDownEvent(); clearLastDownEvent();
mLastDownEvent = MotionEvent.obtain(event); mLastDownEvent = MotionEvent.obtain(event);