日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

android 手势识别 (缩放 单指滑动 多指滑动)

發(fā)布時(shí)間:2024/1/8 50 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android 手势识别 (缩放 单指滑动 多指滑动) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Android P 手勢識別

  • 1、前提介紹:
  • 2、單指相關(guān)
  • 2、雙指縮放
  • 3、多指滑動(dòng)。
  • 4、總體識別代碼

1、前提介紹:

關(guān)于Android 手勢識別就是當(dāng)前view 根據(jù)用戶的不同touch行為,給出不同的處理結(jié)果。這里我介紹一下我自己做的一些手勢識別如下。

2、單指相關(guān)

2.1 單指點(diǎn)擊、長按、拖動(dòng)、左滑、右滑、上滑、下滑,在frameworks/base/core/java/android/view/GestureDetector.java Android原生代碼就已經(jīng)實(shí)現(xiàn)了。我們使用的時(shí)候只需要繼承 SimpleOnGestureListener class,然后通過調(diào)用 new GestureDetector(context, new SimpleGesture(), null, true /* ignoreMultitouch */); 的時(shí)候?qū)⒗^承自 SimpleOnGestureListener 的class 作為參數(shù)傳遞給GestureDetector就可以了。

/** Copyright (C) 2008 The Android Open Source Project** Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/package android.view;import android.content.Context; import android.os.Handler; import android.os.Message;/*** Detects various gestures and events using the supplied {@link MotionEvent}s.* The {@link OnGestureListener} callback will notify users when a particular* motion event has occurred. This class should only be used with {@link MotionEvent}s* reported via touch (don't use for trackball events).** To use this class:* <ul>* <li>Create an instance of the {@code GestureDetector} for your {@link View}* <li>In the {@link View#onTouchEvent(MotionEvent)} method ensure you call* {@link #onTouchEvent(MotionEvent)}. The methods defined in your callback* will be executed when the events occur.* <li>If listening for {@link OnContextClickListener#onContextClick(MotionEvent)}* you must call {@link #onGenericMotionEvent(MotionEvent)}* in {@link View#onGenericMotionEvent(MotionEvent)}.* </ul>*/ public class GestureDetector {/*** The listener that is used to notify when gestures occur.* If you want to listen for all the different gestures then implement* this interface. If you only want to listen for a subset it might* be easier to extend {@link SimpleOnGestureListener}.*/public interface OnGestureListener {/*** Notified when a tap occurs with the down {@link MotionEvent}* that triggered it. This will be triggered immediately for* every down event. All other events should be preceded by this.** @param e The down motion event.*/boolean onDown(MotionEvent e); // 接收down事件/*** The user has performed a down {@link MotionEvent} and not performed* a move or up yet. This event is commonly used to provide visual* feedback to the user to let them know that their action has been* recognized i.e. highlight an element.** @param e The down motion event*/void onShowPress(MotionEvent e); /*** Notified when a tap occurs with the up {@link MotionEvent}* that triggered it.** @param e The up motion event that completed the first tap* @return true if the event is consumed, else false*/boolean onSingleTapUp(MotionEvent e);/*** Notified when a scroll occurs with the initial on down {@link MotionEvent} and the* current move {@link MotionEvent}. The distance in x and y is also supplied for* convenience.** @param e1 The first down motion event that started the scrolling.* @param e2 The move motion event that triggered the current onScroll.* @param distanceX The distance along the X axis that has been scrolled since the last* call to onScroll. This is NOT the distance between {@code e1}* and {@code e2}.* @param distanceY The distance along the Y axis that has been scrolled since the last* call to onScroll. This is NOT the distance between {@code e1}* and {@code e2}.* @return true if the event is consumed, else false*/boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY);//通過這個(gè)方法可以監(jiān)聽拖動(dòng)事件/*** Notified when a long press occurs with the initial on down {@link MotionEvent}* that trigged it.** @param e The initial on down motion event that started the longpress.*/void onLongPress(MotionEvent e); // 通過這個(gè)方法可以監(jiān)聽長按事件,長按的時(shí)間可以通過Android提供的接口來設(shè)定/*** Notified of a fling event when it occurs with the initial on down {@link MotionEvent}* and the matching up {@link MotionEvent}. The calculated velocity is supplied along* the x and y axis in pixels per second.** @param e1 The first down motion event that started the fling.* @param e2 The move motion event that triggered the current onFling.* @param velocityX The velocity of this fling measured in pixels per second* along the x axis.* @param velocityY The velocity of this fling measured in pixels per second* along the y axis.* @return true if the event is consumed, else false*/boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY); // 通過這個(gè)方法判斷滑動(dòng),上面的onScroll是提供實(shí)時(shí)的,這個(gè)onFling是判斷滑動(dòng)結(jié)果的。}/*** The listener that is used to notify when a double-tap or a confirmed* single-tap occur.*/public interface OnDoubleTapListener {/*** Notified when a single-tap occurs.* <p>* Unlike {@link OnGestureListener#onSingleTapUp(MotionEvent)}, this* will only be called after the detector is confident that the user's* first tap is not followed by a second tap leading to a double-tap* gesture.** @param e The down motion event of the single-tap.* @return true if the event is consumed, else false*/boolean onSingleTapConfirmed(MotionEvent e); // 點(diǎn)擊的確認(rèn)/*** Notified when a double-tap occurs.** @param e The down motion event of the first tap of the double-tap.* @return true if the event is consumed, else false*/boolean onDoubleTap(MotionEvent e); // 雙擊,只通知雙擊結(jié)果/*** Notified when an event within a double-tap gesture occurs, including* the down, move, and up events.** @param e The motion event that occurred during the double-tap gesture.* @return true if the event is consumed, else false*/boolean onDoubleTapEvent(MotionEvent e); // 這個(gè)也是雙擊,但是包括了雙擊的 down, move, and up events.我理解就是第二次touch的 down, move, and up events}/*** The listener that is used to notify when a context click occurs. When listening for a* context click ensure that you call {@link #onGenericMotionEvent(MotionEvent)} in* {@link View#onGenericMotionEvent(MotionEvent)}.*/public interface OnContextClickListener {/*** Notified when a context click occurs.** @param e The motion event that occurred during the context click.* @return true if the event is consumed, else false*/boolean onContextClick(MotionEvent e);}/*** A convenience class to extend when you only want to listen for a subset* of all the gestures. This implements all methods in the* {@link OnGestureListener}, {@link OnDoubleTapListener}, and {@link OnContextClickListener}* but does nothing and return {@code false} for all applicable methods.*/這個(gè)class就是我們說的,繼承了OnGestureListener, OnDoubleTapListener,實(shí)現(xiàn)了單指的基本功能。public static class SimpleOnGestureListener implements OnGestureListener, OnDoubleTapListener,OnContextClickListener {public boolean onSingleTapUp(MotionEvent e) {return false;}public void onLongPress(MotionEvent e) {}public boolean onScroll(MotionEvent e1, MotionEvent e2,float distanceX, float distanceY) {return false;}public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,float velocityY) {return false;}public void onShowPress(MotionEvent e) {}public boolean onDown(MotionEvent e) {return false;}public boolean onDoubleTap(MotionEvent e) {return false;}public boolean onDoubleTapEvent(MotionEvent e) {return false;}public boolean onSingleTapConfirmed(MotionEvent e) {return false;}public boolean onContextClick(MotionEvent e) {return false;}}private int mTouchSlopSquare;private int mDoubleTapTouchSlopSquare;private int mDoubleTapSlopSquare;private int mMinimumFlingVelocity;private int mMaximumFlingVelocity;private static final int LONGPRESS_TIMEOUT = ViewConfiguration.getLongPressTimeout();private static final int TAP_TIMEOUT = ViewConfiguration.getTapTimeout();private static final int DOUBLE_TAP_TIMEOUT = ViewConfiguration.getDoubleTapTimeout();private static final int DOUBLE_TAP_MIN_TIME = ViewConfiguration.getDoubleTapMinTime();// constants for Message.what used by GestureHandler belowprivate static final int SHOW_PRESS = 1;private static final int LONG_PRESS = 2;private static final int TAP = 3;private final Handler mHandler;private final OnGestureListener mListener;private OnDoubleTapListener mDoubleTapListener;private OnContextClickListener mContextClickListener;private boolean mStillDown;private boolean mDeferConfirmSingleTap;private boolean mInLongPress;private boolean mInContextClick;private boolean mAlwaysInTapRegion;private boolean mAlwaysInBiggerTapRegion;private boolean mIgnoreNextUpEvent;private MotionEvent mCurrentDownEvent;private MotionEvent mPreviousUpEvent;/*** True when the user is still touching for the second tap (down, move, and* up events). Can only be true if there is a double tap listener attached.*/private boolean mIsDoubleTapping;private float mLastFocusX;private float mLastFocusY;private float mDownFocusX;private float mDownFocusY;private boolean mIsLongpressEnabled;/*** Determines speed during touch scrolling*/private VelocityTracker mVelocityTracker;/*** Consistency verifier for debugging purposes.*/private final InputEventConsistencyVerifier mInputEventConsistencyVerifier =InputEventConsistencyVerifier.isInstrumentationEnabled() ?new InputEventConsistencyVerifier(this, 0) : null;private class GestureHandler extends Handler {GestureHandler() {super();}GestureHandler(Handler handler) {super(handler.getLooper());}@Overridepublic void handleMessage(Message msg) {switch (msg.what) {case SHOW_PRESS:mListener.onShowPress(mCurrentDownEvent);break;case LONG_PRESS:dispatchLongPress();break;case TAP:// If the user's finger is still down, do not count it as a tapif (mDoubleTapListener != null) {if (!mStillDown) {mDoubleTapListener.onSingleTapConfirmed(mCurrentDownEvent);} else {mDeferConfirmSingleTap = true;}}break;default:throw new RuntimeException("Unknown message " + msg); //never}}}/*** Creates a GestureDetector with the supplied listener.* This variant of the constructor should be used from a non-UI thread * (as it allows specifying the Handler).* * @param listener the listener invoked for all the callbacks, this must* not be null.* @param handler the handler to use** @throws NullPointerException if either {@code listener} or* {@code handler} is null.** @deprecated Use {@link #GestureDetector(android.content.Context,* android.view.GestureDetector.OnGestureListener, android.os.Handler)} instead.*/@Deprecatedpublic GestureDetector(OnGestureListener listener, Handler handler) {this(null, listener, handler);}/*** Creates a GestureDetector with the supplied listener.* You may only use this constructor from a UI thread (this is the usual situation).* @see android.os.Handler#Handler()* * @param listener the listener invoked for all the callbacks, this must* not be null.* * @throws NullPointerException if {@code listener} is null.** @deprecated Use {@link #GestureDetector(android.content.Context,* android.view.GestureDetector.OnGestureListener)} instead.*/@Deprecatedpublic GestureDetector(OnGestureListener listener) {this(null, listener, null);}/*** Creates a GestureDetector with the supplied listener.* You may only use this constructor from a {@link android.os.Looper} thread.* @see android.os.Handler#Handler()** @param context the application's context* @param listener the listener invoked for all the callbacks, this must* not be null.** @throws NullPointerException if {@code listener} is null.*/public GestureDetector(Context context, OnGestureListener listener) {this(context, listener, null);}/*** Creates a GestureDetector with the supplied listener that runs deferred events on the* thread associated with the supplied {@link android.os.Handler}.* @see android.os.Handler#Handler()** @param context the application's context* @param listener the listener invoked for all the callbacks, this must* not be null.* @param handler the handler to use for running deferred listener events.** @throws NullPointerException if {@code listener} is null.*/public GestureDetector(Context context, OnGestureListener listener, Handler handler) {if (handler != null) {mHandler = new GestureHandler(handler);} else {mHandler = new GestureHandler();}mListener = listener;if (listener instanceof OnDoubleTapListener) {setOnDoubleTapListener((OnDoubleTapListener) listener);}if (listener instanceof OnContextClickListener) {setContextClickListener((OnContextClickListener) listener);}init(context);}/*** Creates a GestureDetector with the supplied listener that runs deferred events on the* thread associated with the supplied {@link android.os.Handler}.* @see android.os.Handler#Handler()** @param context the application's context* @param listener the listener invoked for all the callbacks, this must* not be null.* @param handler the handler to use for running deferred listener events.* @param unused currently not used.** @throws NullPointerException if {@code listener} is null.*/public GestureDetector(Context context, OnGestureListener listener, Handler handler,boolean unused) {this(context, listener, handler);}private void init(Context context) {if (mListener == null) {throw new NullPointerException("OnGestureListener must not be null");}mIsLongpressEnabled = true;// Fallback to support pre-donuts releasesint touchSlop, doubleTapSlop, doubleTapTouchSlop;if (context == null) {//noinspection deprecationtouchSlop = ViewConfiguration.getTouchSlop();doubleTapTouchSlop = touchSlop; // Hack rather than adding a hiden method for thisdoubleTapSlop = ViewConfiguration.getDoubleTapSlop();//noinspection deprecationmMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();} else {final ViewConfiguration configuration = ViewConfiguration.get(context);touchSlop = configuration.getScaledTouchSlop();doubleTapTouchSlop = configuration.getScaledDoubleTapTouchSlop();doubleTapSlop = configuration.getScaledDoubleTapSlop();mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();}mTouchSlopSquare = touchSlop * touchSlop;mDoubleTapTouchSlopSquare = doubleTapTouchSlop * doubleTapTouchSlop;mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;}/*** Sets the listener which will be called for double-tap and related* gestures.* * @param onDoubleTapListener the listener invoked for all the callbacks, or* null to stop listening for double-tap gestures.*/public void setOnDoubleTapListener(OnDoubleTapListener onDoubleTapListener) {mDoubleTapListener = onDoubleTapListener;}/*** Sets the listener which will be called for context clicks.** @param onContextClickListener the listener invoked for all the callbacks, or null to stop* listening for context clicks.*/public void setContextClickListener(OnContextClickListener onContextClickListener) {mContextClickListener = onContextClickListener;}/*** Set whether longpress is enabled, if this is enabled when a user* presses and holds down you get a longpress event and nothing further.* If it's disabled the user can press and hold down and then later* moved their finger and you will get scroll events. By default* longpress is enabled.** @param isLongpressEnabled whether longpress should be enabled.*/public void setIsLongpressEnabled(boolean isLongpressEnabled) {mIsLongpressEnabled = isLongpressEnabled;}/*** @return true if longpress is enabled, else false.*/public boolean isLongpressEnabled() {return mIsLongpressEnabled;}/*** Analyzes the given motion event and if applicable triggers the* appropriate callbacks on the {@link OnGestureListener} supplied.** @param ev The current motion event.* @return true if the {@link OnGestureListener} consumed the event,* else false.*/public boolean onTouchEvent(MotionEvent ev) {if (mInputEventConsistencyVerifier != null) {mInputEventConsistencyVerifier.onTouchEvent(ev, 0);}final int action = ev.getAction();if (mVelocityTracker == null) {mVelocityTracker = VelocityTracker.obtain();}mVelocityTracker.addMovement(ev);final boolean pointerUp =(action & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_POINTER_UP;final int skipIndex = pointerUp ? ev.getActionIndex() : -1;final boolean isGeneratedGesture =(ev.getFlags() & MotionEvent.FLAG_IS_GENERATED_GESTURE) != 0;// Determine focal pointfloat sumX = 0, sumY = 0;final int count = ev.getPointerCount();for (int i = 0; i < count; i++) {if (skipIndex == i) continue;sumX += ev.getX(i);sumY += ev.getY(i);}final int div = pointerUp ? count - 1 : count;final float focusX = sumX / div;final float focusY = sumY / div;boolean handled = false;switch (action & MotionEvent.ACTION_MASK) {case MotionEvent.ACTION_POINTER_DOWN:mDownFocusX = mLastFocusX = focusX;mDownFocusY = mLastFocusY = focusY;// Cancel long press and tapscancelTaps();break;case MotionEvent.ACTION_POINTER_UP:mDownFocusX = mLastFocusX = focusX;mDownFocusY = mLastFocusY = focusY;// Check the dot product of current velocities.// If the pointer that left was opposing another velocity vector, clear.mVelocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity);final int upIndex = ev.getActionIndex();final int id1 = ev.getPointerId(upIndex);final float x1 = mVelocityTracker.getXVelocity(id1);final float y1 = mVelocityTracker.getYVelocity(id1);for (int i = 0; i < count; i++) {if (i == upIndex) continue;final int id2 = ev.getPointerId(i);final float x = x1 * mVelocityTracker.getXVelocity(id2);final float y = y1 * mVelocityTracker.getYVelocity(id2);final float dot = x + y;if (dot < 0) {mVelocityTracker.clear();break;}}break;case MotionEvent.ACTION_DOWN:if (mDoubleTapListener != null) {boolean hadTapMessage = mHandler.hasMessages(TAP);if (hadTapMessage) mHandler.removeMessages(TAP);if ((mCurrentDownEvent != null) && (mPreviousUpEvent != null)&& hadTapMessage&& isConsideredDoubleTap(mCurrentDownEvent, mPreviousUpEvent, ev)) {// This is a second tapmIsDoubleTapping = true;// Give a callback with the first tap of the double-taphandled |= mDoubleTapListener.onDoubleTap(mCurrentDownEvent);// Give a callback with down event of the double-taphandled |= mDoubleTapListener.onDoubleTapEvent(ev);} else {// This is a first tapmHandler.sendEmptyMessageDelayed(TAP, DOUBLE_TAP_TIMEOUT);}}mDownFocusX = mLastFocusX = focusX;mDownFocusY = mLastFocusY = focusY;if (mCurrentDownEvent != null) {mCurrentDownEvent.recycle();}mCurrentDownEvent = MotionEvent.obtain(ev);mAlwaysInTapRegion = true;mAlwaysInBiggerTapRegion = true;mStillDown = true;mInLongPress = false;mDeferConfirmSingleTap = false;if (mIsLongpressEnabled) {mHandler.removeMessages(LONG_PRESS);mHandler.sendEmptyMessageAtTime(LONG_PRESS,mCurrentDownEvent.getDownTime() + LONGPRESS_TIMEOUT);}mHandler.sendEmptyMessageAtTime(SHOW_PRESS,mCurrentDownEvent.getDownTime() + TAP_TIMEOUT);handled |= mListener.onDown(ev);break;case MotionEvent.ACTION_MOVE:if (mInLongPress || mInContextClick) {break;}final float scrollX = mLastFocusX - focusX;final float scrollY = mLastFocusY - focusY;if (mIsDoubleTapping) {// Give the move events of the double-taphandled |= mDoubleTapListener.onDoubleTapEvent(ev);} else if (mAlwaysInTapRegion) {final int deltaX = (int) (focusX - mDownFocusX);final int deltaY = (int) (focusY - mDownFocusY);int distance = (deltaX * deltaX) + (deltaY * deltaY);int slopSquare = isGeneratedGesture ? 0 : mTouchSlopSquare;if (distance > slopSquare) {handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY);mLastFocusX = focusX;mLastFocusY = focusY;mAlwaysInTapRegion = false;mHandler.removeMessages(TAP);mHandler.removeMessages(SHOW_PRESS);mHandler.removeMessages(LONG_PRESS);}int doubleTapSlopSquare = isGeneratedGesture ? 0 : mDoubleTapTouchSlopSquare;if (distance > doubleTapSlopSquare) {mAlwaysInBiggerTapRegion = false;}} else if ((Math.abs(scrollX) >= 1) || (Math.abs(scrollY) >= 1)) {handled = mListener.onScroll(mCurrentDownEvent, ev, scrollX, scrollY);mLastFocusX = focusX;mLastFocusY = focusY;}break;case MotionEvent.ACTION_UP:mStillDown = false;MotionEvent currentUpEvent = MotionEvent.obtain(ev);if (mIsDoubleTapping) {// Finally, give the up event of the double-taphandled |= mDoubleTapListener.onDoubleTapEvent(ev);} else if (mInLongPress) {mHandler.removeMessages(TAP);mInLongPress = false;} else if (mAlwaysInTapRegion && !mIgnoreNextUpEvent) {handled = mListener.onSingleTapUp(ev);if (mDeferConfirmSingleTap && mDoubleTapListener != null) {mDoubleTapListener.onSingleTapConfirmed(ev);}} else if (!mIgnoreNextUpEvent) {// A fling must travel the minimum tap distancefinal VelocityTracker velocityTracker = mVelocityTracker;final int pointerId = ev.getPointerId(0);velocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity);final float velocityY = velocityTracker.getYVelocity(pointerId);final float velocityX = velocityTracker.getXVelocity(pointerId);if ((Math.abs(velocityY) > mMinimumFlingVelocity)|| (Math.abs(velocityX) > mMinimumFlingVelocity)) {handled = mListener.onFling(mCurrentDownEvent, ev, velocityX, velocityY);}}if (mPreviousUpEvent != null) {mPreviousUpEvent.recycle();}// Hold the event we obtained above - listeners may have changed the original.mPreviousUpEvent = currentUpEvent;if (mVelocityTracker != null) {// This may have been cleared when we called out to the// application above.mVelocityTracker.recycle();mVelocityTracker = null;}mIsDoubleTapping = false;mDeferConfirmSingleTap = false;mIgnoreNextUpEvent = false;mHandler.removeMessages(SHOW_PRESS);mHandler.removeMessages(LONG_PRESS);break;case MotionEvent.ACTION_CANCEL:cancel();break;}if (!handled && mInputEventConsistencyVerifier != null) {mInputEventConsistencyVerifier.onUnhandledEvent(ev, 0);}return handled;}/*** Analyzes the given generic motion event and if applicable triggers the* appropriate callbacks on the {@link OnGestureListener} supplied.** @param ev The current motion event.* @return true if the {@link OnGestureListener} consumed the event,* else false.*/public boolean onGenericMotionEvent(MotionEvent ev) {if (mInputEventConsistencyVerifier != null) {mInputEventConsistencyVerifier.onGenericMotionEvent(ev, 0);}final int actionButton = ev.getActionButton();switch (ev.getActionMasked()) {case MotionEvent.ACTION_BUTTON_PRESS:if (mContextClickListener != null && !mInContextClick && !mInLongPress&& (actionButton == MotionEvent.BUTTON_STYLUS_PRIMARY|| actionButton == MotionEvent.BUTTON_SECONDARY)) {if (mContextClickListener.onContextClick(ev)) {mInContextClick = true;mHandler.removeMessages(LONG_PRESS);mHandler.removeMessages(TAP);return true;}}break;case MotionEvent.ACTION_BUTTON_RELEASE:if (mInContextClick && (actionButton == MotionEvent.BUTTON_STYLUS_PRIMARY|| actionButton == MotionEvent.BUTTON_SECONDARY)) {mInContextClick = false;mIgnoreNextUpEvent = true;}break;}return false;}private void cancel() {mHandler.removeMessages(SHOW_PRESS);mHandler.removeMessages(LONG_PRESS);mHandler.removeMessages(TAP);mVelocityTracker.recycle();mVelocityTracker = null;mIsDoubleTapping = false;mStillDown = false;mAlwaysInTapRegion = false;mAlwaysInBiggerTapRegion = false;mDeferConfirmSingleTap = false;mInLongPress = false;mInContextClick = false;mIgnoreNextUpEvent = false;}private void cancelTaps() {mHandler.removeMessages(SHOW_PRESS);mHandler.removeMessages(LONG_PRESS);mHandler.removeMessages(TAP);mIsDoubleTapping = false;mAlwaysInTapRegion = false;mAlwaysInBiggerTapRegion = false;mDeferConfirmSingleTap = false;mInLongPress = false;mInContextClick = false;mIgnoreNextUpEvent = false;}private boolean isConsideredDoubleTap(MotionEvent firstDown, MotionEvent firstUp,MotionEvent secondDown) {if (!mAlwaysInBiggerTapRegion) {return false;}final long deltaTime = secondDown.getEventTime() - firstUp.getEventTime();if (deltaTime > DOUBLE_TAP_TIMEOUT || deltaTime < DOUBLE_TAP_MIN_TIME) {return false;}int deltaX = (int) firstDown.getX() - (int) secondDown.getX();int deltaY = (int) firstDown.getY() - (int) secondDown.getY();final boolean isGeneratedGesture =(firstDown.getFlags() & MotionEvent.FLAG_IS_GENERATED_GESTURE) != 0;int slopSquare = isGeneratedGesture ? 0 : mDoubleTapSlopSquare;return (deltaX * deltaX + deltaY * deltaY < slopSquare);}private void dispatchLongPress() {mHandler.removeMessages(TAP);mDeferConfirmSingleTap = false;mInLongPress = true;mListener.onLongPress(mCurrentDownEvent);} }

2、雙指縮放

這個(gè)android 原生也實(shí)現(xiàn)了,在 frameworks/base/core/java/android/view/ScaleGestureDetector.java里面。我們用的時(shí)候只需要去實(shí)現(xiàn)ScaleGestureDetector.SimpleOnScaleGestureListener的方法就可以。

/** Copyright (C) 2010 The Android Open Source Project** Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/package android.view;import android.content.Context; import android.content.res.Resources; import android.os.Build; import android.os.Handler;/*** Detects scaling transformation gestures using the supplied {@link MotionEvent}s.* The {@link OnScaleGestureListener} callback will notify users when a particular* gesture event has occurred.** This class should only be used with {@link MotionEvent}s reported via touch.** To use this class:* <ul>* <li>Create an instance of the {@code ScaleGestureDetector} for your* {@link View}* <li>In the {@link View#onTouchEvent(MotionEvent)} method ensure you call* {@link #onTouchEvent(MotionEvent)}. The methods defined in your* callback will be executed when the events occur.* </ul>*/ public class ScaleGestureDetector {private static final String TAG = "ScaleGestureDetector";/*** The listener for receiving notifications when gestures occur.* If you want to listen for all the different gestures then implement* this interface. If you only want to listen for a subset it might* be easier to extend {@link SimpleOnScaleGestureListener}.** An application will receive events in the following order:* <ul>* <li>One {@link OnScaleGestureListener#onScaleBegin(ScaleGestureDetector)}* <li>Zero or more {@link OnScaleGestureListener#onScale(ScaleGestureDetector)}* <li>One {@link OnScaleGestureListener#onScaleEnd(ScaleGestureDetector)}* </ul>*/public interface OnScaleGestureListener {/*** Responds to scaling events for a gesture in progress.* Reported by pointer motion.** @param detector The detector reporting the event - use this to* retrieve extended info about event state.* @return Whether or not the detector should consider this event* as handled. If an event was not handled, the detector* will continue to accumulate movement until an event is* handled. This can be useful if an application, for example,* only wants to update scaling factors if the change is* greater than 0.01.*/public boolean onScale(ScaleGestureDetector detector);/*** Responds to the beginning of a scaling gesture. Reported by* new pointers going down.** @param detector The detector reporting the event - use this to* retrieve extended info about event state.* @return Whether or not the detector should continue recognizing* this gesture. For example, if a gesture is beginning* with a focal point outside of a region where it makes* sense, onScaleBegin() may return false to ignore the* rest of the gesture.*/public boolean onScaleBegin(ScaleGestureDetector detector);/*** Responds to the end of a scale gesture. Reported by existing* pointers going up.** Once a scale has ended, {@link ScaleGestureDetector#getFocusX()}* and {@link ScaleGestureDetector#getFocusY()} will return focal point* of the pointers remaining on the screen.** @param detector The detector reporting the event - use this to* retrieve extended info about event state.*/public void onScaleEnd(ScaleGestureDetector detector);}/*** A convenience class to extend when you only want to listen for a subset* of scaling-related events. This implements all methods in* {@link OnScaleGestureListener} but does nothing.* {@link OnScaleGestureListener#onScale(ScaleGestureDetector)} returns* {@code false} so that a subclass can retrieve the accumulated scale* factor in an overridden onScaleEnd.* {@link OnScaleGestureListener#onScaleBegin(ScaleGestureDetector)} returns* {@code true}.*/public static class SimpleOnScaleGestureListener implements OnScaleGestureListener {public boolean onScale(ScaleGestureDetector detector) { // 縮放的過程return false;}public boolean onScaleBegin(ScaleGestureDetector detector) { // 縮放開始return true;}public void onScaleEnd(ScaleGestureDetector detector) { // 縮放結(jié)束// Intentionally empty}}private final Context mContext;private final OnScaleGestureListener mListener;private float mFocusX;private float mFocusY;private boolean mQuickScaleEnabled;private boolean mStylusScaleEnabled;private float mCurrSpan;private float mPrevSpan;private float mInitialSpan;private float mCurrSpanX;private float mCurrSpanY;private float mPrevSpanX;private float mPrevSpanY;private long mCurrTime;private long mPrevTime;private boolean mInProgress;private int mSpanSlop;private int mMinSpan;private final Handler mHandler;private float mAnchoredScaleStartX;private float mAnchoredScaleStartY;private int mAnchoredScaleMode = ANCHORED_SCALE_MODE_NONE;private static final long TOUCH_STABILIZE_TIME = 128; // msprivate static final float SCALE_FACTOR = .5f;private static final int ANCHORED_SCALE_MODE_NONE = 0;private static final int ANCHORED_SCALE_MODE_DOUBLE_TAP = 1;private static final int ANCHORED_SCALE_MODE_STYLUS = 2;/*** Consistency verifier for debugging purposes.*/private final InputEventConsistencyVerifier mInputEventConsistencyVerifier =InputEventConsistencyVerifier.isInstrumentationEnabled() ?new InputEventConsistencyVerifier(this, 0) : null;private GestureDetector mGestureDetector;private boolean mEventBeforeOrAboveStartingGestureEvent;/*** Creates a ScaleGestureDetector with the supplied listener.* You may only use this constructor from a {@link android.os.Looper Looper} thread.** @param context the application's context* @param listener the listener invoked for all the callbacks, this must* not be null.** @throws NullPointerException if {@code listener} is null.*/public ScaleGestureDetector(Context context, OnScaleGestureListener listener) {this(context, listener, null);}/*** Creates a ScaleGestureDetector with the supplied listener.* @see android.os.Handler#Handler()** @param context the application's context* @param listener the listener invoked for all the callbacks, this must* not be null.* @param handler the handler to use for running deferred listener events.** @throws NullPointerException if {@code listener} is null.*/public ScaleGestureDetector(Context context, OnScaleGestureListener listener,Handler handler) {mContext = context;mListener = listener;mSpanSlop = ViewConfiguration.get(context).getScaledTouchSlop() * 2;final Resources res = context.getResources();mMinSpan = res.getDimensionPixelSize(com.android.internal.R.dimen.config_minScalingSpan);mHandler = handler;// Quick scale is enabled by default after JB_MR2final int targetSdkVersion = context.getApplicationInfo().targetSdkVersion;if (targetSdkVersion > Build.VERSION_CODES.JELLY_BEAN_MR2) {setQuickScaleEnabled(true);}// Stylus scale is enabled by default after LOLLIPOP_MR1if (targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1) {setStylusScaleEnabled(true);}}/*** Accepts MotionEvents and dispatches events to a {@link OnScaleGestureListener}* when appropriate.** <p>Applications should pass a complete and consistent event stream to this method.* A complete and consistent event stream involves all MotionEvents from the initial* ACTION_DOWN to the final ACTION_UP or ACTION_CANCEL.</p>** @param event The event to process* @return true if the event was processed and the detector wants to receive the* rest of the MotionEvents in this event stream.*/public boolean onTouchEvent(MotionEvent event) {if (mInputEventConsistencyVerifier != null) {mInputEventConsistencyVerifier.onTouchEvent(event, 0);}mCurrTime = event.getEventTime();final int action = event.getActionMasked();// Forward the event to check for double tap gestureif (mQuickScaleEnabled) {mGestureDetector.onTouchEvent(event);}final int count = event.getPointerCount();final boolean isStylusButtonDown =(event.getButtonState() & MotionEvent.BUTTON_STYLUS_PRIMARY) != 0;final boolean anchoredScaleCancelled =mAnchoredScaleMode == ANCHORED_SCALE_MODE_STYLUS && !isStylusButtonDown;final boolean streamComplete = action == MotionEvent.ACTION_UP ||action == MotionEvent.ACTION_CANCEL || anchoredScaleCancelled;if (action == MotionEvent.ACTION_DOWN || streamComplete) {// Reset any scale in progress with the listener.// If it's an ACTION_DOWN we're beginning a new event stream.// This means the app probably didn't give us all the events. Shame on it.if (mInProgress) {mListener.onScaleEnd(this);mInProgress = false;mInitialSpan = 0;mAnchoredScaleMode = ANCHORED_SCALE_MODE_NONE;} else if (inAnchoredScaleMode() && streamComplete) {mInProgress = false;mInitialSpan = 0;mAnchoredScaleMode = ANCHORED_SCALE_MODE_NONE;}if (streamComplete) {return true;}}if (!mInProgress && mStylusScaleEnabled && !inAnchoredScaleMode()&& !streamComplete && isStylusButtonDown) {// Start of a button scale gesturemAnchoredScaleStartX = event.getX();mAnchoredScaleStartY = event.getY();mAnchoredScaleMode = ANCHORED_SCALE_MODE_STYLUS;mInitialSpan = 0;}final boolean configChanged = action == MotionEvent.ACTION_DOWN ||action == MotionEvent.ACTION_POINTER_UP ||action == MotionEvent.ACTION_POINTER_DOWN || anchoredScaleCancelled;final boolean pointerUp = action == MotionEvent.ACTION_POINTER_UP;final int skipIndex = pointerUp ? event.getActionIndex() : -1;// Determine focal pointfloat sumX = 0, sumY = 0;final int div = pointerUp ? count - 1 : count;final float focusX;final float focusY;if (inAnchoredScaleMode()) {// In anchored scale mode, the focal pt is always where the double tap// or button down gesture startedfocusX = mAnchoredScaleStartX;focusY = mAnchoredScaleStartY;if (event.getY() < focusY) {mEventBeforeOrAboveStartingGestureEvent = true;} else {mEventBeforeOrAboveStartingGestureEvent = false;}} else {for (int i = 0; i < count; i++) {if (skipIndex == i) continue;sumX += event.getX(i);sumY += event.getY(i);}focusX = sumX / div;focusY = sumY / div;}// Determine average deviation from focal pointfloat devSumX = 0, devSumY = 0;for (int i = 0; i < count; i++) {if (skipIndex == i) continue;// Convert the resulting diameter into a radius.devSumX += Math.abs(event.getX(i) - focusX);devSumY += Math.abs(event.getY(i) - focusY);}final float devX = devSumX / div;final float devY = devSumY / div;// Span is the average distance between touch points through the focal point;// i.e. the diameter of the circle with a radius of the average deviation from// the focal point.final float spanX = devX * 2;final float spanY = devY * 2;final float span;if (inAnchoredScaleMode()) {span = spanY;} else {span = (float) Math.hypot(spanX, spanY);}// Dispatch begin/end events as needed.// If the configuration changes, notify the app to reset its current state by beginning// a fresh scale event stream.final boolean wasInProgress = mInProgress;mFocusX = focusX;mFocusY = focusY;if (!inAnchoredScaleMode() && mInProgress && (span < mMinSpan || configChanged)) {mListener.onScaleEnd(this);mInProgress = false;mInitialSpan = span;}if (configChanged) {mPrevSpanX = mCurrSpanX = spanX;mPrevSpanY = mCurrSpanY = spanY;mInitialSpan = mPrevSpan = mCurrSpan = span;}final int minSpan = inAnchoredScaleMode() ? mSpanSlop : mMinSpan;if (!mInProgress && span >= minSpan &&(wasInProgress || Math.abs(span - mInitialSpan) > mSpanSlop)) {mPrevSpanX = mCurrSpanX = spanX;mPrevSpanY = mCurrSpanY = spanY;mPrevSpan = mCurrSpan = span;mPrevTime = mCurrTime;mInProgress = mListener.onScaleBegin(this);}// Handle motion; focal point and span/scale factor are changing.if (action == MotionEvent.ACTION_MOVE) {mCurrSpanX = spanX;mCurrSpanY = spanY;mCurrSpan = span;boolean updatePrev = true;if (mInProgress) {updatePrev = mListener.onScale(this);}if (updatePrev) {mPrevSpanX = mCurrSpanX;mPrevSpanY = mCurrSpanY;mPrevSpan = mCurrSpan;mPrevTime = mCurrTime;}}return true;}private boolean inAnchoredScaleMode() {return mAnchoredScaleMode != ANCHORED_SCALE_MODE_NONE;}/*** Set whether the associated {@link OnScaleGestureListener} should receive onScale callbacks* when the user performs a doubleTap followed by a swipe. Note that this is enabled by default* if the app targets API 19 and newer.* @param scales true to enable quick scaling, false to disable*/public void setQuickScaleEnabled(boolean scales) {mQuickScaleEnabled = scales;if (mQuickScaleEnabled && mGestureDetector == null) {GestureDetector.SimpleOnGestureListener gestureListener =new GestureDetector.SimpleOnGestureListener() {@Overridepublic boolean onDoubleTap(MotionEvent e) {// Double tap: start watching for a swipemAnchoredScaleStartX = e.getX();mAnchoredScaleStartY = e.getY();mAnchoredScaleMode = ANCHORED_SCALE_MODE_DOUBLE_TAP;return true;}};mGestureDetector = new GestureDetector(mContext, gestureListener, mHandler);}}/*** Return whether the quick scale gesture, in which the user performs a double tap followed by a* swipe, should perform scaling. {@see #setQuickScaleEnabled(boolean)}.*/public boolean isQuickScaleEnabled() {return mQuickScaleEnabled;}/*** Sets whether the associates {@link OnScaleGestureListener} should receive* onScale callbacks when the user uses a stylus and presses the button.* Note that this is enabled by default if the app targets API 23 and newer.** @param scales true to enable stylus scaling, false to disable.*/public void setStylusScaleEnabled(boolean scales) {mStylusScaleEnabled = scales;}/*** Return whether the stylus scale gesture, in which the user uses a stylus and presses the* button, should perform scaling. {@see #setStylusScaleEnabled(boolean)}*/public boolean isStylusScaleEnabled() {return mStylusScaleEnabled;}/*** Returns {@code true} if a scale gesture is in progress.*/public boolean isInProgress() {return mInProgress;}/*** Get the X coordinate of the current gesture's focal point.* If a gesture is in progress, the focal point is between* each of the pointers forming the gesture.** If {@link #isInProgress()} would return false, the result of this* function is undefined.** @return X coordinate of the focal point in pixels.*/public float getFocusX() {return mFocusX;}/*** Get the Y coordinate of the current gesture's focal point.* If a gesture is in progress, the focal point is between* each of the pointers forming the gesture.** If {@link #isInProgress()} would return false, the result of this* function is undefined.** @return Y coordinate of the focal point in pixels.*/public float getFocusY() {return mFocusY;}/*** Return the average distance between each of the pointers forming the* gesture in progress through the focal point.** @return Distance between pointers in pixels.*/public float getCurrentSpan() {return mCurrSpan;}/*** Return the average X distance between each of the pointers forming the* gesture in progress through the focal point.** @return Distance between pointers in pixels.*/public float getCurrentSpanX() {return mCurrSpanX;}/*** Return the average Y distance between each of the pointers forming the* gesture in progress through the focal point.** @return Distance between pointers in pixels.*/public float getCurrentSpanY() {return mCurrSpanY;}/*** Return the previous average distance between each of the pointers forming the* gesture in progress through the focal point.** @return Previous distance between pointers in pixels.*/public float getPreviousSpan() {return mPrevSpan;}/*** Return the previous average X distance between each of the pointers forming the* gesture in progress through the focal point.** @return Previous distance between pointers in pixels.*/public float getPreviousSpanX() {return mPrevSpanX;}/*** Return the previous average Y distance between each of the pointers forming the* gesture in progress through the focal point.** @return Previous distance between pointers in pixels.*/public float getPreviousSpanY() {return mPrevSpanY;}/*** Return the scaling factor from the previous scale event to the current* event. This value is defined as* ({@link #getCurrentSpan()} / {@link #getPreviousSpan()}).** @return The current scaling factor.*/public float getScaleFactor() {if (inAnchoredScaleMode()) {// Drag is moving up; the further away from the gesture// start, the smaller the span should be, the closer,// the larger the span, and therefore the larger the scalefinal boolean scaleUp =(mEventBeforeOrAboveStartingGestureEvent && (mCurrSpan < mPrevSpan)) ||(!mEventBeforeOrAboveStartingGestureEvent && (mCurrSpan > mPrevSpan));final float spanDiff = (Math.abs(1 - (mCurrSpan / mPrevSpan)) * SCALE_FACTOR);return mPrevSpan <= 0 ? 1 : scaleUp ? (1 + spanDiff) : (1 - spanDiff);}return mPrevSpan > 0 ? mCurrSpan / mPrevSpan : 1;}/*** Return the time difference in milliseconds between the previous* accepted scaling event and the current scaling event.** @return Time difference since the last scaling event in milliseconds.*/public long getTimeDelta() {return mCurrTime - mPrevTime;}/*** Return the event time of the current event being processed.** @return Current event time in milliseconds.*/public long getEventTime() {return mCurrTime;} }

3、多指滑動(dòng)。

我主要做的有雙指和三指的滑動(dòng)識別,滑動(dòng)分為直接通知滑動(dòng)結(jié)果和滑動(dòng)過程實(shí)時(shí)通知

private class AiwaysMultiFingerSplit {private MotionEvent mStartMutiEvent;private MotionEvent mLastEvent;private float mLastFocusX;private float mLastFocusY;private float mDownFocusX;private float mDownFocusY;public boolean onTouchEvent(MotionEvent ev) {if (mVelocityTracker == null) {mVelocityTracker = VelocityTracker.obtain();}mVelocityTracker.addMovement(ev);boolean handled = false;float sumX = 0, sumY = 0;float focusX = 0, focusY = 0;int pCount = ev.getPointerCount();if (pCount == 2 || pCount == 3) {for (int i = 0; i < pCount; i++) {sumX += ev.getX(i);sumY += ev.getY(i);}focusX = sumX / pCount;focusY = sumY / pCount;}switch(ev.getAction() & MotionEvent.ACTION_MASK) {case MotionEvent.ACTION_DOWN:mDownFocusX = mLastFocusX = focusX;mDownFocusY = mLastFocusY = focusY;break;case MotionEvent.ACTION_UP:if (mVelocityTracker != null) {mVelocityTracker.recycle();mVelocityTracker = null;}if (mLastEvent != null) {mLastEvent = null;}break;case MotionEvent.ACTION_POINTER_DOWN:if (pCount == 2 || pCount == 3) {mDownFocusX = mLastFocusX = focusX;mDownFocusY = mLastFocusY = focusY;mStartMutiEvent = MotionEvent.obtain(ev);mLastEvent = MotionEvent.obtain(ev);}handled = true;break;case MotionEvent.ACTION_POINTER_UP:Log.d(TAG, "ACTION_POINTER_UP_"+ev.getActionIndex() + " ,onTouchEvent pCount:" + ev.getPointerCount());if ((pCount-1) == 2 || (pCount-1) == 3) {mDownFocusX = mLastFocusX = focusX;mDownFocusY = mLastFocusY = focusY;mStartMutiEvent = MotionEvent.obtain(ev);}if (pCount == 2 || pCount == 3) {final VelocityTracker velocityTracker = mVelocityTracker;velocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity);final int id1 = ev.getPointerId(ev.getActionIndex());float sumVX = velocityTracker.getXVelocity(id1);float sumVY = velocityTracker.getYVelocity(id1);for (int i = 0; i < pCount; i++) {if (i == ev.getActionIndex()) continue;final int id2 = ev.getPointerId(i);sumVX += velocityTracker.getXVelocity(id2);sumVY += velocityTracker.getYVelocity(id2);}final float velocityX = sumVX / pCount;final float velocityY = sumVY / pCount;velocityTracker.clear();// 這里的處理和onFling一樣,關(guān)于手指的速度和滑動(dòng)距離,開始是想把每個(gè)手指的滑動(dòng)和距離都通知出去,但是過程太麻煩,所以上面計(jì)算的時(shí)候就取了平均值。handled |= notifyMutiFingerSlipAction(mLastEvent, ev, velocityX , velocityY);}break;case MotionEvent.ACTION_MOVE:if (pCount == 2 || pCount == 3) { // 判斷是2指或3指的時(shí)候直接調(diào)用notifyMutiFingerSlipProcess來處理,基本和上面的onScroll處理一樣final float scrollX = mLastFocusX - focusX;final float scrollY = mLastFocusY - focusY;if ((Math.abs(scrollX) >= 1) || (Math.abs(scrollY) >= 1)) {handled |= notifyMutiFingerSlipProcess(mStartMutiEvent, ev, scrollX, scrollY);}mLastFocusX = focusX;mLastFocusY = focusY;handled = true;}break;default:break;}return handled;}}

4、總體識別代碼

使用的時(shí)候只需要new AiwaysGestureManager,然后 繼承 AiwaysGestureListener 傳進(jìn)子類 就可以監(jiān)聽一下事件了

package wayos.car.view;import android.content.Context; import android.view.GestureDetector; import android.view.InputDevice; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.util.Log; import android.view.VelocityTracker; import android.view.ViewConfiguration;public class AiwaysGestureManager {private final String TAG = "AiwaysGestureManager";private GestureDetector mGestureDetector;private ScaleGestureDetector mScaleDetector;private AiwaysGestureListener mListener;private AiwaysMultiFingerSplit mAiwaysMultiFingerSplit;private VelocityTracker mVelocityTracker;private int mMinimumFlingVelocity;private int mMaximumFlingVelocity;private int minVelocity = 50;public interface AiwaysGestureListener {public boolean onSingleTapUp(MotionEvent motionEvent);public boolean onDoubleTap(MotionEvent motionEvent);public void onLongPress(MotionEvent e);public boolean onDown(MotionEvent e);public boolean onUp(MotionEvent motionEvent);public boolean onScale(ScaleGestureDetector detector);public boolean onScaleBegin(ScaleGestureDetector detector);public void onScaleEnd(ScaleGestureDetector detector);public boolean singleFingeronSlipProcess(MotionEvent e1, MotionEvent e2, float dx, float dy);public boolean singleFingerSlipAction(GestureEvent gestureEvent, MotionEvent startEvent, MotionEvent endEvent, float velocity);public boolean mutiFingerSlipProcess(GestureEvent gestureEvent, float startX, float startY, float endX, float endY, float moveX, float moveY);public boolean mutiFingerSlipAction(GestureEvent gestureEvent, float startX, float startY, float endX, float endY, float velocityX,float velocityY);}public enum GestureEvent {SINGLE_GINGER_LEFT_SLIP,SINGLE_GINGER_RIGHT_SLIP,SINGLE_GINGER_UP_SLIP,SINGLE_GINGER_DOWN_SLIP,DOUBLE_GINGER,DOUBLE_GINGER_LEFT_SLIP,DOUBLE_GINGER_RIGHT_SLIP,DOUBLE_GINGER_UP_SLIP,DOUBLE_GINGER_DOWN_SLIP,THREE_GINGER,THREE_GINGER_UP_SLIP,THREE_GINGER_DOWN_SLIP,SCALE_START,SCALE_MOVE,SCALE_END;}public AiwaysGestureManager(Context context, AiwaysGestureListener listener) {mListener = listener;mGestureDetector = new GestureDetector(context, new SimpleGesture(), null, true /* ignoreMultitouch */);mGestureDetector.setOnDoubleTapListener(new AiwaysDoubleTapListener());mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());mAiwaysMultiFingerSplit = new AiwaysMultiFingerSplit();if (context == null) {mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();} else {final ViewConfiguration configuration = ViewConfiguration.get(context);mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();}}public boolean onTouchEvent(MotionEvent event) {final boolean gestureProcessed = mGestureDetector.onTouchEvent(event);final boolean scaleProcessed = mScaleDetector.onTouchEvent(event);final boolean multiFingerProcessed = mAiwaysMultiFingerSplit.onTouchEvent(event);if (event.getAction() == MotionEvent.ACTION_UP) {mListener.onUp(event);}return (gestureProcessed | scaleProcessed | multiFingerProcessed);}private class SimpleGesture extends GestureDetector.SimpleOnGestureListener {@Overridepublic void onLongPress(MotionEvent e) {mListener.onLongPress(e);}@Overridepublic boolean onScroll(MotionEvent e1, MotionEvent e2, float dx, float dy) {return mListener.singleFingeronSlipProcess(e1, e2, dx, dy);}@Overridepublic boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,float velocityY) {if (e1.getX() - e2.getX() > 0 && Math.abs((int)(e1.getX() - e2.getX())) > Math.abs((int)(e1.getY() - e2.getY()))&& Math.abs(velocityX) > minVelocity) {return mListener.singleFingerSlipAction(GestureEvent.SINGLE_GINGER_LEFT_SLIP, e1, e2, Math.abs(velocityX));}if (e1.getX() - e2.getX() < 0 && Math.abs((int)(e1.getX() - e2.getX())) > Math.abs((int)(e1.getY() - e2.getY()))&& Math.abs(velocityX) > minVelocity) {return mListener.singleFingerSlipAction(GestureEvent.SINGLE_GINGER_RIGHT_SLIP, e1, e2, Math.abs(velocityX));}if (e1.getY() - e2.getY() > 0 && Math.abs((int)(e1.getY() - e2.getY())) > Math.abs((int)(e1.getX() - e2.getX()))&& Math.abs(velocityY) > minVelocity) {return mListener.singleFingerSlipAction(GestureEvent.SINGLE_GINGER_UP_SLIP, e1, e2, Math.abs(velocityY));}if (e1.getY() - e2.getY() < 0 && Math.abs((int)(e1.getY() - e2.getY())) > Math.abs((int)(e1.getX() - e2.getX()))&& Math.abs(velocityY) > minVelocity) {return mListener.singleFingerSlipAction(GestureEvent.SINGLE_GINGER_DOWN_SLIP, e1, e2, Math.abs(velocityY));}return false;}@Overridepublic boolean onDown(MotionEvent e) {mListener.onDown(e);return super.onDown(e);}}private class AiwaysDoubleTapListener implements GestureDetector.OnDoubleTapListener {@Overridepublic boolean onSingleTapConfirmed(MotionEvent e) {return mListener.onSingleTapUp(e);}@Overridepublic boolean onDoubleTap(MotionEvent e) {return mListener.onDoubleTap(e);}@Overridepublic boolean onDoubleTapEvent(MotionEvent e) {return true;}}boolean notifyMutiFingerSlipProcess(MotionEvent startEvent, MotionEvent endEvent, float dX, float dY) {int pCount = startEvent.getPointerCount();int sumX = 0, sumY = 0;for (int i = 0; i < pCount; i++) {sumX += startEvent.getX(i);sumY += startEvent.getY(i);}int startX = sumX / pCount;int startY = sumY / pCount;sumX = sumY =0;pCount = endEvent.getPointerCount();for (int i = 0; i < pCount; i++) {sumX += endEvent.getX(i);sumY += endEvent.getY(i);}int endX = sumX / pCount;int endY = sumY / pCount;if (pCount == 2) {return mListener.mutiFingerSlipProcess(GestureEvent.DOUBLE_GINGER, startX, startY, endX, endY, dX, dY);}if (pCount == 3) {return mListener.mutiFingerSlipProcess(GestureEvent.THREE_GINGER, startX, startY, endX, endY, dX, dY);}return false;}boolean notifyMutiFingerSlipAction(MotionEvent startEvent, MotionEvent endEvent, float velocityX, float velocityY) {int pCount = startEvent.getPointerCount();int sumX = 0, sumY = 0;for (int i = 0; i < pCount; i++) {sumX += startEvent.getX(i);sumY += startEvent.getY(i);}int startX = sumX / pCount;int startY = sumY / pCount;sumX = sumY = 0;pCount = endEvent.getPointerCount();for (int i = 0; i < pCount; i++) {sumX += endEvent.getX(i);sumY += endEvent.getY(i);}int endX = sumX / pCount;int endY = sumY / pCount;Log.d(TAG, "startX:" + startX + " startY:"+startY + " endX: " + endX + " endY: " + endY + " velocityX:" + velocityX + " velocityY: " + velocityY);if (pCount == 2) {if (startX - endX > 0 && Math.abs(velocityX) > minVelocity&& Math.abs(startX - endX) > Math.abs(startY - endY)) {Log.d(TAG, "DOUBLE_GINGER_LEFT_SLIP");return mListener.mutiFingerSlipAction(GestureEvent.DOUBLE_GINGER_LEFT_SLIP, startX , startY, endX, endY, velocityX, velocityY);}if (startX - endX < 0 && Math.abs(velocityX) > minVelocity&& Math.abs(startX - endX) > Math.abs(startY - endY)) {Log.d(TAG, "DOUBLE_GINGER_RIGHT_SLIP");return mListener.mutiFingerSlipAction(GestureEvent.DOUBLE_GINGER_RIGHT_SLIP, startX , startY, endX, endY, velocityX, velocityY);}if (startY - endY > 0 && Math.abs(velocityY) > minVelocity&& Math.abs(startY - endY) > Math.abs(startX - endX)) {Log.d(TAG, "DOUBLE_GINGER_UP_SLIP");return mListener.mutiFingerSlipAction(GestureEvent.DOUBLE_GINGER_UP_SLIP, startX , startY, endX, endY, velocityX, velocityY);}if (startY - endY < 0 && Math.abs(velocityY) > minVelocity&& Math.abs(startY - endY) > Math.abs(startX - endX)) {Log.d(TAG, "DOUBLE_GINGER_DOWN_SLIP");return mListener.mutiFingerSlipAction(GestureEvent.DOUBLE_GINGER_DOWN_SLIP, startX , startY, endX, endY, velocityX, velocityY);}}if (pCount == 3) {if (startY - endY > 0 && Math.abs(velocityY) > minVelocity&& Math.abs(startY - endY) > Math.abs(startX - endX)) {Log.d(TAG, "THREE_GINGER_UP_SLIP");return mListener.mutiFingerSlipAction(GestureEvent.THREE_GINGER_UP_SLIP, startX , startY, endX, endY, velocityX, velocityY);}if (startY - endY < 0 && Math.abs(velocityY) > minVelocity&& Math.abs(startY - endY) > Math.abs(startX - endX)) {Log.d(TAG, "THREE_GINGER_DOWN_SLIP");return mListener.mutiFingerSlipAction(GestureEvent.THREE_GINGER_DOWN_SLIP, startX , startY, endX, endY, velocityX, velocityY);}}return false;}private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {@Overridepublic boolean onScaleBegin(ScaleGestureDetector detector) {Log.d(TAG, "onScaleBegin");return mListener.onScaleBegin(detector);}@Overridepublic boolean onScale(ScaleGestureDetector detector) {Log.d(TAG, "onScaling");return mListener.onScale(detector);}@Overridepublic void onScaleEnd(ScaleGestureDetector detector) {Log.d(TAG, "onScaleEnd");mListener.onScaleEnd(detector);}}private class AiwaysMultiFingerSplit {private MotionEvent mStartMutiEvent;private MotionEvent mLastEvent;private float mLastFocusX;private float mLastFocusY;private float mDownFocusX;private float mDownFocusY;public boolean onTouchEvent(MotionEvent ev) {if (mVelocityTracker == null) {mVelocityTracker = VelocityTracker.obtain();}mVelocityTracker.addMovement(ev);boolean handled = false;float sumX = 0, sumY = 0;float focusX = 0, focusY = 0;int pCount = ev.getPointerCount();if (pCount == 2 || pCount == 3) {for (int i = 0; i < pCount; i++) {sumX += ev.getX(i);sumY += ev.getY(i);}focusX = sumX / pCount;focusY = sumY / pCount;}switch(ev.getAction() & MotionEvent.ACTION_MASK) {case MotionEvent.ACTION_DOWN:mDownFocusX = mLastFocusX = focusX;mDownFocusY = mLastFocusY = focusY;break;case MotionEvent.ACTION_UP:if (mVelocityTracker != null) {mVelocityTracker.recycle();mVelocityTracker = null;}if (mLastEvent != null) {mLastEvent = null;}break;case MotionEvent.ACTION_POINTER_DOWN:if (pCount == 2 || pCount == 3) {mDownFocusX = mLastFocusX = focusX;mDownFocusY = mLastFocusY = focusY;mStartMutiEvent = MotionEvent.obtain(ev);mLastEvent = MotionEvent.obtain(ev);}handled = true;break;case MotionEvent.ACTION_POINTER_UP:Log.d(TAG, "ACTION_POINTER_UP_"+ev.getActionIndex() + " ,onTouchEvent pCount:" + ev.getPointerCount());if ((pCount-1) == 2 || (pCount-1) == 3) {mDownFocusX = mLastFocusX = focusX;mDownFocusY = mLastFocusY = focusY;mStartMutiEvent = MotionEvent.obtain(ev);}if (pCount == 2 || pCount == 3) {final VelocityTracker velocityTracker = mVelocityTracker;velocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity);final int id1 = ev.getPointerId(ev.getActionIndex());float sumVX = velocityTracker.getXVelocity(id1);float sumVY = velocityTracker.getYVelocity(id1);for (int i = 0; i < pCount; i++) {if (i == ev.getActionIndex()) continue;final int id2 = ev.getPointerId(i);sumVX += velocityTracker.getXVelocity(id2);sumVY += velocityTracker.getYVelocity(id2);}final float velocityX = sumVX / pCount;final float velocityY = sumVY / pCount;velocityTracker.clear();handled |= notifyMutiFingerSlipAction(mLastEvent, ev, velocityX , velocityY);}break;case MotionEvent.ACTION_MOVE:if (pCount == 2 || pCount == 3) {final float scrollX = mLastFocusX - focusX;final float scrollY = mLastFocusY - focusY;if ((Math.abs(scrollX) >= 1) || (Math.abs(scrollY) >= 1)) {handled |= notifyMutiFingerSlipProcess(mStartMutiEvent, ev, scrollX, scrollY);}mLastFocusX = focusX;mLastFocusY = focusY;handled = true;}break;default:break;}return handled;}} }

總結(jié)

以上是生活随笔為你收集整理的android 手势识别 (缩放 单指滑动 多指滑动)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

91精品国产麻豆国产自产影视 | 黄色软件在线观看免费 | 中文字幕超清在线免费 | 亚洲国产中文在线 | 亚洲精品一区二区在线观看 | 国产精品九九久久99视频 | 国产日韩中文字幕 | 中文乱幕日产无线码1区 | 8x成人在线 | 精品在线观看一区二区三区 | 日韩在线视频免费观看 | 久久精品视频免费播放 | 最近在线中文字幕 | 国产精品免费观看国产网曝瓜 | 在线观看黄色国产 | 在线视频欧美日韩 | 国产在线精品区 | 青草视频在线 | 成人免费观看完整版电影 | 精品国产伦一区二区三区观看说明 | 国产九色视频在线观看 | 久久国产精品99久久久久久丝袜 | 免费观看十分钟 | 偷拍精品一区二区三区 | 四虎国产精品免费观看视频优播 | 少妇性色午夜淫片aaaze | 欧美巨大荫蒂茸毛毛人妖 | 国产精品久久久久久久免费 | 免费a视频| 中文字幕在线观看资源 | 国产精彩视频 | 91精品91 | 免费电影一区二区三区 | 一级一级一片免费 | 国产美女精品久久久 | 黄色网址中文字幕 | 久久精品综合 | 久久精品xxx | 欧美成人亚洲成人 | 天天做天天爱天天爽综合网 | 成人免费视频播放 | 国产不卡av在线播放 | 奇米影视四色8888 | 亚洲视频在线播放 | 久久噜噜少妇网站 | 国产精品一区二区在线观看免费 | 久久大香线蕉app | 欧美analxxxx| 丁香六月婷婷开心婷婷网 | 久久国产乱 | 免费久久网| 婷五月激情 | 最近中文字幕完整高清 | 国产黄影院色大全免费 | 免费国产在线视频 | 精品一区二区三区在线播放 | 在线视频 区 | 久久久精品 一区二区三区 国产99视频在线观看 | 国产一区二区在线播放 | 久久 在线 | 美女免费黄网站 | 在线免费视频 你懂得 | 国产精品久久久久久高潮 | 国产精品成人aaaaa网站 | 免费观看不卡av | 国产色综合 | 久久艹在线观看 | 精品专区一区二区 | 九九热免费在线观看 | av超碰在线| 久久伊人精品天天 | 国产亚洲va综合人人澡精品 | 日韩视频免费观看高清完整版在线 | 亚洲v欧美v国产v在线观看 | 久久99精品久久久久久秒播蜜臀 | 96香蕉视频 | 中文在线免费视频 | 777久久久 | 国产一级片播放 | 欧美在线一二区 | 成人毛片一区 | 99久久99久久免费精品蜜臀 | 黄色99视频 | 亚洲日本一区二区在线 | 美女网站色 | 久草在线免费看视频 | 久久久久在线视频 | 99精品久久99久久久久 | 在线看成人av | 国产精品美女久久久久久2018 | 国产精品色婷婷视频 | www.伊人色.com | 国产欧美综合视频 | 成人全视频免费观看在线看 | 一区二区三区四区精品 | 久久丁香| 日本三级吹潮在线 | 天天久久综合 | 一区二区在线不卡 | 99中文字幕视频 | 久久9999久久| 99这里只有精品视频 | 中文字幕日本特黄aa毛片 | 91免费网 | 国产一级淫片免费看 | 久久国产精品小视频 | 三级在线视频播放 | 日韩免费在线观看 | 国产精品普通话 | 一区二区三区久久 | 六月丁香激情网 | 欧美久久久久久久久久久 | 开心激情婷婷 | 一区二区三区三区在线 | 在线播放国产精品 | 在线观看久久久久久 | 国产一区二区精品久久 | 在线中文字母电影观看 | 99 久久久久 | 成人va天堂| 韩日精品在线 | 中文字幕亚洲在线观看 | 婷婷色九月 | 黄色精品一区 | 午夜在线免费观看视频 | 日韩精品一区在线观看 | 在线 你懂 | 午夜视频福利 | 国产精品亚洲人在线观看 | 2017狠狠干 | 丁香网婷婷 | 国产不卡高清 | 韩国一区二区三区在线观看 | 东方av在线免费观看 | 国产成人精品一区二区三区网站观看 | 日本不卡123 | 亚洲综合在线播放 | 麻豆视频免费版 | 三级黄色免费片 | 国产乱码精品一区二区三区介绍 | 人人干人人干人人干 | 亚洲一区二区三区91 | 免费观看久久久 | 十八岁以下禁止观看的1000个网站 | 久久福利剧场 | 亚洲国产资源 | 精品久久久久久亚洲综合网站 | 操天天操| 五月天天天操 | 在线视频国产区 | 国产成人精品一区二区三区 | 超碰电影在线观看 | av在线精品| 91成年视频| 亚洲精品黄色 | 国产亚洲在线 | 国产精品视屏 | 美女一级毛片视频 | 国产无套精品久久久久久 | 日韩在线免费播放 | 色婷婷综合视频在线观看 | 久草在线资源免费 | 成人av地址 | 综合精品久久久 | se视频网址 | 日本中文字幕在线 | 国产视频精品免费 | 一区二区三区在线不卡 | 国产黄在线| 国产一区二区高清不卡 | 亚洲人久久 | www欧美日韩 | 亚洲一级理论片 | 四虎www| 亚州精品成人 | www.久久com| 国产中文视 | 午夜.dj高清免费观看视频 | 久久精品黄 | 在线成人中文字幕 | 日日夜夜精品网站 | 天天操天天射天天爱 | 日韩在线不卡视频 | 96精品在线 | 日韩毛片在线免费观看 | 国产老太婆免费交性大片 | 99re国产 | 亚洲涩涩一区 | 欧美激情精品久久久 | 日韩精品aaa| 久久精品99久久 | 正在播放国产精品 | 久久久久国产精品免费网站 | 国产色久 | 91精品国产福利在线观看 | 久久成人一区二区 | 久久久久国产一区二区三区四区 | 亚洲好视频| 五月天六月丁香 | 欧美在线观看视频一区二区 | 久久不见久久见免费影院 | 久久久麻豆视频 | 人人爽人人插 | 九九九九精品 | 国产在线成人 | 国产精品色婷婷视频 | 国内小视频在线观看 | 五月天激情在线 | 69精品 | 日韩乱码在线 | 精品一区二区在线免费观看 | av网在线观看 | 亚洲涩综合 | 成人中文字幕+乱码+中文字幕 | 欧美日韩国内在线 | 日韩在线电影一区 | mm1313亚洲精品国产 | 一区二区三区精品在线视频 | 国产精品片 | 成 人 黄 色 视频 免费观看 | 精品网站999www | 天天看天天干天天操 | 亚洲春色奇米影视 | 亚洲va在线va天堂 | 亚洲综合在线观看视频 | 国内久久看 | 免费特级黄毛片 | 97精品一区 | 午夜av在线电影 | 天天操操操操操 | 蜜臀久久99精品久久久久久网站 | 美女在线观看av | 午夜久久久精品 | 中文字幕日韩高清 | 欧美精品久久天天躁 | 亚洲精品美女久久久久网站 | 久久国产精品99久久久久久进口 | 亚洲区另类春色综合小说 | 亚洲精品国偷拍自产在线观看蜜桃 | 久久永久视频 | 国产91丝袜在线播放动漫 | 一级黄色片在线 | 日韩综合在线观看 | 探花视频免费在线观看 | 国产免费一区二区三区最新6 | 久久久噜噜噜久久久 | 日韩两性视频 | 综合婷婷| av免费观看网站 | 欧美日韩一区二区三区在线观看视频 | 国产精品 日韩精品 | 超碰公开在线观看 | 日韩黄色在线电影 | 国产一区二区日本 | 三级黄色在线观看 | 中文字幕免费观看 | 亚洲一级电影视频 | 天天操天天舔天天干 | 天天操天天干天天玩 | 九色琪琪久久综合网天天 | 亚洲精品午夜一区人人爽 | 久久综合免费视频影院 | 一区二区三区精品在线视频 | 在线视频久久 | 97精品国产97久久久久久免费 | 91精品国产99久久久久久红楼 | 九色精品| 91传媒视频在线观看 | www.91av在线| 久久久黄色av | 91天堂影院 | 狠狠干网站 | 色国产精品一区在线观看 | 天堂网中文在线 | 成人国产网址 | 成人影片在线免费观看 | 一区二区不卡视频在线观看 | 精品中文字幕在线 | 免费黄色a网站 | 免费国产一区二区 | 国产精品高潮呻吟久久久久 | 伊人五月天综合 | 亚洲伦理中文字幕 | 天天操天天射天天插 | 久久视频国产精品免费视频在线 | 五月激情六月丁香 | 日韩午夜电影院 | 99热精品视 | 日日夜夜网 | 中文字幕国内精品 | 91丨九色丨蝌蚪丨对白 | 欧美日韩精品免费观看 | 久久精品欧美一区二区三区麻豆 | 久久久高清一区二区三区 | 97视频在线观看免费 | 不卡的av在线播放 | 在线视频欧美亚洲 | 久久久久成人精品亚洲国产 | 日本激情视频中文字幕 | a一片一级| 久久在线精品 | 久久久久久国产一区二区三区 | 综合色中色 | 天天干中文字幕 | www日韩高清 | 成人免费观看视频网站 | 黄色91在线观看 | 深爱激情站 | 久久久综合 | 伊人狠狠| 色网av| av电影中文 | 97电院网手机版 | a在线免费 | 国产福利91精品张津瑜 | 在线观看免费成人 | 日韩av片无码一区二区不卡电影 | av在线网站免费观看 | 亚洲第一av在线 | 亚洲国产三级在线观看 | 婷婷六月丁香激情 | 91在线91| 日韩综合一区二区 | 久久久久久久久网站 | 欧美日本不卡高清 | 婷婷丁香色 | 久久天天躁狠狠躁亚洲综合公司 | 黄色免费网战 | 国产精品一区二区久久久 | 亚洲国产精品成人精品 | 狠狠狠色丁香综合久久天下网 | 成人性生爱a∨ | 在线视频一二三 | www久草| 天天天天天操 | 国产91免费看 | 亚洲女同videos | ww视频在线观看 | 91高清完整版在线观看 | 欧美亚洲国产日韩 | 久久久久成人精品亚洲国产 | 特级毛片aaa | 热re99久久精品国产66热 | 免费精品在线观看 | 天堂在线免费视频 | 99久久婷婷国产精品综合 | 丰满少妇高潮在线观看 | 日本精品久久久久中文字幕 | 久久不卡视频 | 婷婷国产精品 | 天天天色综合a | 久久99国产精品二区护士 | 日日碰狠狠躁久久躁综合网 | 国产剧情av在线播放 | 国产色在线观看 | 免费成人短视频 | 久久久久久免费视频 | 亚洲天天摸日日摸天天欢 | 亚洲国产99 | 五月婷婷在线综合 | 国产专区视频 | 免费日韩视 | 亚州五月| 久久亚洲日本 | 97久久久免费福利网址 | 91黄色免费网站 | 激情深爱.com| 91av蜜桃 | 国产一区在线免费观看视频 | 成人精品久久 | 日本91在线 | 久久久在线视频 | 国产精品久久久久久久久久久久午夜片 | 黄在线免费看 | 色综合久久久久综合99 | 中文字幕影片免费在线观看 | 久久艹99| 欧美精品久久久久久久免费 | 久久久国产精品成人免费 | 久久九九影院 | 天天操天天操天天爽 | 成年人免费在线观看 | 91精品国产欧美一区二区 | 国产精品网址在线观看 | 黄色国产成人 | 欧美精品久久久久久久 | 久久一级电影 | 中文字幕黄色 | 欧美日韩综合在线观看 | 黄色动态图xx | 丁香六月久久综合狠狠色 | www天天干com | 97av视频 | 99热手机在线| 久久久国产精品一区二区三区 | 亚洲国产精品一区二区尤物区 | 天堂av在线中文在线 | 在线看av的网址 | 国内精品久久影院 | 亚洲劲爆av| 人人射人人爱 | 久久国产成人午夜av影院潦草 | 色香天天 | 中文字幕专区高清在线观看 | 国产精品美女视频网站 | 青青久视频 | 天天干天天搞天天射 | 香蕉久久国产 | 国产美女免费看 | 久久久高清 | 97精品国产91久久久久久 | 视频在线播放国产 | 久久在线精品 | 91福利视频免费 | 91精品国产91久久久久福利 | 人人爱人人添 | 日本免费久久高清视频 | 91av在线视频播放 | 国产成人免费在线 | 久香蕉| 97人人添人澡人人爽超碰动图 | 五月婷婷久草 | 毛片永久免费 | 国产精品国产三级国产aⅴ9色 | 精品无人国产偷自产在线 | 香蕉视频久久 | 成人黄色电影免费观看 | 91av免费在线观看 | 日日夜夜狠狠 | 丝袜美腿一区 | 国产精品少妇 | 成人黄色电影免费观看 | 久久久国产网站 | 日韩中字在线 | 亚洲人视频在线 | 国产理论影院 | 高清av中文字幕 | 亚洲人人爱 | 国产精品久久久久久久久久ktv | 欧美日韩久久一区 | 欧美久久久久久久久中文字幕 | 麻豆传媒视频在线免费观看 | 亚洲成人av片在线观看 | 国产 色 | 午夜国产在线观看 | 色欧美成人精品a∨在线观看 | 国产精品专区h在线观看 | 国产精品综合久久久久久 | 亚洲狠狠丁香婷婷综合久久久 | 国产黄色精品在线 | 国产成人精品免高潮在线观看 | 久久神马影院 | 国产精品美女久久久 | 又黄又爽的视频在线观看网站 | 日本久久久久久科技有限公司 | 91亚洲精品在线观看 | 国产一区欧美一区 | 一区二区三区视频 | 婷婷丁香六月 | 久久久黄视频 | 国产丝袜一区二区三区 | 久草资源免费 | 色婷婷综合久色 | 天天摸天天操天天舔 | 欧美男男tv网站 | 1024手机看片国产 | 国产成人综合在线观看 | 国产亚洲精品v | 黄色一级大片在线免费看国产一 | 91福利社区在线观看 | 99视频网站| 午夜国产成人 | 在线播放视频一区 | 久久久网 | 丰满少妇对白在线偷拍 | 中文字幕亚洲欧美日韩2019 | 国产一区二区在线观看免费 | 日韩精品不卡 | 欧美成人精品三级在线观看播放 | 91精品国产99久久久久 | 97人人添人澡人人爽超碰动图 | 国内精品视频在线 | 亚州视频在线 | av在线电影网站 | 丁香综合 | 亚洲一区二区三区四区精品 | 日韩欧美综合在线视频 | 麻豆国产精品永久免费视频 | 日韩美一区二区三区 | 麻花天美星空视频 | 成年人免费电影 | 91试看| 日韩高清www| 色婷婷av一区 | 91超碰免费在线 | 手机在线永久免费观看av片 | 午夜久久久精品 | 91一区啪爱嗯打偷拍欧美 | 亚洲精品视频第一页 | 国产成人无码AⅤ片在线观 日韩av不卡在线 | 99热在线国产 | 日韩免费在线观看网站 | 久久久资源| 久久综合国产伦精品免费 | bbbb操bbbb| 色综合天天爱 | 超碰九九 | 日韩黄色免费电影 | 久久国产精品一国产精品 | h文在线观看免费 | 亚洲成人免费在线 | 日韩三级中文字幕 | 狠狠操导航| 日韩在线在线 | 欧美一级xxxx | 亚洲精品白浆高清久久久久久 | 亚洲视频在线播放 | 娇妻呻吟一区二区三区 | 久久精品1区2区 | 亚洲精品高清在线 | 久久成年人视频 | 天天干天天操 | 综合久久久 | 午夜精品久久久久久久99无限制 | 日韩国产欧美在线播放 | 狠狠干我 | 日韩在线免费高清视频 | 色99网 | 欧美性成人 | 在线综合 亚洲 欧美在线视频 | 日日噜噜噜噜夜夜爽亚洲精品 | 成人va在线观看 | www.五月婷婷| 亚洲综合视频在线 | 久久免费看视频 | 字幕网av| 久久久午夜精品理论片中文字幕 | 99热精品免费观看 | 四虎影视精品永久在线观看 | www.香蕉视频| 日韩欧美精品在线观看 | 欧美少妇bbwhd | 欧美久久99 | 亚洲精品在线观看视频 | 99精品国产99久久久久久97 | 在线成人欧美 | 日韩高清免费在线 | 91av在线精品| 午夜精品福利一区二区 | 91最新在线观看 | 超碰国产在线播放 | 91人人澡人人爽人人精品 | 91成人精品一区在线播放69 | 国产91精品高清一区二区三区 | 在线观看亚洲精品视频 | 日日干日日 | 中文字幕三区 | 国产精品久久久久久久久久新婚 | 中文字幕高清 | av免费电影在线 | 黄色福利视频网站 | 91久久精品日日躁夜夜躁国产 | 99久久久久免费精品国产 | 国产不卡av在线播放 | 国产日韩欧美在线观看视频 | 色妞久久福利网 | 福利视频网站 | 久久精品视频在线观看 | 亚洲aⅴ乱码精品成人区 | 最近免费中文字幕mv在线视频3 | 五月视频 | 欧美福利片在线观看 | 91免费网站在线观看 | 欧美大jb| 日批视频国产 | 国产九九精品视频 | 三级黄色在线观看 | 国内一级片在线观看 | 黄色三级免费 | 久久国产美女视频 | 午夜国产在线 | 91精品啪在线观看国产81旧版 | 国产在线视频不卡 | 欧美成人精品在线 | 国产亚洲在线视频 | 91一区二区在线 | 久久国产三级 | 一区二区视频免费在线观看 | 免费在线观看毛片网站 | 亚洲自拍偷拍色图 | 日本天天操 | 亚洲视频在线免费看 | 黄色的视频网站 | 欧美日韩国产一二三区 | 精品视频中文字幕 | 亚洲一区网 | 伊人五月天 | 亚洲欧美国产精品 | 69视频在线 | 色综合天天射 | 亚洲狠狠操 | 欧美精品久久久久久久久久 | 综合五月 | 天天操夜夜拍 | 久草在线免费新视频 | 91精品啪在线观看国产 | 日韩欧美精品在线观看视频 | 日韩女同一区二区三区在线观看 | 激情欧美国产 | 亚洲乱码精品 | 国产专区视频 | 免费激情在线电影 | 在线观看亚洲精品 | 成人国产网址 | 精品国产福利在线 | 久草网在线视频 | 国产日韩在线看 | 人人爽人人爽人人爽学生一级 | 中文在线中文资源 | 日韩高清精品一区二区 | 国产精品ⅴa有声小说 | 午夜精品av| 精品久久1 | 在线免费高清 | 欧美一级日韩三级 | 国产精品视屏 | 人人插人人草 | 精品久久网站 | a视频免费看 | 国产精品欧美精品 | 国产一区视频在线 | 波多野结衣视频一区 | 国产特级毛片aaaaaaa高清 | 97视频总站 | 国产视频一区二区三区在线 | 六月天色婷婷 | 国产精品一区二区三区在线看 | 色播五月激情综合网 | 亚洲 欧洲 国产 精品 | 99久在线精品99re8热视频 | 亚洲视频在线观看免费 | 精品国产一区二区三区蜜臀 | 黄色录像av | 黄色电影网站在线观看 | 色姑娘综合 | www.黄色| 久久国产精品99精国产 | 欧美久久久久久久久久 | 国产精品美女www爽爽爽视频 | 天天操天天干天天 | 成人在线免费av | 日韩免费b| 激情综合网五月婷婷 | 久久视频这里有精品 | 亚洲国产中文字幕在线观看 | 日韩在线三级 | 久久久久久久久久久国产精品 | 日韩黄色免费 | 91精品在线看 | 国产98色在线 | 日韩 | 午夜在线免费视频 | 在线三级中文 | 国产亚洲婷婷免费 | 免费久久精品视频 | 久久99精品久久久久久清纯直播 | 五月婷婷狠狠 | 日韩大片在线看 | av中文资源在线 | 一区三区视频在线观看 | 日韩欧美区| 中文字幕一区二区三区四区 | 中文字幕在线免费播放 | 成人av视屏 | 99久久日韩精品免费热麻豆美女 | 亚洲国产伊人 | 久久综合干 | 国产二区精品 | 天天操天天曰 | 黄色的片子 | 亚洲精品电影在线 | 狠狠综合| 国产精品视频永久免费播放 | 久久久精品国产一区二区三区 | 欧美视频一区二 | 日本黄色a级大片 | 玖玖爱在线观看 | 国产在线免费观看 | 国产黄av| 国产麻豆精品传媒av国产下载 | 最近免费中文字幕大全高清10 | 91一区二区三区久久久久国产乱 | 操操综合 | 在线中文字幕一区二区 | japanese黑人亚洲人4k | 天堂av一区二区 | 在线国产激情视频 | 亚州av成人 | av一级二级 | 狠狠干,狠狠操 | 日韩一级电影网站 | 久草在线视频免赞 | 欧美成人精品欧美一级乱 | 亚洲少妇天堂 | 综合国产视频 | 亚洲日本在线一区 | 国产精品麻豆三级一区视频 | 天天色天天 | 午夜精品一区二区国产 | 少妇高潮冒白浆 | 久久综合干 | 中国一级片免费看 | 日韩在线视频观看免费 | 日韩av中文字幕在线免费观看 | 黄色片网站大全 | 日韩欧美在线视频一区二区三区 | 久久热亚洲 | 日韩免费一区 | 久久久综合九色合综国产精品 | 欧美成人中文字幕 | 国产成人精品一区在线 | 亚洲一区二区三区毛片 | 97碰碰精品嫩模在线播放 | 91av视频网站 | 麻豆一区在线观看 | 天天射天天色天天干 | 日韩欧美大片免费观看 | 黄色影院在线播放 | 午夜视频在线观看网站 | 国产中文欧美日韩在线 | 久久久久久综合网天天 | 免费国产在线精品 | 99精品黄色片免费大全 | 狠狠色丁香婷婷综合久久片 | 日本69hd | 中国一级片在线观看 | www国产亚洲 | 日日夜夜狠狠干 | 免费看黄在线网站 | 一区二区精品在线视频 | 99国产精品久久久久老师 | 在线成人一区二区 | 青青草华人在线视频 | 日韩欧美在线一区 | 国产视频久久久久 | 欧美日韩综合在线观看 | 97在线观看视频 | 国产精品久久久久久久久久新婚 | 亚洲精品在线一区二区三区 | 天天玩天天干天天操 | 四虎成人精品永久免费av九九 | 丁香久久婷婷 | 国产一区二区不卡在线 | 日韩二区在线观看 | 国产99久久久国产 | 日韩电影在线观看一区 | 免费黄a | 国产精品成人一区二区 | 久香蕉| 嫩小bbbb摸bbb摸bbb | 久久三级毛片 | 国产精品欧美久久久久久 | 国产91电影在线观看 | 天天看天天干 | 日韩一区正在播放 | 91成人在线视频 | 成人91免费视频 | 色 免费观看| 天天干,天天射,天天操,天天摸 | 一区二区中文字幕在线播放 | 欧美在线1 | 亚洲一区二区三区在线看 | 九九天堂| 亚洲国产成人精品在线观看 | 亚洲精品九九 | 国产91影视| 国产美女无遮挡永久免费 | 国产成人精品综合久久久 | 亚洲综合色网站 | 久久欧美精品 | 中文字幕亚洲精品日韩 | 国产又粗又猛又爽又黄的视频先 | 亚洲视频大全 | 亚洲免费观看视频 | 91精品欧美一区二区三区 | 亚洲最大激情中文字幕 | 亚洲国内在线 | 欧美另类v | 韩日在线一区 | 久久久麻豆精品一区二区 | 天天激情在线 | 午夜精品久久久久久中宇69 | 亚洲欧美乱综合图片区小说区 | 国产精品igao视频网入口 | 香蕉97视频观看在线观看 | 综合婷婷丁香 | 国产成人高清av | 欧美视频一区二 | 九九九九九精品 | 999久久久久久久久久久 | 在线观看黄色的网站 | 亚洲综合视频在线观看 | 97人人澡人人添人人爽超碰 | 最近免费中文字幕 | 三级视频日韩 | 免费亚洲婷婷 | 日韩午夜高清 | 久草新在线 | 婷婷精品国产一区二区三区日韩 | 99久久精品国产观看 | 亚洲午夜大片 | 国产高清福利在线 | 女人魂免费观看 | 1024手机看片国产 | 亚洲精品国产成人 | 菠萝菠萝在线精品视频 | 久久综合九色综合97婷婷女人 | 久久久久久久久久久网站 | 色婷婷欧美 | 偷拍视频一区 | 一区免费在线 | 亚洲精品国产精品国自产观看 | 成人综合婷婷国产精品久久免费 | 久久亚洲福利视频 | 日韩在线视频精品 | 深夜福利视频在线观看 | 久草视频网| www黄色大片| 97国产大学生情侣酒店的特点 | 2021国产在线视频 | 久久激情视频免费观看 | 中文字幕一区二区在线播放 | 免费观看av| av手机在线播放 | 免费大片av | www.久久久久 | 欧美日韩在线观看一区二区三区 | 91最新在线 | 久久久久欠精品国产毛片国产毛生 | 中文字幕在线网 | 国产成人精品久久 | 欧美一级片在线播放 | 亚洲欧美日韩一二三区 | 啪一啪在线 | 日韩中文字幕国产 | 国产一级电影在线 | 久久久久亚洲精品中文字幕 | 中午字幕在线观看 | 国产成人精品免费在线观看 | 日韩免费观看高清 | 中文字幕丝袜制服 | 亚洲国产大片 | 亚洲无线视频 | 国产天天爽 | 国产成人av综合色 | 韩国视频一区二区三区 | 国产尤物一区二区三区 | av在线官网 | 亚洲男人天堂2018 | 91视频啊啊啊 | 亚洲最大色 | 成人毛片100免费观看 | 免费中午字幕无吗 | 激情网在线视频 | 日韩av女优视频 | 91丨九色丨国产在线观看 | 国产精品99久久久精品 | 黄色.com| 久草新在线 | 日韩欧美一区二区在线播放 | 色视频在线免费观看 | 色网站在线免费观看 | 亚洲精品一区二区在线观看 | 久久久国产精品成人免费 | 在线看国产视频 | 国产高清日韩欧美 | 久久精品国产久精国产 | 蜜臀aⅴ精品一区二区三区 久久视屏网 | 国产成人久久av977小说 | 久草在线资源观看 | 国产成人av综合色 | 日韩大片在线观看 | 成人资源在线播放 | 久久精品视频在线观看免费 | 精品国产三级 | 日韩欧美一区二区三区在线 | 91av视频播放 | 久久综合久色欧美综合狠狠 | 九九免费视频 | 欧美最猛性xxx | 天堂在线v | 欧美小视频在线观看 | 国内精品免费 | 日日精品 | 超碰97在线资源 | 六月天综合网 | 国产精品 中文字幕 亚洲 欧美 | 在线观看国产91 | www.五月婷婷| 国产在线国偷精品产拍 | 国产精品18久久久久久首页狼 | 欧美精品v国产精品 | 激情大尺度视频 | 69国产精品成人在线播放 | 国产视频综合在线 | 97超碰成人 | 国内精品久久久久 | 日韩不卡高清 | 激情综合色综合久久 | 久久久久国产精品一区 | 日本在线中文在线 | 9i看片成人免费看片 | 蜜臀av性久久久久av蜜臀妖精 | 中文免费在线观看 | 亚洲精品视频播放 | 黄色成人av | 成人四虎影院 | 黄av免费在线观看 | 超碰最新网址 | 久久激情视频网 | 超碰国产在线 | 久久香蕉影视 | 在线精品视频免费观看 | 国产黄色片久久久 | 人人要人人澡人人爽人人dvd | 18网站在线观看 | 91最新视频| 婷婷电影在线观看 | 欧美五月婷婷 | 亚洲国产成人高清精品 | 久久久一本精品99久久精品 | 久久久久 | 天天射网站 | 国际精品久久久 | 超碰在线9 | 99热手机在线 | 99爱视频 | 日韩在线免费不卡 | 日韩av电影一区 | 天天干com| 91成人精品一区在线播放69 | 成人黄色短片 | 性色av免费观看 | 婷婷激情小说网 | 激情片av| 国内99视频| 91中文字幕永久在线 | 日韩成人免费电影 | 激情六月婷婷久久 | 手机在线看永久av片免费 | 99精品视频中文字幕 | 精品一区电影国产 | 日韩sese| 国产精品久久久久永久免费 | 99久久精品免费看国产四区 | 伊香蕉大综综综合久久啪 | 欧美片一区二区三区 | 午夜精品麻豆 | 国产精品a级 | 水蜜桃亚洲一二三四在线 | 女人高潮一级片 | 久久99亚洲热视 | 久久免费视频观看 | 亚洲伊人第一页 | 91久久国产自产拍夜夜嗨 | 亚洲一级特黄 | 美女久久久久久久 | 特级西西www44高清大胆图片 | 国产大片黄色 | 91九色国产蝌蚪 | 国产午夜精品理论片在线 | 日韩成人在线免费观看 | 久久香蕉国产精品麻豆粉嫩av | 亚洲国产wwwccc36天堂 | 噜噜色官网| 国产美女在线免费观看 | 国产欧美精品一区二区三区四区 | 色久天| 精品999| www.大网伊人 | 最新av在线网站 | 欧美91精品久久久久国产性生爱 | 久久久99精品免费观看乱色 | 草久久影院 | 最近日本韩国中文字幕 | 亚洲国产手机在线 | www激情网 | 欧美精品久久久久久 | www黄色av| 日韩欧美精品在线 | 日韩欧美aaa | 九九视频网站 | 亚洲三级网站 | 国产无遮挡又黄又爽在线观看 | 欧美另类交在线观看 | 中文字幕在线观看av | 久久久精品一区二区三区 | 久99热| 69国产精品成人在线播放 |