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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Android >内容正文

Android

Android侧滑删除-RecyclerView轻松实现高效的侧滑菜单

發布時間:2023/12/10 Android 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Android侧滑删除-RecyclerView轻松实现高效的侧滑菜单 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1 刪除整個RecyclerView

? hisList.clear();
? hisAdapter.notifyDataSetChanged();

mScanListAdapter.setNewData(null);

剛開始只是使用了list.clear() 方法就是沒有效果,最后想起來了忘記了notifyDataSetChanged 刷新了

2?RecyclerView 刪除Item?

? ?hisList.remove(position);
? ?hisAdapter.notifyItemRemoved(position);
? ?hisAdapter.notifyItemChanged(0,hisList.size());
這個同樣的也是忘記了notifyItemChanged ,

以上使用把list 和adapter 替換自己命名的即可。。
?

?

效果:

recycleview依賴

compile('com.android.support:recyclerview-v7:25.1.1') {force = true }

1、adapter類:

Extension 是自定義類

public class RecOtherTypeAdapter extends RecyclerView.Adapter<RecOtherTypeAdapter.RecViewholder> {private Context context;private List<String> data = new ArrayList<>();private LayoutInflater layoutInflater;public RecOtherTypeAdapter(Context context) {this.context = context;layoutInflater = LayoutInflater.from(context);}public void setList(List<String> list) {data.clear();data.addAll(list);notifyDataSetChanged();}@Overridepublic RecViewholder onCreateViewHolder(ViewGroup parent, int viewType) {View view = layoutInflater.inflate(R.layout.layout_item, parent, false);return new RecViewholder(view);}@Overridepublic void onBindViewHolder(RecViewholder holder, final int position) {holder.textView.setText(data.get(position));holder.textView.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {Toast.makeText(context, "s 66666====" +position, Toast.LENGTH_SHORT).show();}});holder.slide.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {Toast.makeText(context, "刪除" +position, Toast.LENGTH_SHORT).show();}});}@Overridepublic int getItemCount() {return data.size();}/*** view.getWidth()獲取的是屏幕中可以看到的大小.*/public class RecViewholder extends RecyclerView.ViewHolder implements Extension {public TextView textView;public TextView slide;public RecViewholder(View itemView) {super(itemView);textView = itemView.findViewById(R.id.item_text);slide = itemView.findViewById(R.id.item_slide);}@Overridepublic float getActionWidth() {return slide.getWidth();}}/*** 根據手機分辨率從DP轉成PX* @param context* @param dpValue* @return*/public static int dip2px(Context context, float dpValue) {float scale = context.getResources().getDisplayMetrics().density;return (int) (dpValue * scale + 0.5f);} }

1.2、item.xml

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginBottom="1dp"><TextViewandroid:id="@+id/item_slide"android:layout_width="100dp"android:layout_height="50dp"android:layout_alignParentRight="true"android:background="#ff565b"android:gravity="center"android:text="刪 除"android:textColor="#ffffff"android:textSize="16sp" /><TextViewandroid:id="@+id/item_text"android:layout_width="match_parent"android:layout_height="50dp"android:background="#e1e1e1"android:gravity="center"android:tag="slide_flag"android:text="item"android:textColor="#333333"android:textSize="16sp" /></RelativeLayout>

1.3、activity詳情:

public class MainActivity extends AppCompatActivity {RecyclerView recyclerView;private RecOtherTypeAdapter recAdapter;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);initView();initData();}private void initView() {recyclerView = findViewById(R.id.recyclerViewTwo);recyclerView.setLayoutManager(new LinearLayoutManager(this));recAdapter = new RecOtherTypeAdapter(this);recyclerView.setAdapter(recAdapter);PlusItemSlideCallback callback = new PlusItemSlideCallback(WItemTouchHelperPlus.SLIDE_ITEM_TYPE_SLIDECONTAINER);WItemTouchHelperPlus extension = new WItemTouchHelperPlus(callback);extension.attachToRecyclerView(recyclerView);}private void initData() {List<String> list = new ArrayList<>();for (int i = 0; i < 30; i++) {list.add("Item " +i);}recAdapter.setList(list);} }

?

2、五個工具類(完整復用即可)

(1)、Extension

/*** 作者:created by meixi* 郵箱:13164716840@163.com* 日期:2018/9/3 09*/public interface Extension {float getActionWidth(); }

(2)、ItemTouchUIUtilImpl

class ItemTouchUIUtilImpl {static class Lollipop extends Honeycomb {@Overridepublic void onDraw(Canvas c, RecyclerView recyclerView, View view,float dX, float dY, int actionState, boolean isCurrentlyActive) {if (isCurrentlyActive) {Object originalElevation = view.getTag(R.id.item_touch_helper_previous_elevation);if (originalElevation == null) {originalElevation = ViewCompat.getElevation(view);float newElevation = 1f + findMaxElevation(recyclerView, view);ViewCompat.setElevation(view, newElevation);view.setTag(R.id.item_touch_helper_previous_elevation, originalElevation);}}super.onDraw(c, recyclerView, view, dX, dY, actionState, isCurrentlyActive);}private float findMaxElevation(RecyclerView recyclerView, View itemView) {final int childCount = recyclerView.getChildCount();float max = 0;for (int i = 0; i < childCount; i++) {final View child = recyclerView.getChildAt(i);if (child == itemView) {continue;}final float elevation = ViewCompat.getElevation(child);if (elevation > max) {max = elevation;}}return max;}@Overridepublic void clearView(View view) {final Object tag = view.getTag(R.id.item_touch_helper_previous_elevation);if (tag != null && tag instanceof Float) {ViewCompat.setElevation(view, (Float) tag);}view.setTag(R.id.item_touch_helper_previous_elevation, null);super.clearView(view);}}static class Honeycomb implements ItemTouchUIUtil {@Overridepublic void clearView(View view) {ViewCompat.setTranslationX(view, 0f);ViewCompat.setTranslationY(view, 0f);}@Overridepublic void onSelected(View view) {}@Overridepublic void onDraw(Canvas c, RecyclerView recyclerView, View view,float dX, float dY, int actionState, boolean isCurrentlyActive) {ViewCompat.setTranslationX(view, dX);ViewCompat.setTranslationY(view, dY);}@Overridepublic void onDrawOver(Canvas c, RecyclerView recyclerView,View view, float dX, float dY, int actionState, boolean isCurrentlyActive) {}}static class Gingerbread implements ItemTouchUIUtil {private void draw(Canvas c, RecyclerView parent, View view,float dX, float dY) {c.save();c.translate(dX, dY);parent.drawChild(c, view, 0);c.restore();}@Overridepublic void clearView(View view) {view.setVisibility(View.VISIBLE);}@Overridepublic void onSelected(View view) {view.setVisibility(View.INVISIBLE);}@Overridepublic void onDraw(Canvas c, RecyclerView recyclerView, View view,float dX, float dY, int actionState, boolean isCurrentlyActive) {if (actionState != ItemTouchHelper.ACTION_STATE_DRAG) {draw(c, recyclerView, view, dX, dY);}}@Overridepublic void onDrawOver(Canvas c, RecyclerView recyclerView,View view, float dX, float dY,int actionState, boolean isCurrentlyActive) {if (actionState == ItemTouchHelper.ACTION_STATE_DRAG) {draw(c, recyclerView, view, dX, dY);}}} }

3、PlusItemSlideCallback

public class PlusItemSlideCallback extends WItemTouchHelperPlus.Callback {String type;public PlusItemSlideCallback(String type) {this.type = type;}@Overridepublic boolean isItemViewSwipeEnabled() {return true;}@Overrideint getSlideViewWidth() {return 0;}@Overridepublic int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {return makeMovementFlags(0, ItemTouchHelper.START);}@Overridepublic String getItemSlideType() {return type;}@Overridepublic boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {return false;}@Overridepublic void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {}@Overridepublic void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {if(viewHolder instanceof RecOtherTypeAdapter.RecViewholder){RecOtherTypeAdapter.RecViewholder holder = (RecOtherTypeAdapter.RecViewholder) viewHolder;float actionWidth = holder.getActionWidth();if (dX < -actionWidth) {dX = -actionWidth;}holder.textView.setTranslationX(dX);}return;}@Overridepublic void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {super.clearView(recyclerView, viewHolder);} }

(4)、RecOtherTypeAdapter

public class RecOtherTypeAdapter extends RecyclerView.Adapter<RecOtherTypeAdapter.RecViewholder> {private Context context;private List<String> data = new ArrayList<>();private LayoutInflater layoutInflater;public RecOtherTypeAdapter(Context context) {this.context = context;layoutInflater = LayoutInflater.from(context);}public void setList(List<String> list) {data.clear();data.addAll(list);notifyDataSetChanged();}@Overridepublic RecViewholder onCreateViewHolder(ViewGroup parent, int viewType) {View view = layoutInflater.inflate(R.layout.layout_item, parent, false);return new RecViewholder(view);}@Overridepublic void onBindViewHolder(RecViewholder holder, final int position) {holder.textView.setText(data.get(position));holder.textView.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {Toast.makeText(context, "s 66666====" +position, Toast.LENGTH_SHORT).show();}});holder.slide.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {Toast.makeText(context, "刪除" +position, Toast.LENGTH_SHORT).show();}});}@Overridepublic int getItemCount() {return data.size();}/*** view.getWidth()獲取的是屏幕中可以看到的大小.*/public class RecViewholder extends RecyclerView.ViewHolder implements Extension {public TextView textView;public TextView slide;public RecViewholder(View itemView) {super(itemView);textView = itemView.findViewById(R.id.item_text);slide = itemView.findViewById(R.id.item_slide);}@Overridepublic float getActionWidth() {return slide.getWidth();}}/*** 根據手機分辨率從DP轉成PX* @param context* @param dpValue* @return*/public static int dip2px(Context context, float dpValue) {float scale = context.getResources().getDisplayMetrics().density;return (int) (dpValue * scale + 0.5f);} }

(5)WItemTouchHelperPlus

public class WItemTouchHelperPlus extends RecyclerView.ItemDecorationimplements RecyclerView.OnChildAttachStateChangeListener {/*** 側滑顯示的布局 跟隨 在滑動布局的下面的標記 看場景選擇*/public final static String SLIDE_ITEM_TYPE_ITEMVIEW = "itemView";/*** 側滑顯示的布局 隱藏 在滑動布局的下面的標記 看場景選擇*/public final static String SLIDE_ITEM_TYPE_SLIDECONTAINER = "slideContainer";/*** Up direction, used for swipe & drag control.*/public static final int UP = 1;/*** Down direction, used for swipe & drag control.*/public static final int DOWN = 1 << 1;/*** Left direction, used for swipe & drag control.*/public static final int LEFT = 1 << 2;/*** Right direction, used for swipe & drag control.*/public static final int RIGHT = 1 << 3;// If you change these relative direction values, update Callback#convertToAbsoluteDirection,// Callback#convertToRelativeDirection./*** Horizontal start direction. Resolved to LEFT or RIGHT depending on RecyclerView's layout* direction. Used for swipe & drag control.*/public static final int START = LEFT << 2;/*** Horizontal end direction. Resolved to LEFT or RIGHT depending on RecyclerView's layout* direction. Used for swipe & drag control.*/public static final int END = RIGHT << 2;/*** WItemTouchHelperPlus is in idle state. At this state, either there is no related motion event by* the user or latest motion events have not yet triggered a swipe or drag.*/public static final int ACTION_STATE_IDLE = 0;/*** A View is currently being swiped.*/public static final int ACTION_STATE_SWIPE = 1;/*** A View is currently being dragged.*/public static final int ACTION_STATE_DRAG = 2;/*** Animation type for views which are swiped successfully.*/public static final int ANIMATION_TYPE_SWIPE_SUCCESS = 1 << 1;/*** Animation type for views which are not completely swiped thus will animate back to their* original position.*/public static final int ANIMATION_TYPE_SWIPE_CANCEL = 1 << 2;/*** Animation type for views that were dragged and now will animate to their final position.*/public static final int ANIMATION_TYPE_DRAG = 1 << 3;static final String TAG = "WItemTouchHelperPlus";static final boolean DEBUG = false;static final int ACTIVE_POINTER_ID_NONE = -1;static final int DIRECTION_FLAG_COUNT = 8;private static final int ACTION_MODE_IDLE_MASK = (1 << DIRECTION_FLAG_COUNT) - 1;static final int ACTION_MODE_SWIPE_MASK = ACTION_MODE_IDLE_MASK << DIRECTION_FLAG_COUNT;static final int ACTION_MODE_DRAG_MASK = ACTION_MODE_SWIPE_MASK << DIRECTION_FLAG_COUNT;/*** The unit we are using to track velocity*/private static final int PIXELS_PER_SECOND = 1000;/*** Views, whose state should be cleared after they are detached from RecyclerView.* This is necessary after swipe dismissing an item. We wait until animator finishes its job* to clean these views.*/final List<View> mPendingCleanup = new ArrayList<View>();/*** Re-use array to calculate dx dy for a ViewHolder*/private final float[] mTmpPosition = new float[2];/*** Currently selected view holder*/RecyclerView.ViewHolder mSelected = null;/*** Previous selected view holder*/RecyclerView.ViewHolder mPreOpened = null;/*** The reference coordinates for the action start. For drag & drop, this is the time long* press is completed vs for swipe, this is the initial touch point.*/float mInitialTouchX;float mInitialTouchY;/*** Set when WItemTouchHelperPlus is assigned to a RecyclerView.*/float mSwipeEscapeVelocity;/*** Set when WItemTouchHelperPlus is assigned to a RecyclerView.*/float mMaxSwipeVelocity;/*** The diff between the last event and initial touch.*/float mDx;float mDy;/*** The coordinates of the selected view at the time it is selected. We record these values* when action starts so that we can consistently position it even if LayoutManager moves the* View.*/float mSelectedStartX;float mSelectedStartY;/*** The pointer we are tracking.*/int mActivePointerId = ACTIVE_POINTER_ID_NONE;/*** Developer callback which controls the behavior of WItemTouchHelperPlus.*/WItemTouchHelperPlus.Callback mCallback;/*** Current mode.*/int mActionState = ACTION_STATE_IDLE;/*** The direction flags obtained from unmasking* {@link WItemTouchHelperPlus.Callback#getAbsoluteMovementFlags(RecyclerView, RecyclerView.ViewHolder)} for the current* action state.*/int mSelectedFlags;/*** When a View is dragged or swiped and needs to go back to where it was, we create a Recover* Animation and animate it to its location using this custom Animator, instead of using* framework Animators.* Using framework animators has the side effect of clashing with ItemAnimator, creating* jumpy UIs.*/List<WItemTouchHelperPlus.RecoverAnimation> mRecoverAnimations = new ArrayList<>();private int mSlop;RecyclerView mRecyclerView;/*** 判斷當前側滑布局的標記* {@link #SLIDE_ITEM_TYPE_ITEMVIEW}*/private boolean slideItemTypeIsItemView() {return SLIDE_ITEM_TYPE_ITEMVIEW.equals(mCallback.getItemSlideType());}/*** 判斷當前側滑布局的標記* {@link #SLIDE_ITEM_TYPE_SLIDECONTAINER}*/private boolean slideItemTypeIsContainerView() {return SLIDE_ITEM_TYPE_SLIDECONTAINER.equals(mCallback.getItemSlideType());}/*** When user drags a view to the edge, we start scrolling the LayoutManager as long as View* is partially out of bounds.*/final Runnable mScrollRunnable = new Runnable() {@Overridepublic void run() {if (mSelected != null && scrollIfNecessary()) {if (mSelected != null) { //it might be lost during scrollingmoveIfNecessary(mSelected);}mRecyclerView.removeCallbacks(mScrollRunnable);ViewCompat.postOnAnimation(mRecyclerView, this);}}};/*** Used for detecting fling swipe*/VelocityTracker mVelocityTracker;//re-used list for selecting a swap targetprivate List<RecyclerView.ViewHolder> mSwapTargets;//re used for for sorting swap targetsprivate List<Integer> mDistances;/*** If drag & drop is supported, we use child drawing order to bring them to front.*/private RecyclerView.ChildDrawingOrderCallback mChildDrawingOrderCallback = null;/*** This keeps a reference to the child dragged by the user. Even after user stops dragging,* until view reaches its final position (end of recover animation), we keep a reference so* that it can be drawn above other children.*/View mOverdrawChild = null;/*** We cache the position of the overdraw child to avoid recalculating it each time child* position callback is called. This value is invalidated whenever a child is attached or* detached.*/int mOverdrawChildPosition = -1;/*** Used to detect long press.*/GestureDetectorCompat mGestureDetector;/*** Is the last open item closed*/private boolean closePreItem = false;/*** Whether the current entry has been clicked*/private boolean mClick;float mLastX = 0;private final RecyclerView.OnItemTouchListener mOnItemTouchListener = new RecyclerView.OnItemTouchListener() {@Overridepublic boolean onInterceptTouchEvent(RecyclerView recyclerView, MotionEvent event) {mGestureDetector.onTouchEvent(event);if (DEBUG) {Log.d(TAG, "intercept: x:" + event.getX() + ",y:" + event.getY() + ", " + event);}final int action = event.getActionMasked();if (action == MotionEvent.ACTION_DOWN) {mClick = true;mLastX = event.getX();mActivePointerId = event.getPointerId(0);mInitialTouchX = event.getX();mInitialTouchY = event.getY();obtainVelocityTracker();if (mSelected == null) {final WItemTouchHelperPlus.RecoverAnimation animation = findAnimation(event);if (animation != null) {//這里是當item側滑已經展開的時候.如果animation不為null 說明Item的側滑是展開的狀態 需要進行關閉mInitialTouchX -= animation.mX;mInitialTouchY -= animation.mY;endRecoverAnimation(animation.mViewHolder, true);if (mPendingCleanup.remove(animation.mViewHolder.itemView)) {mCallback.clearView(mRecyclerView, animation.mViewHolder);}select(animation.mViewHolder, animation.mActionState);updateDxDy(event, mSelectedFlags, 0);} else {if (null != mPreOpened) {closePreItem = true;closeOpenedPreItem(mPreOpened);return true;}}}} else if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {closePreItem = false;//這邊是新增的if (mClick && action == MotionEvent.ACTION_UP) {doChildClickEvent(event.getRawX(), event.getRawY());}mClick = false;mActivePointerId = ACTIVE_POINTER_ID_NONE;select(null, ACTION_STATE_IDLE);} else if (mActivePointerId != ACTIVE_POINTER_ID_NONE && !closePreItem) {// in a non scroll orientation, if distance change is above threshold, we// can select the itemfinal int index = event.findPointerIndex(mActivePointerId);if (DEBUG) {Log.d(TAG, "pointer index " + index);}if (index >= 0) {checkSelectForSwipe(action, event, index);}}if (mVelocityTracker != null) {mVelocityTracker.addMovement(event);}return mSelected != null;}/*** 判斷當前點擊的位置是否為view并且該View實現了OnClickListener事件* @param x* @param y*/private void doChildClickEvent(float x, float y) {if (mSelected == null) return;View consumeEventView = mSelected.itemView;if (consumeEventView instanceof ViewGroup) {consumeEventView = findConsumeView((ViewGroup) consumeEventView, x, y);}if (consumeEventView != null) {consumeEventView.performClick();}}/*** 查找view* @param parent 父容器* @param x 點擊事件的x坐標* @param y 點擊事件的y坐標* @return*/private View findConsumeView(ViewGroup parent, float x, float y) {for (int i = 0; i < parent.getChildCount(); i++) {View child = parent.getChildAt(i);if (child instanceof ViewGroup && child.getVisibility() == View.VISIBLE) {View view = findConsumeView((ViewGroup) child, x, y);if (view != null) {return view;}} else {if (isInBoundsClickable((int) x, (int) y, child)) return child;}}if (isInBoundsClickable((int) x, (int) y, parent)) return parent;return null;}/*** 邊界判斷* @param x* @param y* @param child 再點擊事件下找到的view* @return*/private boolean isInBoundsClickable(int x, int y, View child) {int[] location = new int[2];child.getLocationOnScreen(location);Rect rect = new Rect(location[0], location[1], location[0] + child.getWidth(), location[1] + child.getHeight());if (rect.contains(x, y) && ViewCompat.hasOnClickListeners(child)&& child.getVisibility() == View.VISIBLE) {return true;}return false;}@Overridepublic void onTouchEvent(RecyclerView recyclerView, MotionEvent event) {mGestureDetector.onTouchEvent(event);if (mVelocityTracker != null) {mVelocityTracker.addMovement(event);}if (mActivePointerId == ACTIVE_POINTER_ID_NONE) {return;}final int action = event.getActionMasked();final int activePointerIndex = event.findPointerIndex(mActivePointerId);if (activePointerIndex >= 0) {checkSelectForSwipe(action, event, activePointerIndex);}RecyclerView.ViewHolder viewHolder = mSelected;if (viewHolder == null) {return;}switch (action) {case MotionEvent.ACTION_MOVE: {// Find the index of the active pointer and fetch its positionif (activePointerIndex >= 0) {if (Math.abs(event.getX() - mLastX) > mSlop) mClick = false;mLastX = event.getX();updateDxDy(event, mSelectedFlags, activePointerIndex);moveIfNecessary(viewHolder);mRecyclerView.removeCallbacks(mScrollRunnable);mScrollRunnable.run();mRecyclerView.invalidate();}break;}case MotionEvent.ACTION_CANCEL:if (mVelocityTracker != null) {mVelocityTracker.clear();}// fall throughcase MotionEvent.ACTION_UP:if (mClick) {doChildClickEvent(event.getRawX(), event.getRawY());}mClick = false;select(null, ACTION_STATE_IDLE);mActivePointerId = ACTIVE_POINTER_ID_NONE;break;case MotionEvent.ACTION_POINTER_UP: {mClick = false;final int pointerIndex = event.getActionIndex();final int pointerId = event.getPointerId(pointerIndex);if (pointerId == mActivePointerId) {// This was our active pointer going up. Choose a new// active pointer and adjust accordingly.final int newPointerIndex = pointerIndex == 0 ? 1 : 0;mActivePointerId = event.getPointerId(newPointerIndex);updateDxDy(event, mSelectedFlags, pointerIndex);}break;}default:mClick = false;break;}}@Overridepublic void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {if (!disallowIntercept) {return;}select(null, ACTION_STATE_IDLE);}};/*** Temporary rect instance that is used when we need to lookup Item decorations.*/private Rect mTmpRect;/*** When user started to drag scroll. Reset when we don't scroll*/private long mDragScrollStartTimeInMs;/*** Creates an WItemTouchHelperPlus that will work with the given Callback.* <p>* You can attach WItemTouchHelperPlus to a RecyclerView via* {@link #attachToRecyclerView(RecyclerView)}. Upon attaching, it will add an item decoration,* an onItemTouchListener and a Child attach / detach listener to the RecyclerView.** @param callback The Callback which controls the behavior of this touch helper.*/public WItemTouchHelperPlus(WItemTouchHelperPlus.Callback callback) {mCallback = callback;}private boolean hitTest(View child, float x, float y, float left, float top, RecyclerView.ViewHolder vh) {return x >= left&& x <= left + child.getWidth()&& y >= top&& y <= top + child.getHeight();}/*** Attaches the WItemTouchHelperPlus to the provided RecyclerView. If TouchHelper is already* attached to a RecyclerView, it will first detach from the previous one. You can call this* method with {@code null} to detach it from the current RecyclerView.** @param recyclerView The RecyclerView instance to which you want to add this helper or* {@code null} if you want to remove WItemTouchHelperPlus from the current* RecyclerView.*/public void attachToRecyclerView(@Nullable RecyclerView recyclerView) {if (mRecyclerView == recyclerView) {return; // nothing to do}if (mRecyclerView != null) {destroyCallbacks();}mRecyclerView = recyclerView;if (mRecyclerView != null) {final Resources resources = recyclerView.getResources();mSwipeEscapeVelocity = resources.getDimension(android.support.v7.recyclerview.R.dimen.item_touch_helper_swipe_escape_velocity);mMaxSwipeVelocity = resources.getDimension(android.support.v7.recyclerview.R.dimen.item_touch_helper_swipe_escape_max_velocity);setupCallbacks();mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {@Overridepublic void onScrollStateChanged(RecyclerView recyclerView, int newState) {super.onScrollStateChanged(recyclerView, newState);if (newState == RecyclerView.SCROLL_STATE_DRAGGING && mPreOpened != null) {closeOpenedPreItem(mPreOpened);}}});}}/*** 關閉一個打開的Item** @param viewHolder 要關閉的Item的ViewHolder*/private void closeOpenedPreItem(RecyclerView.ViewHolder viewHolder) {if (viewHolder == null) return;final View view = getItemFrontView(viewHolder);if (view == null) return;ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "translationX", view.getTranslationX(), 0f);objectAnimator.addListener(new AnimatorListenerAdapter() {@Overridepublic void onAnimationStart(Animator animation) {super.onAnimationStart(animation);if (mPreOpened != null) {if (mPendingCleanup.remove(mPreOpened.itemView)) {mCallback.clearView(mRecyclerView, mPreOpened);}}endRecoverAnimation(mPreOpened, true);mPreOpened = mSelected;}@Overridepublic void onAnimationEnd(Animator animation) {super.onAnimationEnd(animation);mRecoverAnimations.clear();}});objectAnimator.setInterpolator(new AccelerateDecelerateInterpolator());objectAnimator.start();}/*** @param viewHolder* @return*/public View getItemFrontView(RecyclerView.ViewHolder viewHolder) {if (viewHolder == null) return null;if (viewHolder.itemView instanceof ViewGroup) {ViewGroup viewGroup = (ViewGroup) viewHolder.itemView;for (int i = 0; i < viewGroup.getChildCount(); i++) {View childAt = viewGroup.getChildAt(i);String tag = (String) childAt.getTag();/*這個標記必須再xml布局里面.<RelativeLayoutandroid:id="@+id/slide_itemView"android:clipChildren="false"android:tag="slide_flag"android:layout_width="match_parent"android:layout_height="match_parent">*/if ("slide_flag".equals(tag)) {return childAt;}}return viewHolder.itemView;} else {return viewHolder.itemView;}}private void setupCallbacks() {ViewConfiguration vc = ViewConfiguration.get(mRecyclerView.getContext());mSlop = vc.getScaledTouchSlop();mRecyclerView.addItemDecoration(this);mRecyclerView.addOnItemTouchListener(mOnItemTouchListener);mRecyclerView.addOnChildAttachStateChangeListener(this);initGestureDetector();}private void destroyCallbacks() {mRecyclerView.removeItemDecoration(this);mRecyclerView.removeOnItemTouchListener(mOnItemTouchListener);mRecyclerView.removeOnChildAttachStateChangeListener(this);// clean all attachedfinal int recoverAnimSize = mRecoverAnimations.size();for (int i = recoverAnimSize - 1; i >= 0; i--) {final WItemTouchHelperPlus.RecoverAnimation recoverAnimation = mRecoverAnimations.get(0);mCallback.clearView(mRecyclerView, recoverAnimation.mViewHolder);}mRecoverAnimations.clear();mOverdrawChild = null;mOverdrawChildPosition = -1;releaseVelocityTracker();}private void initGestureDetector() {if (mGestureDetector != null) {return;}mGestureDetector = new GestureDetectorCompat(mRecyclerView.getContext(),new WItemTouchHelperPlus.WItemTouchHelperPlusGestureListener());}private void getSelectedDxDy(float[] outPosition) {if ((mSelectedFlags & (LEFT | RIGHT)) != 0) {outPosition[0] = mSelectedStartX + mDx - mSelected.itemView.getLeft();} else {outPosition[0] = mSelected.itemView.getTranslationX();}if ((mSelectedFlags & (UP | DOWN)) != 0) {outPosition[1] = mSelectedStartY + mDy - mSelected.itemView.getTop();} else {outPosition[1] = mSelected.itemView.getTranslationY();}}@Overridepublic void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {float dx = 0, dy = 0;if (mSelected != null) {getSelectedDxDy(mTmpPosition);dx = mTmpPosition[0];dy = mTmpPosition[1];}mCallback.onDrawOver(c, parent, mSelected,mRecoverAnimations, mActionState, dx, dy);}@Overridepublic void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {// we don't know if RV changed something so we should invalidate this index.mOverdrawChildPosition = -1;float dx = 0, dy = 0;if (mSelected != null) {getSelectedDxDy(mTmpPosition);dx = mTmpPosition[0];dy = mTmpPosition[1];}mCallback.onDraw(c, parent, mSelected,mRecoverAnimations, mActionState, dx, dy);}private float getSwipeWidth() {if (mSelected instanceof Extension) {return ((Extension) mSelected).getActionWidth();}return mRecyclerView.getWidth();}/*** Starts dragging or swiping the given View. Call with null if you want to clear it.** @param selected The ViewHolder to drag or swipe. Can be null if you want to cancel the* current action* @param actionState The type of action*/void select(RecyclerView.ViewHolder selected, int actionState) {if (selected == mSelected && actionState == mActionState) {return;}mDragScrollStartTimeInMs = Long.MIN_VALUE;final int prevActionState = mActionState;// prevent duplicate animationsendRecoverAnimation(selected, true);mActionState = actionState;if (actionState == ACTION_STATE_DRAG) {// we remove after animation is complete. this means we only elevate the last drag// child but that should perform good enough as it is very hard to start dragging a// new child before the previous one settles.mOverdrawChild = selected.itemView;addChildDrawingOrderCallback();}int actionStateMask = (1 << (DIRECTION_FLAG_COUNT + DIRECTION_FLAG_COUNT * actionState))- 1;boolean preventLayout = false;if (mSelected != null) {final RecyclerView.ViewHolder prevSelected = mSelected;if (prevSelected.itemView.getParent() != null) {final int swipeDir = prevActionState == ACTION_STATE_DRAG ? 0: swipeIfNecessary(prevSelected);releaseVelocityTracker();// find where we should animate tofinal float targetTranslateX, targetTranslateY;int animationType;switch (swipeDir) {case LEFT:case RIGHT:case START:case END:targetTranslateY = 0;float swipeWidth = getSwipeWidth();targetTranslateX = Math.signum(mDx) * swipeWidth;break;case UP:case DOWN:targetTranslateX = 0;targetTranslateY = Math.signum(mDy) * mRecyclerView.getHeight();break;default:targetTranslateX = 0;targetTranslateY = 0;}if (prevActionState == ACTION_STATE_DRAG) {animationType = ANIMATION_TYPE_DRAG;} else if (swipeDir > 0) {animationType = ANIMATION_TYPE_SWIPE_SUCCESS;} else {animationType = ANIMATION_TYPE_SWIPE_CANCEL;}getSelectedDxDy(mTmpPosition);final float currentTranslateX = mTmpPosition[0];final float currentTranslateY = mTmpPosition[1];final WItemTouchHelperPlus.RecoverAnimation rv = new WItemTouchHelperPlus.RecoverAnimation(prevSelected, animationType,prevActionState, currentTranslateX, currentTranslateY,targetTranslateX, targetTranslateY) {@Overridepublic void onAnimationEnd(Animator animation) {super.onAnimationEnd(animation);if (this.mOverridden) {return;}if (swipeDir <= 0) {mPreOpened = null;// this is a drag or failed swipe. recover immediatelymCallback.clearView(mRecyclerView, prevSelected);// full cleanup will happen on onDrawOver} else {// wait until remove animation is complete.mPendingCleanup.add(prevSelected.itemView);mPreOpened = prevSelected;mIsPendingCleanup = true;if (swipeDir > 0) {// Animation might be ended by other animators during a layout.// We defer callback to avoid editing adapter during a layout.postDispatchSwipe(this, swipeDir);}}// removed from the list after it is drawn for the last timeif (mOverdrawChild == prevSelected.itemView) {removeChildDrawingOrderCallbackIfNecessary(prevSelected.itemView);}}@Overridepublic void onAnimationStart(Animator animation) {super.onAnimationStart(animation);Log.e("WANG", "WItemTouchHelperPlus.onAnimationStart Recover ");}};final long duration = mCallback.getAnimationDuration(mRecyclerView, animationType,targetTranslateX - currentTranslateX, targetTranslateY - currentTranslateY);rv.setDuration(duration);mRecoverAnimations.add(rv);rv.start();preventLayout = true;} else {removeChildDrawingOrderCallbackIfNecessary(prevSelected.itemView);mCallback.clearView(mRecyclerView, prevSelected);}mSelected = null;}if (selected != null) {mSelectedFlags =(mCallback.getAbsoluteMovementFlags(mRecyclerView, selected) & actionStateMask)>> (mActionState * DIRECTION_FLAG_COUNT);mSelectedStartX = selected.itemView.getLeft();mSelectedStartY = selected.itemView.getTop();mSelected = selected;if (actionState == ACTION_STATE_DRAG) {mSelected.itemView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);}}final ViewParent rvParent = mRecyclerView.getParent();if (rvParent != null) {rvParent.requestDisallowInterceptTouchEvent(mSelected != null);}if (!preventLayout) {mRecyclerView.getLayoutManager().requestSimpleAnimationsInNextLayout();}mCallback.onSelectedChanged(mSelected, mActionState);mRecyclerView.invalidate();}void postDispatchSwipe(final WItemTouchHelperPlus.RecoverAnimation anim, final int swipeDir) {// wait until animations are complete.mRecyclerView.post(new Runnable() {@Overridepublic void run() {if (mRecyclerView != null && mRecyclerView.isAttachedToWindow()&& !anim.mOverridden&& anim.mViewHolder.getAdapterPosition() != RecyclerView.NO_POSITION) {final RecyclerView.ItemAnimator animator = mRecyclerView.getItemAnimator();// if animator is running or we have other active recover animations, we try// not to call onSwiped because DefaultItemAnimator is not good at merging// animations. Instead, we wait and batch.if ((animator == null || !animator.isRunning(null))&& !hasRunningRecoverAnim()) {mCallback.onSwiped(anim.mViewHolder, swipeDir);} else {mRecyclerView.post(this);}}}});}boolean hasRunningRecoverAnim() {final int size = mRecoverAnimations.size();for (int i = 0; i < size; i++) {if (!mRecoverAnimations.get(i).mEnded) {return true;}}return false;}/*** If user drags the view to the edge, trigger a scroll if necessary.*/boolean scrollIfNecessary() {if (mSelected == null) {mDragScrollStartTimeInMs = Long.MIN_VALUE;return false;}final long now = System.currentTimeMillis();final long scrollDuration = mDragScrollStartTimeInMs== Long.MIN_VALUE ? 0 : now - mDragScrollStartTimeInMs;RecyclerView.LayoutManager lm = mRecyclerView.getLayoutManager();if (mTmpRect == null) {mTmpRect = new Rect();}int scrollX = 0;int scrollY = 0;lm.calculateItemDecorationsForChild(mSelected.itemView, mTmpRect);if (lm.canScrollHorizontally()) {int curX = (int) (mSelectedStartX + mDx);final int leftDiff = curX - mTmpRect.left - mRecyclerView.getPaddingLeft();if (mDx < 0 && leftDiff < 0) {scrollX = leftDiff;} else if (mDx > 0) {final int rightDiff =curX + mSelected.itemView.getWidth() + mTmpRect.right- (mRecyclerView.getWidth() - mRecyclerView.getPaddingRight());if (rightDiff > 0) {scrollX = rightDiff;}}}if (lm.canScrollVertically()) {int curY = (int) (mSelectedStartY + mDy);final int topDiff = curY - mTmpRect.top - mRecyclerView.getPaddingTop();if (mDy < 0 && topDiff < 0) {scrollY = topDiff;} else if (mDy > 0) {final int bottomDiff = curY + mSelected.itemView.getHeight() + mTmpRect.bottom- (mRecyclerView.getHeight() - mRecyclerView.getPaddingBottom());if (bottomDiff > 0) {scrollY = bottomDiff;}}}if (scrollX != 0) {scrollX = mCallback.interpolateOutOfBoundsScroll(mRecyclerView,mSelected.itemView.getWidth(), scrollX,mRecyclerView.getWidth(), scrollDuration);}if (scrollY != 0) {scrollY = mCallback.interpolateOutOfBoundsScroll(mRecyclerView,mSelected.itemView.getHeight(), scrollY,mRecyclerView.getHeight(), scrollDuration);}if (scrollX != 0 || scrollY != 0) {if (mDragScrollStartTimeInMs == Long.MIN_VALUE) {mDragScrollStartTimeInMs = now;}mRecyclerView.scrollBy(scrollX, scrollY);return true;}mDragScrollStartTimeInMs = Long.MIN_VALUE;return false;}private List<RecyclerView.ViewHolder> findSwapTargets(RecyclerView.ViewHolder viewHolder) {if (mSwapTargets == null) {mSwapTargets = new ArrayList<RecyclerView.ViewHolder>();mDistances = new ArrayList<Integer>();} else {mSwapTargets.clear();mDistances.clear();}final int margin = mCallback.getBoundingBoxMargin();final int left = Math.round(mSelectedStartX + mDx) - margin;final int top = Math.round(mSelectedStartY + mDy) - margin;final int right = left + viewHolder.itemView.getWidth() + 2 * margin;final int bottom = top + viewHolder.itemView.getHeight() + 2 * margin;final int centerX = (left + right) / 2;final int centerY = (top + bottom) / 2;final RecyclerView.LayoutManager lm = mRecyclerView.getLayoutManager();final int childCount = lm.getChildCount();for (int i = 0; i < childCount; i++) {View other = lm.getChildAt(i);if (other == viewHolder.itemView) {continue; //myself!}if (other.getBottom() < top || other.getTop() > bottom|| other.getRight() < left || other.getLeft() > right) {continue;}final RecyclerView.ViewHolder otherVh = mRecyclerView.getChildViewHolder(other);if (mCallback.canDropOver(mRecyclerView, mSelected, otherVh)) {// find the index to addfinal int dx = Math.abs(centerX - (other.getLeft() + other.getRight()) / 2);final int dy = Math.abs(centerY - (other.getTop() + other.getBottom()) / 2);final int dist = dx * dx + dy * dy;int pos = 0;final int cnt = mSwapTargets.size();for (int j = 0; j < cnt; j++) {if (dist > mDistances.get(j)) {pos++;} else {break;}}mSwapTargets.add(pos, otherVh);mDistances.add(pos, dist);}}return mSwapTargets;}/*** Checks if we should swap w/ another view holder.*/void moveIfNecessary(RecyclerView.ViewHolder viewHolder) {if (mRecyclerView.isLayoutRequested()) {return;}if (mActionState != ACTION_STATE_DRAG) {return;}final float threshold = mCallback.getMoveThreshold(viewHolder);final int x = (int) (mSelectedStartX + mDx);final int y = (int) (mSelectedStartY + mDy);if (Math.abs(y - viewHolder.itemView.getTop()) < viewHolder.itemView.getHeight() * threshold&& Math.abs(x - viewHolder.itemView.getLeft())< viewHolder.itemView.getWidth() * threshold) {return;}List<RecyclerView.ViewHolder> swapTargets = findSwapTargets(viewHolder);if (swapTargets.size() == 0) {return;}// may swap.RecyclerView.ViewHolder target = mCallback.chooseDropTarget(viewHolder, swapTargets, x, y);if (target == null) {mSwapTargets.clear();mDistances.clear();return;}final int toPosition = target.getAdapterPosition();final int fromPosition = viewHolder.getAdapterPosition();if (mCallback.onMove(mRecyclerView, viewHolder, target)) {// keep target visiblemCallback.onMoved(mRecyclerView, viewHolder, fromPosition,target, toPosition, x, y);}}@Overridepublic void onChildViewAttachedToWindow(View view) {}@Overridepublic void onChildViewDetachedFromWindow(View view) {removeChildDrawingOrderCallbackIfNecessary(view);final RecyclerView.ViewHolder holder = mRecyclerView.getChildViewHolder(view);if (holder == null) {return;}if (mSelected != null && holder == mSelected) {select(null, ACTION_STATE_IDLE);} else {endRecoverAnimation(holder, false); // this may push it into pending cleanup list.if (mPendingCleanup.remove(holder.itemView)) {mCallback.clearView(mRecyclerView, holder);}}}/*** Returns the animation type or 0 if cannot be found.*/int endRecoverAnimation(RecyclerView.ViewHolder viewHolder, boolean override) {final int recoverAnimSize = mRecoverAnimations.size();for (int i = recoverAnimSize - 1; i >= 0; i--) {final WItemTouchHelperPlus.RecoverAnimation anim = mRecoverAnimations.get(i);if (anim.mViewHolder == viewHolder) {anim.mOverridden |= override;if (!anim.mEnded) {anim.cancel();}mRecoverAnimations.remove(i);return anim.mAnimationType;}}return 0;}@Overridepublic void getItemOffsets(Rect outRect, View view, RecyclerView parent,RecyclerView.State state) {outRect.setEmpty();}void obtainVelocityTracker() {if (mVelocityTracker != null) {mVelocityTracker.recycle();}mVelocityTracker = VelocityTracker.obtain();}private void releaseVelocityTracker() {if (mVelocityTracker != null) {mVelocityTracker.recycle();mVelocityTracker = null;}}private RecyclerView.ViewHolder findSwipedView(MotionEvent motionEvent) {final RecyclerView.LayoutManager lm = mRecyclerView.getLayoutManager();if (mActivePointerId == ACTIVE_POINTER_ID_NONE) {return null;}final int pointerIndex = motionEvent.findPointerIndex(mActivePointerId);final float dx = motionEvent.getX(pointerIndex) - mInitialTouchX;final float dy = motionEvent.getY(pointerIndex) - mInitialTouchY;final float absDx = Math.abs(dx);final float absDy = Math.abs(dy);if (absDx < mSlop && absDy < mSlop) {return null;}if (absDx > absDy && lm.canScrollHorizontally()) {return null;} else if (absDy > absDx && lm.canScrollVertically()) {return null;}View child = findChildView(motionEvent);if (child == null) {return null;}return mRecyclerView.getChildViewHolder(child);}/*** Checks whether we should select a View for swiping.*/boolean checkSelectForSwipe(int action, MotionEvent motionEvent, int pointerIndex) {if (mSelected != null || action != MotionEvent.ACTION_MOVE|| mActionState == ACTION_STATE_DRAG || !mCallback.isItemViewSwipeEnabled()) {return false;}if (mRecyclerView.getScrollState() == RecyclerView.SCROLL_STATE_DRAGGING) {return false;}final RecyclerView.ViewHolder vh = findSwipedView(motionEvent);if (vh == null) {return false;}final int movementFlags = mCallback.getAbsoluteMovementFlags(mRecyclerView, vh);final int swipeFlags = (movementFlags & ACTION_MODE_SWIPE_MASK)>> (DIRECTION_FLAG_COUNT * ACTION_STATE_SWIPE);if (swipeFlags == 0) {return false;}// mDx and mDy are only set in allowed directions. We use custom x/y here instead of// updateDxDy to avoid swiping if user moves more in the other directionfinal float x = motionEvent.getX(pointerIndex);final float y = motionEvent.getY(pointerIndex);// Calculate the distance movedfinal float dx = x - mInitialTouchX;final float dy = y - mInitialTouchY;// swipe target is chose w/o applying flags so it does not really check if swiping in that// direction is allowed. This why here, we use mDx mDy to check slope value again.final float absDx = Math.abs(dx);final float absDy = Math.abs(dy);if (absDx < mSlop && absDy < mSlop) {return false;}if (absDx > absDy) {if (dx < 0 && (swipeFlags & LEFT) == 0) {return false;}if (dx > 0 && (swipeFlags & RIGHT) == 0) {return false;}} else {if (dy < 0 && (swipeFlags & UP) == 0) {return false;}if (dy > 0 && (swipeFlags & DOWN) == 0) {return false;}}mDx = mDy = 0f;mActivePointerId = motionEvent.getPointerId(0);select(vh, ACTION_STATE_SWIPE);return true;}View findChildView(MotionEvent event) {// first check elevated views, if none, then call RVfinal float x = event.getX();final float y = event.getY();if (mSelected != null) {final View selectedView = mSelected.itemView;if (hitTest(selectedView, x, y, mSelectedStartX + mDx, mSelectedStartY + mDy, mSelected)) {return selectedView;}}for (int i = mRecoverAnimations.size() - 1; i >= 0; i--) {final WItemTouchHelperPlus.RecoverAnimation anim = mRecoverAnimations.get(i);final View view = anim.mViewHolder.itemView;boolean hitTest = hitTest(view, x, y, anim.mX, anim.mY, anim.mViewHolder);if (hitTest) {return view;}}View childViewUnder = mRecyclerView.findChildViewUnder(x, y);return childViewUnder;}/*** Starts dragging the provided ViewHolder. By default, WItemTouchHelperPlus starts a drag when a* View is long pressed. You can disable that behavior by overriding* {@link WItemTouchHelperPlus.Callback#isLongPressDragEnabled()}.* <p>* For this method to work:* <ul>* <li>The provided ViewHolder must be a child of the RecyclerView to which this* WItemTouchHelperPlus* is attached.</li>* <li>{@link WItemTouchHelperPlus.Callback} must have dragging enabled.</li>* <li>There must be a previous touch event that was reported to the WItemTouchHelperPlus* through RecyclerView's ItemTouchListener mechanism. As long as no other ItemTouchListener* grabs previous events, this should work as expected.</li>* </ul>* <p>* For example, if you would like to let your user to be able to drag an Item by touching one* of its descendants, you may implement it as follows:* <pre>* viewHolder.dragButton.setOnTouchListener(new View.OnTouchListener() {* public boolean onTouch(View v, MotionEvent event) {* if (MotionEvent.getActionMasked(event) == MotionEvent.ACTION_DOWN) {* mWItemTouchHelperPlus.startDrag(viewHolder);* }* return false;* }* });* </pre>* <p>** @param viewHolder The ViewHolder to start dragging. It must be a direct child of* RecyclerView.* @see WItemTouchHelperPlus.Callback#isItemViewSwipeEnabled()*/public void startDrag(RecyclerView.ViewHolder viewHolder) {if (!mCallback.hasDragFlag(mRecyclerView, viewHolder)) {Log.e(TAG, "Start drag has been called but dragging is not enabled");return;}if (viewHolder.itemView.getParent() != mRecyclerView) {Log.e(TAG, "Start drag has been called with a view holder which is not a child of "+ "the RecyclerView which is controlled by this WItemTouchHelperPlus.");return;}obtainVelocityTracker();mDx = mDy = 0f;select(viewHolder, ACTION_STATE_DRAG);}/*** Starts swiping the provided ViewHolder. By default, WItemTouchHelperPlus starts swiping a View* when user swipes their finger (or mouse pointer) over the View. You can disable this* behavior* by overriding {@link WItemTouchHelperPlus.Callback}* <p>* For this method to work:* <ul>* <li>The provided ViewHolder must be a child of the RecyclerView to which this* WItemTouchHelperPlus is attached.</li>* <li>{@link WItemTouchHelperPlus.Callback} must have swiping enabled.</li>* <li>There must be a previous touch event that was reported to the WItemTouchHelperPlus* through RecyclerView's ItemTouchListener mechanism. As long as no other ItemTouchListener* grabs previous events, this should work as expected.</li>* </ul>* <p>* For example, if you would like to let your user to be able to swipe an Item by touching one* of its descendants, you may implement it as follows:* <pre>* viewHolder.dragButton.setOnTouchListener(new View.OnTouchListener() {* public boolean onTouch(View v, MotionEvent event) {* if (MotionEvent.getActionMasked(event) == MotionEvent.ACTION_DOWN) {* mWItemTouchHelperPlus.startSwipe(viewHolder);* }* return false;* }* });* </pre>** @param viewHolder The ViewHolder to start swiping. It must be a direct child of* RecyclerView.*/public void startSwipe(RecyclerView.ViewHolder viewHolder) {if (!mCallback.hasSwipeFlag(mRecyclerView, viewHolder)) {Log.e(TAG, "Start swipe has been called but swiping is not enabled");return;}if (viewHolder.itemView.getParent() != mRecyclerView) {Log.e(TAG, "Start swipe has been called with a view holder which is not a child of "+ "the RecyclerView controlled by this WItemTouchHelperPlus.");return;}obtainVelocityTracker();mDx = mDy = 0f;select(viewHolder, ACTION_STATE_SWIPE);}WItemTouchHelperPlus.RecoverAnimation findAnimation(MotionEvent event) {if (mRecoverAnimations.isEmpty()) {return null;}View target = findChildView(event);for (int i = mRecoverAnimations.size() - 1; i >= 0; i--) {final WItemTouchHelperPlus.RecoverAnimation anim = mRecoverAnimations.get(i);if (anim.mViewHolder.itemView == target) {return anim;}}return null;}void updateDxDy(MotionEvent ev, int directionFlags, int pointerIndex) {final float x = ev.getX(pointerIndex);final float y = ev.getY(pointerIndex);// Calculate the distance movedmDx = x - mInitialTouchX;mDy = y - mInitialTouchY;if ((directionFlags & LEFT) == 0) {mDx = Math.max(0, mDx);}if ((directionFlags & RIGHT) == 0) {mDx = Math.min(0, mDx);}if ((directionFlags & UP) == 0) {mDy = Math.max(0, mDy);}if ((directionFlags & DOWN) == 0) {mDy = Math.min(0, mDy);}}private int swipeIfNecessary(RecyclerView.ViewHolder viewHolder) {if (mActionState == ACTION_STATE_DRAG) {return 0;}final int originalMovementFlags = mCallback.getMovementFlags(mRecyclerView, viewHolder);final int absoluteMovementFlags = mCallback.convertToAbsoluteDirection(originalMovementFlags,ViewCompat.getLayoutDirection(mRecyclerView));final int flags = (absoluteMovementFlags& ACTION_MODE_SWIPE_MASK) >> (ACTION_STATE_SWIPE * DIRECTION_FLAG_COUNT);if (flags == 0) {return 0;}final int originalFlags = (originalMovementFlags& ACTION_MODE_SWIPE_MASK) >> (ACTION_STATE_SWIPE * DIRECTION_FLAG_COUNT);int swipeDir;if (Math.abs(mDx) > Math.abs(mDy)) {if ((swipeDir = checkHorizontalSwipe(viewHolder, flags)) > 0) {// if swipe dir is not in original flags, it should be the relative directionif ((originalFlags & swipeDir) == 0) {// convert to relativereturn WItemTouchHelperPlus.Callback.convertToRelativeDirection(swipeDir,ViewCompat.getLayoutDirection(mRecyclerView));}return swipeDir;}if ((swipeDir = checkVerticalSwipe(viewHolder, flags)) > 0) {return swipeDir;}} else {if ((swipeDir = checkVerticalSwipe(viewHolder, flags)) > 0) {return swipeDir;}if ((swipeDir = checkHorizontalSwipe(viewHolder, flags)) > 0) {// if swipe dir is not in original flags, it should be the relative directionif ((originalFlags & swipeDir) == 0) {// convert to relativereturn WItemTouchHelperPlus.Callback.convertToRelativeDirection(swipeDir,ViewCompat.getLayoutDirection(mRecyclerView));}return swipeDir;}}return 0;}private int checkHorizontalSwipe(RecyclerView.ViewHolder viewHolder, int flags) {if ((flags & (LEFT | RIGHT)) != 0) {final int dirFlag = mDx > 0 ? RIGHT : LEFT;if (mVelocityTracker != null && mActivePointerId > -1) {mVelocityTracker.computeCurrentVelocity(PIXELS_PER_SECOND,mCallback.getSwipeVelocityThreshold(mMaxSwipeVelocity));final float xVelocity = mVelocityTracker.getXVelocity(mActivePointerId);final float yVelocity = mVelocityTracker.getYVelocity(mActivePointerId);final int velDirFlag = xVelocity > 0f ? RIGHT : LEFT;final float absXVelocity = Math.abs(xVelocity);if ((velDirFlag & flags) != 0 && dirFlag == velDirFlag&& absXVelocity >= mCallback.getSwipeEscapeVelocity(mSwipeEscapeVelocity)&& absXVelocity > Math.abs(yVelocity)) {return velDirFlag;}}int width = mRecyclerView.getWidth();if (viewHolder instanceof Extension && mCallback.getItemSlideType().equals(SLIDE_ITEM_TYPE_ITEMVIEW)) {Extension extension = (Extension) viewHolder;width += (int) extension.getActionWidth();}final float threshold = width * mCallback.getSwipeThreshold(viewHolder);if ((flags & dirFlag) != 0 && Math.abs(mDx) > threshold) {return dirFlag;}}return 0;}private int checkVerticalSwipe(RecyclerView.ViewHolder viewHolder, int flags) {if ((flags & (UP | DOWN)) != 0) {final int dirFlag = mDy > 0 ? DOWN : UP;if (mVelocityTracker != null && mActivePointerId > -1) {mVelocityTracker.computeCurrentVelocity(PIXELS_PER_SECOND,mCallback.getSwipeVelocityThreshold(mMaxSwipeVelocity));final float xVelocity = mVelocityTracker.getXVelocity(mActivePointerId);final float yVelocity = mVelocityTracker.getYVelocity(mActivePointerId);final int velDirFlag = yVelocity > 0f ? DOWN : UP;final float absYVelocity = Math.abs(yVelocity);if ((velDirFlag & flags) != 0 && velDirFlag == dirFlag&& absYVelocity >= mCallback.getSwipeEscapeVelocity(mSwipeEscapeVelocity)&& absYVelocity > Math.abs(xVelocity)) {return velDirFlag;}}final float threshold = mRecyclerView.getHeight() * mCallback.getSwipeThreshold(viewHolder);if ((flags & dirFlag) != 0 && Math.abs(mDy) > threshold) {return dirFlag;}}return 0;}private void addChildDrawingOrderCallback() {if (Build.VERSION.SDK_INT >= 21) {return; // we use elevation on Lollipop}if (mChildDrawingOrderCallback == null) {mChildDrawingOrderCallback = new RecyclerView.ChildDrawingOrderCallback() {@Overridepublic int onGetChildDrawingOrder(int childCount, int i) {if (mOverdrawChild == null) {return i;}int childPosition = mOverdrawChildPosition;if (childPosition == -1) {childPosition = mRecyclerView.indexOfChild(mOverdrawChild);mOverdrawChildPosition = childPosition;}if (i == childCount - 1) {return childPosition;}return i < childPosition ? i : i + 1;}};}mRecyclerView.setChildDrawingOrderCallback(mChildDrawingOrderCallback);}void removeChildDrawingOrderCallbackIfNecessary(View view) {if (view == mOverdrawChild) {mOverdrawChild = null;// only remove if we've addedif (mChildDrawingOrderCallback != null) {mRecyclerView.setChildDrawingOrderCallback(null);}}}/*** An interface which can be implemented by LayoutManager for better integration with* {@link WItemTouchHelperPlus}.*/public interface ViewDropHandler {/*** Called by the {@link WItemTouchHelperPlus} after a View is dropped over another View.* <p>* A LayoutManager should implement this interface to get ready for the upcoming move* operation.* <p>* For example, LinearLayoutManager sets up a "scrollToPositionWithOffset" calls so that* the View under drag will be used as an anchor View while calculating the next layout,* making layout stay consistent.** @param view The View which is being dragged. It is very likely that user is still* dragging this View so there might be other* {@link #prepareForDrop(View, View, int, int)} after this one.* @param target The target view which is being dropped on.* @param x The <code>left</code> offset of the View that is being dragged. This value* includes the movement caused by the user.* @param y The <code>top</code> offset of the View that is being dragged. This value* includes the movement caused by the user.*/void prepareForDrop(View view, View target, int x, int y);}/*** This class is the contract between WItemTouchHelperPlus and your application. It lets you control* which touch behaviors are enabled per each ViewHolder and also receive callbacks when user* performs these actions.* <p>* To control which actions user can take on each view, you should override* {@link #getMovementFlags(RecyclerView, RecyclerView.ViewHolder)} and return appropriate set* of direction flags. ({@link #LEFT}, {@link #RIGHT}, {@link #START}, {@link #END},* {@link #UP}, {@link #DOWN}). You can use* {@link #makeMovementFlags(int, int)} to easily construct it. Alternatively, you can use* {@link WItemTouchHelperPlus.SimpleCallback}.* <p>* If user drags an item, WItemTouchHelperPlus will call* {@link WItemTouchHelperPlus.Callback#onMove(RecyclerView, RecyclerView.ViewHolder, RecyclerView.ViewHolder)* onMove(recyclerView, dragged, target)}.* Upon receiving this callback, you should move the item from the old position* ({@code dragged.getAdapterPosition()}) to new position ({@code target.getAdapterPosition()})* in your adapter and also call {@link RecyclerView.Adapter#notifyItemMoved(int, int)}.* To control where a View can be dropped, you can override* {@link #canDropOver(RecyclerView, RecyclerView.ViewHolder, RecyclerView.ViewHolder)}. When a* dragging View overlaps multiple other views, Callback chooses the closest View with which* dragged View might have changed positions. Although this approach works for many use cases,* if you have a custom LayoutManager, you can override* {@link #chooseDropTarget(RecyclerView.ViewHolder, java.util.List, int, int)} to select a* custom drop target.* <p>* When a View is swiped, WItemTouchHelperPlus animates it until it goes out of bounds, then calls* {@link #onSwiped(RecyclerView.ViewHolder, int)}. At this point, you should update your* adapter (e.g. remove the item) and call related Adapter#notify event.*/@SuppressWarnings("UnusedParameters")public abstract static class Callback {public static final int DEFAULT_DRAG_ANIMATION_DURATION = 200;public static final int DEFAULT_SWIPE_ANIMATION_DURATION = 250;static final int RELATIVE_DIR_FLAGS = START | END| ((START | END) << DIRECTION_FLAG_COUNT)| ((START | END) << (2 * DIRECTION_FLAG_COUNT));private static final ItemTouchUIUtil sUICallback;private static final int ABS_HORIZONTAL_DIR_FLAGS = LEFT | RIGHT| ((LEFT | RIGHT) << DIRECTION_FLAG_COUNT)| ((LEFT | RIGHT) << (2 * DIRECTION_FLAG_COUNT));private static final Interpolator sDragScrollInterpolator = new Interpolator() {@Overridepublic float getInterpolation(float t) {return t * t * t * t * t;}};private static final Interpolator sDragViewScrollCapInterpolator = new Interpolator() {@Overridepublic float getInterpolation(float t) {t -= 1.0f;return t * t * t * t * t + 1.0f;}};/*** Drag scroll speed keeps accelerating until this many milliseconds before being capped.*/private static final long DRAG_SCROLL_ACCELERATION_LIMIT_TIME_MS = 2000;private int mCachedMaxScrollSpeed = -1;static {if (Build.VERSION.SDK_INT >= 21) {sUICallback = new ItemTouchUIUtilImpl.Lollipop();} else {sUICallback = new ItemTouchUIUtilImpl.Honeycomb();}}/*** Returns the {@link ItemTouchUIUtil} that is used by the {@link WItemTouchHelperPlus.Callback} class for* visual* changes on Views in response to user interactions. {@link ItemTouchUIUtil} has different* implementations for different platform versions.* <p>* By default, {@link WItemTouchHelperPlus.Callback} applies these changes on* {@link RecyclerView.ViewHolder#itemView}.* <p>* For example, if you have a use case where you only want the text to move when user* swipes over the view, you can do the following:* <pre>* public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder){* getDefaultUIUtil().clearView(((ItemTouchViewHolder) viewHolder).textView);* }* public void onSelectedChanged(RecyclerView.ViewHolder viewHolder, int actionState) {* if (viewHolder != null){* getDefaultUIUtil().onSelected(((ItemTouchViewHolder) viewHolder).textView);* }* }* public void onChildDraw(Canvas c, RecyclerView recyclerView,* RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState,* boolean isCurrentlyActive) {* getDefaultUIUtil().onDraw(c, recyclerView,* ((ItemTouchViewHolder) viewHolder).textView, dX, dY,* actionState, isCurrentlyActive);* return true;* }* public void onChildDrawOver(Canvas c, RecyclerView recyclerView,* RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState,* boolean isCurrentlyActive) {* getDefaultUIUtil().onDrawOver(c, recyclerView,* ((ItemTouchViewHolder) viewHolder).textView, dX, dY,* actionState, isCurrentlyActive);* return true;* }* </pre>** @return The {@link ItemTouchUIUtil} instance that is used by the {@link WItemTouchHelperPlus.Callback}*/public static ItemTouchUIUtil getDefaultUIUtil() {return sUICallback;}/*** Replaces a movement direction with its relative version by taking layout direction into* account.** @param flags The flag value that include any number of movement flags.* @param layoutDirection The layout direction of the View. Can be obtained from* {@link ViewCompat#getLayoutDirection(android.view.View)}.* @return Updated flags which uses relative flags ({@link #START}, {@link #END}) instead* of {@link #LEFT}, {@link #RIGHT}.* @see #convertToAbsoluteDirection(int, int)*/public static int convertToRelativeDirection(int flags, int layoutDirection) {int masked = flags & ABS_HORIZONTAL_DIR_FLAGS;if (masked == 0) {return flags; // does not have any abs flags, good.}flags &= ~masked; //remove left / right.if (layoutDirection == ViewCompat.LAYOUT_DIRECTION_LTR) {// no change. just OR with 2 bits shifted mask and returnflags |= masked << 2; // START is 2 bits after LEFT, END is 2 bits after RIGHT.return flags;} else {// add RIGHT flag as STARTflags |= ((masked << 1) & ~ABS_HORIZONTAL_DIR_FLAGS);// first clean RIGHT bit then add LEFT flag as ENDflags |= ((masked << 1) & ABS_HORIZONTAL_DIR_FLAGS) << 2;}return flags;}/*** Convenience method to create movement flags.* <p>* For instance, if you want to let your items be drag & dropped vertically and swiped* left to be dismissed, you can call this method with:* <code>makeMovementFlags(UP | DOWN, LEFT);</code>** @param dragFlags The directions in which the item can be dragged.* @param swipeFlags The directions in which the item can be swiped.* @return Returns an integer composed of the given drag and swipe flags.*/public static int makeMovementFlags(int dragFlags, int swipeFlags) {return makeFlag(ACTION_STATE_IDLE, swipeFlags | dragFlags)| makeFlag(ACTION_STATE_SWIPE, swipeFlags)| makeFlag(ACTION_STATE_DRAG, dragFlags);}/*** Shifts the given direction flags to the offset of the given action state.** @param actionState The action state you want to get flags in. Should be one of* {@link #ACTION_STATE_IDLE}, {@link #ACTION_STATE_SWIPE} or* {@link #ACTION_STATE_DRAG}.* @param directions The direction flags. Can be composed from {@link #UP}, {@link #DOWN},* {@link #RIGHT}, {@link #LEFT} {@link #START} and {@link #END}.* @return And integer that represents the given directions in the provided actionState.*/public static int makeFlag(int actionState, int directions) {return directions << (actionState * DIRECTION_FLAG_COUNT);}abstract int getSlideViewWidth();/*** Should return a composite flag which defines the enabled move directions in each state* (idle, swiping, dragging).* <p>* Instead of composing this flag manually, you can use {@link #makeMovementFlags(int,* int)}* or {@link #makeFlag(int, int)}.* <p>* This flag is composed of 3 sets of 8 bits, where first 8 bits are for IDLE state, next* 8 bits are for SWIPE state and third 8 bits are for DRAG state.* Each 8 bit sections can be constructed by simply OR'ing direction flags defined in* {@link WItemTouchHelperPlus}.* <p>* For example, if you want it to allow swiping LEFT and RIGHT but only allow starting to* swipe by swiping RIGHT, you can return:* <pre>* makeFlag(ACTION_STATE_IDLE, RIGHT) | makeFlag(ACTION_STATE_SWIPE, LEFT | RIGHT);* </pre>* This means, allow right movement while IDLE and allow right and left movement while* swiping.** @param recyclerView The RecyclerView to which WItemTouchHelperPlus is attached.* @param viewHolder The ViewHolder for which the movement information is necessary.* @return flags specifying which movements are allowed on this ViewHolder.* @see #makeMovementFlags(int, int)* @see #makeFlag(int, int)*/public abstract int getMovementFlags(RecyclerView recyclerView,RecyclerView.ViewHolder viewHolder);public abstract String getItemSlideType();/*** Converts a given set of flags to absolution direction which means {@link #START} and* {@link #END} are replaced with {@link #LEFT} and {@link #RIGHT} depending on the layout* direction.** @param flags The flag value that include any number of movement flags.* @param layoutDirection The layout direction of the RecyclerView.* @return Updated flags which includes only absolute direction values.*/public int convertToAbsoluteDirection(int flags, int layoutDirection) {int masked = flags & RELATIVE_DIR_FLAGS;if (masked == 0) {return flags; // does not have any relative flags, good.}flags &= ~masked; //remove start / endif (layoutDirection == ViewCompat.LAYOUT_DIRECTION_LTR) {// no change. just OR with 2 bits shifted mask and returnflags |= masked >> 2; // START is 2 bits after LEFT, END is 2 bits after RIGHT.return flags;} else {// add START flag as RIGHTflags |= ((masked >> 1) & ~RELATIVE_DIR_FLAGS);// first clean start bit then add END flag as LEFTflags |= ((masked >> 1) & RELATIVE_DIR_FLAGS) >> 2;}return flags;}final int getAbsoluteMovementFlags(RecyclerView recyclerView,RecyclerView.ViewHolder viewHolder) {final int flags = getMovementFlags(recyclerView, viewHolder);return convertToAbsoluteDirection(flags, ViewCompat.getLayoutDirection(recyclerView));}boolean hasDragFlag(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {final int flags = getAbsoluteMovementFlags(recyclerView, viewHolder);return (flags & ACTION_MODE_DRAG_MASK) != 0;}boolean hasSwipeFlag(RecyclerView recyclerView,RecyclerView.ViewHolder viewHolder) {final int flags = getAbsoluteMovementFlags(recyclerView, viewHolder);return (flags & ACTION_MODE_SWIPE_MASK) != 0;}/*** Return true if the current ViewHolder can be dropped over the the target ViewHolder.* <p>* This method is used when selecting drop target for the dragged View. After Views are* eliminated either via bounds check or via this method, resulting set of views will be* passed to {@link #chooseDropTarget(RecyclerView.ViewHolder, java.util.List, int, int)}.* <p>* Default implementation returns true.** @param recyclerView The RecyclerView to which WItemTouchHelperPlus is attached to.* @param current The ViewHolder that user is dragging.* @param target The ViewHolder which is below the dragged ViewHolder.* @return True if the dragged ViewHolder can be replaced with the target ViewHolder, false* otherwise.*/public boolean canDropOver(RecyclerView recyclerView, RecyclerView.ViewHolder current,RecyclerView.ViewHolder target) {return true;}/*** Called when WItemTouchHelperPlus wants to move the dragged item from its old position to* the new position.* <p>* If this method returns true, WItemTouchHelperPlus assumes {@code viewHolder} has been moved* to the adapter position of {@code target} ViewHolder* ({@link RecyclerView.ViewHolder#getAdapterPosition()* ViewHolder#getAdapterPosition()}).* <p>* If you don't support drag & drop, this method will never be called.** @param recyclerView The RecyclerView to which WItemTouchHelperPlus is attached to.* @param viewHolder The ViewHolder which is being dragged by the user.* @param target The ViewHolder over which the currently active item is being* dragged.* @return True if the {@code viewHolder} has been moved to the adapter position of* {@code target}.* @see #onMoved(RecyclerView, RecyclerView.ViewHolder, int, RecyclerView.ViewHolder, int, int, int)*/public abstract boolean onMove(RecyclerView recyclerView,RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target);/*** Returns whether WItemTouchHelperPlus should start a drag and drop operation if an item is* long pressed.* <p>* Default value returns true but you may want to disable this if you want to start* dragging on a custom view touch using {@link #startDrag(RecyclerView.ViewHolder)}.** @return True if WItemTouchHelperPlus should start dragging an item when it is long pressed,* false otherwise. Default value is <code>true</code>.* @see #startDrag(RecyclerView.ViewHolder)*/public boolean isLongPressDragEnabled() {return true;}/*** Returns whether WItemTouchHelperPlus should start a swipe operation if a pointer is swiped* over the View.* <p>* Default value returns true but you may want to disable this if you want to start* swiping on a custom view touch using {@link #startSwipe(RecyclerView.ViewHolder)}.** @return True if WItemTouchHelperPlus should start swiping an item when user swipes a pointer* over the View, false otherwise. Default value is <code>true</code>.* @see #startSwipe(RecyclerView.ViewHolder)*/public boolean isItemViewSwipeEnabled() {return true;}/*** When finding views under a dragged view, by default, WItemTouchHelperPlus searches for views* that overlap with the dragged View. By overriding this method, you can extend or shrink* the search box.** @return The extra margin to be added to the hit box of the dragged View.*/public int getBoundingBoxMargin() {return 0;}/*** Returns the fraction that the user should move the View to be considered as swiped.* The fraction is calculated with respect to RecyclerView's bounds.* <p>* Default value is .5f, which means, to swipe a View, user must move the View at least* half of RecyclerView's width or height, depending on the swipe direction.** @param viewHolder The ViewHolder that is being dragged.* @return A float value that denotes the fraction of the View size. Default value* is .5f .*/public float getSwipeThreshold(RecyclerView.ViewHolder viewHolder) {return .5f;}/*** Returns the fraction that the user should move the View to be considered as it is* dragged. After a view is moved this amount, WItemTouchHelperPlus starts checking for Views* below it for a possible drop.** @param viewHolder The ViewHolder that is being dragged.* @return A float value that denotes the fraction of the View size. Default value is* .5f .*/public float getMoveThreshold(RecyclerView.ViewHolder viewHolder) {return .5f;}/*** Defines the minimum velocity which will be considered as a swipe action by the user.* <p>* You can increase this value to make it harder to swipe or decrease it to make it easier.* Keep in mind that WItemTouchHelperPlus also checks the perpendicular velocity and makes sure* current direction velocity is larger then the perpendicular one. Otherwise, user's* movement is ambiguous. You can change the threshold by overriding* {@link #getSwipeVelocityThreshold(float)}.* <p>* The velocity is calculated in pixels per second.* <p>* The default framework value is passed as a parameter so that you can modify it with a* multiplier.** @param defaultValue The default value (in pixels per second) used by the* WItemTouchHelperPlus.* @return The minimum swipe velocity. The default implementation returns the* <code>defaultValue</code> parameter.* @see #getSwipeVelocityThreshold(float)* @see #getSwipeThreshold(RecyclerView.ViewHolder)*/public float getSwipeEscapeVelocity(float defaultValue) {return defaultValue;}/*** Defines the maximum velocity WItemTouchHelperPlus will ever calculate for pointer movements.* <p>* To consider a movement as swipe, WItemTouchHelperPlus requires it to be larger than the* perpendicular movement. If both directions reach to the max threshold, none of them will* be considered as a swipe because it is usually an indication that user rather tried to* scroll then swipe.* <p>* The velocity is calculated in pixels per second.* <p>* You can customize this behavior by changing this method. If you increase the value, it* will be easier for the user to swipe diagonally and if you decrease the value, user will* need to make a rather straight finger movement to trigger a swipe.** @param defaultValue The default value(in pixels per second) used by the WItemTouchHelperPlus.* @return The velocity cap for pointer movements. The default implementation returns the* <code>defaultValue</code> parameter.* @see #getSwipeEscapeVelocity(float)*/public float getSwipeVelocityThreshold(float defaultValue) {return defaultValue;}/*** Called by WItemTouchHelperPlus to select a drop target from the list of ViewHolders that* are under the dragged View.* <p>* Default implementation filters the View with which dragged item have changed position* in the drag direction. For instance, if the view is dragged UP, it compares the* <code>view.getTop()</code> of the two views before and after drag started. If that value* is different, the target view passes the filter.* <p>* Among these Views which pass the test, the one closest to the dragged view is chosen.* <p>* This method is called on the main thread every time user moves the View. If you want to* override it, make sure it does not do any expensive operations.** @param selected The ViewHolder being dragged by the user.* @param dropTargets The list of ViewHolder that are under the dragged View and* candidate as a drop.* @param curX The updated left value of the dragged View after drag translations* are applied. This value does not include margins added by* {@link RecyclerView.ItemDecoration}s.* @param curY The updated top value of the dragged View after drag translations* are applied. This value does not include margins added by* {@link RecyclerView.ItemDecoration}s.* @return A ViewHolder to whose position the dragged ViewHolder should be* moved to.*/public RecyclerView.ViewHolder chooseDropTarget(RecyclerView.ViewHolder selected,List<RecyclerView.ViewHolder> dropTargets, int curX, int curY) {int right = curX + selected.itemView.getWidth();int bottom = curY + selected.itemView.getHeight();RecyclerView.ViewHolder winner = null;int winnerScore = -1;final int dx = curX - selected.itemView.getLeft();final int dy = curY - selected.itemView.getTop();final int targetsSize = dropTargets.size();for (int i = 0; i < targetsSize; i++) {final RecyclerView.ViewHolder target = dropTargets.get(i);if (dx > 0) {int diff = target.itemView.getRight() - right;if (diff < 0 && target.itemView.getRight() > selected.itemView.getRight()) {final int score = Math.abs(diff);if (score > winnerScore) {winnerScore = score;winner = target;}}}if (dx < 0) {int diff = target.itemView.getLeft() - curX;if (diff > 0 && target.itemView.getLeft() < selected.itemView.getLeft()) {final int score = Math.abs(diff);if (score > winnerScore) {winnerScore = score;winner = target;}}}if (dy < 0) {int diff = target.itemView.getTop() - curY;if (diff > 0 && target.itemView.getTop() < selected.itemView.getTop()) {final int score = Math.abs(diff);if (score > winnerScore) {winnerScore = score;winner = target;}}}if (dy > 0) {int diff = target.itemView.getBottom() - bottom;if (diff < 0 && target.itemView.getBottom() > selected.itemView.getBottom()) {final int score = Math.abs(diff);if (score > winnerScore) {winnerScore = score;winner = target;}}}}return winner;}/*** Called when a ViewHolder is swiped by the user.* <p>* If you are returning relative directions ({@link #START} , {@link #END}) from the* {@link #getMovementFlags(RecyclerView, RecyclerView.ViewHolder)} method, this method* will also use relative directions. Otherwise, it will use absolute directions.* <p>* If you don't support swiping, this method will never be called.* <p>* WItemTouchHelperPlus will keep a reference to the View until it is detached from* RecyclerView.* As soon as it is detached, WItemTouchHelperPlus will call* {@link #clearView(RecyclerView, RecyclerView.ViewHolder)}.** @param viewHolder The ViewHolder which has been swiped by the user.* @param direction The direction to which the ViewHolder is swiped. It is one of* {@link #UP}, {@link #DOWN},* {@link #LEFT} or {@link #RIGHT}. If your* {@link #getMovementFlags(RecyclerView, RecyclerView.ViewHolder)}* method* returned relative flags instead of {@link #LEFT} / {@link #RIGHT};* `direction` will be relative as well. ({@link #START} or {@link* #END}).*/public abstract void onSwiped(RecyclerView.ViewHolder viewHolder, int direction);/*** Called when the ViewHolder swiped or dragged by the WItemTouchHelperPlus is changed.* <p/>* If you override this method, you should call super.** @param viewHolder The new ViewHolder that is being swiped or dragged. Might be null if* it is cleared.* @param actionState One of {@link WItemTouchHelperPlus#ACTION_STATE_IDLE},* {@link WItemTouchHelperPlus#ACTION_STATE_SWIPE} or* {@link WItemTouchHelperPlus#ACTION_STATE_DRAG}.* @see #clearView(RecyclerView, RecyclerView.ViewHolder)*/public void onSelectedChanged(RecyclerView.ViewHolder viewHolder, int actionState) {if (viewHolder != null) {sUICallback.onSelected(viewHolder.itemView);}}private int getMaxDragScroll(RecyclerView recyclerView) {if (mCachedMaxScrollSpeed == -1) {mCachedMaxScrollSpeed = recyclerView.getResources().getDimensionPixelSize(android.support.v7.recyclerview.R.dimen.item_touch_helper_max_drag_scroll_per_frame);}return mCachedMaxScrollSpeed;}/*** Called when {@link #onMove(RecyclerView, RecyclerView.ViewHolder, RecyclerView.ViewHolder)} returns true.* <p>* WItemTouchHelperPlus does not create an extra Bitmap or View while dragging, instead, it* modifies the existing View. Because of this reason, it is important that the View is* still part of the layout after it is moved. This may not work as intended when swapped* Views are close to RecyclerView bounds or there are gaps between them (e.g. other Views* which were not eligible for dropping over).* <p>* This method is responsible to give necessary hint to the LayoutManager so that it will* keep the View in visible area. For example, for LinearLayoutManager, this is as simple* as calling {@link LinearLayoutManager#scrollToPositionWithOffset(int, int)}.* <p>* Default implementation calls {@link RecyclerView#scrollToPosition(int)} if the View's* new position is likely to be out of bounds.* <p>* It is important to ensure the ViewHolder will stay visible as otherwise, it might be* removed by the LayoutManager if the move causes the View to go out of bounds. In that* case, drag will end prematurely.** @param recyclerView The RecyclerView controlled by the WItemTouchHelperPlus.* @param viewHolder The ViewHolder under user's control.* @param fromPos The previous adapter position of the dragged item (before it was* moved).* @param target The ViewHolder on which the currently active item has been dropped.* @param toPos The new adapter position of the dragged item.* @param x The updated left value of the dragged View after drag translations* are applied. This value does not include margins added by* {@link RecyclerView.ItemDecoration}s.* @param y The updated top value of the dragged View after drag translations* are applied. This value does not include margins added by* {@link RecyclerView.ItemDecoration}s.*/public void onMoved(final RecyclerView recyclerView,final RecyclerView.ViewHolder viewHolder, int fromPos, final RecyclerView.ViewHolder target, int toPos, int x,int y) {final RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();if (layoutManager instanceof WItemTouchHelperPlus.ViewDropHandler) {((WItemTouchHelperPlus.ViewDropHandler) layoutManager).prepareForDrop(viewHolder.itemView,target.itemView, x, y);return;}// if layout manager cannot handle it, do some guessworkif (layoutManager.canScrollHorizontally()) {final int minLeft = layoutManager.getDecoratedLeft(target.itemView);if (minLeft <= recyclerView.getPaddingLeft()) {recyclerView.scrollToPosition(toPos);}final int maxRight = layoutManager.getDecoratedRight(target.itemView);if (maxRight >= recyclerView.getWidth() - recyclerView.getPaddingRight()) {recyclerView.scrollToPosition(toPos);}}if (layoutManager.canScrollVertically()) {final int minTop = layoutManager.getDecoratedTop(target.itemView);if (minTop <= recyclerView.getPaddingTop()) {recyclerView.scrollToPosition(toPos);}final int maxBottom = layoutManager.getDecoratedBottom(target.itemView);if (maxBottom >= recyclerView.getHeight() - recyclerView.getPaddingBottom()) {recyclerView.scrollToPosition(toPos);}}}void onDraw(Canvas c, RecyclerView parent, RecyclerView.ViewHolder selected,List<WItemTouchHelperPlus.RecoverAnimation> recoverAnimationList,int actionState, float dX, float dY) {final int recoverAnimSize = recoverAnimationList.size();for (int i = 0; i < recoverAnimSize; i++) {final WItemTouchHelperPlus.RecoverAnimation anim = recoverAnimationList.get(i);anim.update();final int count = c.save();onChildDraw(c, parent, anim.mViewHolder, anim.mX, anim.mY, anim.mActionState,false);c.restoreToCount(count);}if (selected != null) {final int count = c.save();onChildDraw(c, parent, selected, dX, dY, actionState, true);c.restoreToCount(count);}}void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.ViewHolder selected,List<WItemTouchHelperPlus.RecoverAnimation> recoverAnimationList,int actionState, float dX, float dY) {final int recoverAnimSize = recoverAnimationList.size();for (int i = 0; i < recoverAnimSize; i++) {final WItemTouchHelperPlus.RecoverAnimation anim = recoverAnimationList.get(i);final int count = c.save();onChildDrawOver(c, parent, anim.mViewHolder, anim.mX, anim.mY, anim.mActionState,false);c.restoreToCount(count);}if (selected != null) {final int count = c.save();onChildDrawOver(c, parent, selected, dX, dY, actionState, true);c.restoreToCount(count);}boolean hasRunningAnimation = false;for (int i = recoverAnimSize - 1; i >= 0; i--) {final WItemTouchHelperPlus.RecoverAnimation anim = recoverAnimationList.get(i);if (anim.mEnded && !anim.mIsPendingCleanup) {recoverAnimationList.remove(i);} else if (!anim.mEnded) {hasRunningAnimation = true;}}if (hasRunningAnimation) {parent.invalidate();}}/*** Called by the WItemTouchHelperPlus when the user interaction with an element is over and it* also completed its animation.* <p>* This is a good place to clear all changes on the View that was done in* {@link #onSelectedChanged(RecyclerView.ViewHolder, int)},* {@link #onChildDraw(Canvas, RecyclerView, RecyclerView.ViewHolder, float, float, int,* boolean)} or* {@link #onChildDrawOver(Canvas, RecyclerView, RecyclerView.ViewHolder, float, float, int, boolean)}.** @param recyclerView The RecyclerView which is controlled by the WItemTouchHelperPlus.* @param viewHolder The View that was interacted by the user.*/public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {sUICallback.clearView(viewHolder.itemView);}/*** Called by WItemTouchHelperPlus on RecyclerView's onDraw callback.* <p>* If you would like to customize how your View's respond to user interactions, this is* a good place to override.* <p>* Default implementation translates the child by the given <code>dX</code>,* <code>dY</code>.* WItemTouchHelperPlus also takes care of drawing the child after other children if it is being* dragged. This is done using child re-ordering mechanism. On platforms prior to L, this* is* achieved via {@link android.view.ViewGroup#getChildDrawingOrder(int, int)} and on L* and after, it changes View's elevation value to be greater than all other children.)** @param c The canvas which RecyclerView is drawing its children* @param recyclerView The RecyclerView to which WItemTouchHelperPlus is attached to* @param viewHolder The ViewHolder which is being interacted by the User or it was* interacted and simply animating to its original position* @param dX The amount of horizontal displacement caused by user's action* @param dY The amount of vertical displacement caused by user's action* @param actionState The type of interaction on the View. Is either {@link* #ACTION_STATE_DRAG} or {@link #ACTION_STATE_SWIPE}.* @param isCurrentlyActive True if this view is currently being controlled by the user or* false it is simply animating back to its original state.* @see #onChildDrawOver(Canvas, RecyclerView, RecyclerView.ViewHolder, float, float, int,* boolean)*/public void onChildDraw(Canvas c, RecyclerView recyclerView,RecyclerView.ViewHolder viewHolder,float dX, float dY, int actionState, boolean isCurrentlyActive) {sUICallback.onDraw(c, recyclerView, viewHolder.itemView, dX, dY, actionState,isCurrentlyActive);}/*** Called by WItemTouchHelperPlus on RecyclerView's onDraw callback.* <p>* If you would like to customize how your View's respond to user interactions, this is* a good place to override.* <p>* Default implementation translates the child by the given <code>dX</code>,* <code>dY</code>.* WItemTouchHelperPlus also takes care of drawing the child after other children if it is being* dragged. This is done using child re-ordering mechanism. On platforms prior to L, this* is* achieved via {@link android.view.ViewGroup#getChildDrawingOrder(int, int)} and on L* and after, it changes View's elevation value to be greater than all other children.)** @param c The canvas which RecyclerView is drawing its children* @param recyclerView The RecyclerView to which WItemTouchHelperPlus is attached to* @param viewHolder The ViewHolder which is being interacted by the User or it was* interacted and simply animating to its original position* @param dX The amount of horizontal displacement caused by user's action* @param dY The amount of vertical displacement caused by user's action* @param actionState The type of interaction on the View. Is either {@link* #ACTION_STATE_DRAG} or {@link #ACTION_STATE_SWIPE}.* @param isCurrentlyActive True if this view is currently being controlled by the user or* false it is simply animating back to its original state.* @see #onChildDrawOver(Canvas, RecyclerView, RecyclerView.ViewHolder, float, float, int,* boolean)*/public void onChildDrawOver(Canvas c, RecyclerView recyclerView,RecyclerView.ViewHolder viewHolder,float dX, float dY, int actionState, boolean isCurrentlyActive) {sUICallback.onDrawOver(c, recyclerView, viewHolder.itemView, dX, dY, actionState,isCurrentlyActive);}/*** Called by the WItemTouchHelperPlus when user action finished on a ViewHolder and now the View* will be animated to its final position.* <p>* Default implementation uses ItemAnimator's duration values. If* <code>animationType</code> is {@link #ANIMATION_TYPE_DRAG}, it returns* {@link RecyclerView.ItemAnimator#getMoveDuration()}, otherwise, it returns* {@link RecyclerView.ItemAnimator#getRemoveDuration()}. If RecyclerView does not have* any {@link RecyclerView.ItemAnimator} attached, this method returns* {@code DEFAULT_DRAG_ANIMATION_DURATION} or {@code DEFAULT_SWIPE_ANIMATION_DURATION}* depending on the animation type.** @param recyclerView The RecyclerView to which the WItemTouchHelperPlus is attached to.* @param animationType The type of animation. Is one of {@link #ANIMATION_TYPE_DRAG},* {@link #ANIMATION_TYPE_SWIPE_CANCEL} or* {@link #ANIMATION_TYPE_SWIPE_SUCCESS}.* @param animateDx The horizontal distance that the animation will offset* @param animateDy The vertical distance that the animation will offset* @return The duration for the animation*/public long getAnimationDuration(RecyclerView recyclerView, int animationType,float animateDx, float animateDy) {final RecyclerView.ItemAnimator itemAnimator = recyclerView.getItemAnimator();if (itemAnimator == null) {return animationType == ANIMATION_TYPE_DRAG ? DEFAULT_DRAG_ANIMATION_DURATION: DEFAULT_SWIPE_ANIMATION_DURATION;} else {return animationType == ANIMATION_TYPE_DRAG ? itemAnimator.getMoveDuration(): itemAnimator.getRemoveDuration();}}/*** Called by the WItemTouchHelperPlus when user is dragging a view out of bounds.* <p>* You can override this method to decide how much RecyclerView should scroll in response* to this action. Default implementation calculates a value based on the amount of View* out of bounds and the time it spent there. The longer user keeps the View out of bounds,* the faster the list will scroll. Similarly, the larger portion of the View is out of* bounds, the faster the RecyclerView will scroll.** @param recyclerView The RecyclerView instance to which WItemTouchHelperPlus is* attached to.* @param viewSize The total size of the View in scroll direction, excluding* item decorations.* @param viewSizeOutOfBounds The total size of the View that is out of bounds. This value* is negative if the View is dragged towards left or top edge.* @param totalSize The total size of RecyclerView in the scroll direction.* @param msSinceStartScroll The time passed since View is kept out of bounds.* @return The amount that RecyclerView should scroll. Keep in mind that this value will* be passed to {@link RecyclerView#scrollBy(int, int)} method.*/public int interpolateOutOfBoundsScroll(RecyclerView recyclerView,int viewSize, int viewSizeOutOfBounds,int totalSize, long msSinceStartScroll) {final int maxScroll = getMaxDragScroll(recyclerView);final int absOutOfBounds = Math.abs(viewSizeOutOfBounds);final int direction = (int) Math.signum(viewSizeOutOfBounds);// might be negative if other directionfloat outOfBoundsRatio = Math.min(1f, 1f * absOutOfBounds / viewSize);final int cappedScroll = (int) (direction * maxScroll* sDragViewScrollCapInterpolator.getInterpolation(outOfBoundsRatio));final float timeRatio;if (msSinceStartScroll > DRAG_SCROLL_ACCELERATION_LIMIT_TIME_MS) {timeRatio = 1f;} else {timeRatio = (float) msSinceStartScroll / DRAG_SCROLL_ACCELERATION_LIMIT_TIME_MS;}final int value = (int) (cappedScroll * sDragScrollInterpolator.getInterpolation(timeRatio));if (value == 0) {return viewSizeOutOfBounds > 0 ? 1 : -1;}return value;}}/*** A simple wrapper to the default Callback which you can construct with drag and swipe* directions and this class will handle the flag callbacks. You should still override onMove* or* onSwiped depending on your use case.* <p>* <pre>* WItemTouchHelperPlus mIth = new WItemTouchHelperPlus(* new WItemTouchHelperPlus.SimpleCallback(WItemTouchHelperPlus.UP | WItemTouchHelperPlus.DOWN,* WItemTouchHelperPlus.LEFT) {* public abstract boolean onMove(RecyclerView recyclerView,* ViewHolder viewHolder, ViewHolder target) {* final int fromPos = viewHolder.getAdapterPosition();* final int toPos = target.getAdapterPosition();* // move item in `fromPos` to `toPos` in adapter.* return true;// true if moved, false otherwise* }* public void onSwiped(ViewHolder viewHolder, int direction) {* // remove from adapter* }* });* </pre>*/public abstract static class SimpleCallback extends WItemTouchHelperPlus.Callback {private int mDefaultSwipeDirs;private int mDefaultDragDirs;/*** Creates a Callback for the given drag and swipe allowance. These values serve as* defaults* and if you want to customize behavior per ViewHolder, you can override* {@link #getSwipeDirs(RecyclerView, RecyclerView.ViewHolder)}* and / or {@link #getDragDirs(RecyclerView, RecyclerView.ViewHolder)}.** @param dragDirs Binary OR of direction flags in which the Views can be dragged. Must be* composed of {@link #LEFT}, {@link #RIGHT}, {@link #START}, {@link* #END},* {@link #UP} and {@link #DOWN}.* @param swipeDirs Binary OR of direction flags in which the Views can be swiped. Must be* composed of {@link #LEFT}, {@link #RIGHT}, {@link #START}, {@link* #END},* {@link #UP} and {@link #DOWN}.*/public SimpleCallback(int dragDirs, int swipeDirs) {mDefaultSwipeDirs = swipeDirs;mDefaultDragDirs = dragDirs;}/*** Updates the default swipe directions. For example, you can use this method to toggle* certain directions depending on your use case.** @param defaultSwipeDirs Binary OR of directions in which the ViewHolders can be swiped.*/public void setDefaultSwipeDirs(int defaultSwipeDirs) {mDefaultSwipeDirs = defaultSwipeDirs;}/*** Updates the default drag directions. For example, you can use this method to toggle* certain directions depending on your use case.** @param defaultDragDirs Binary OR of directions in which the ViewHolders can be dragged.*/public void setDefaultDragDirs(int defaultDragDirs) {mDefaultDragDirs = defaultDragDirs;}/*** Returns the swipe directions for the provided ViewHolder.* Default implementation returns the swipe directions that was set via constructor or* {@link #setDefaultSwipeDirs(int)}.** @param recyclerView The RecyclerView to which the WItemTouchHelperPlus is attached to.* @param viewHolder The RecyclerView for which the swipe direction is queried.* @return A binary OR of direction flags.*/public int getSwipeDirs(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {return mDefaultSwipeDirs;}/*** Returns the drag directions for the provided ViewHolder.* Default implementation returns the drag directions that was set via constructor or* {@link #setDefaultDragDirs(int)}.** @param recyclerView The RecyclerView to which the WItemTouchHelperPlus is attached to.* @param viewHolder The RecyclerView for which the swipe direction is queried.* @return A binary OR of direction flags.*/public int getDragDirs(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {return mDefaultDragDirs;}@Overridepublic int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {return makeMovementFlags(getDragDirs(recyclerView, viewHolder),getSwipeDirs(recyclerView, viewHolder));}}private class WItemTouchHelperPlusGestureListener extends GestureDetector.SimpleOnGestureListener {WItemTouchHelperPlusGestureListener() {}@Overridepublic boolean onDown(MotionEvent e) {return true;}@Overridepublic void onLongPress(MotionEvent e) {View child = findChildView(e);if (child != null) {RecyclerView.ViewHolder vh = mRecyclerView.getChildViewHolder(child);if (vh != null) {if (!mCallback.hasDragFlag(mRecyclerView, vh)) {return;}int pointerId = e.getPointerId(0);// Long press is deferred.// Check w/ active pointer id to avoid selecting after motion// event is canceled.if (pointerId == mActivePointerId) {final int index = e.findPointerIndex(mActivePointerId);final float x = e.getX(index);final float y = e.getY(index);mInitialTouchX = x;mInitialTouchY = y;mDx = mDy = 0f;if (DEBUG) {Log.d(TAG,"onlong press: x:" + mInitialTouchX + ",y:" + mInitialTouchY);}if (mCallback.isLongPressDragEnabled()) {select(vh, ACTION_STATE_DRAG);}}}}}}private static class RecoverAnimation implements Animator.AnimatorListener {final float mStartDx;final float mStartDy;final float mTargetX;final float mTargetY;final RecyclerView.ViewHolder mViewHolder;final int mActionState;private final ValueAnimator mValueAnimator;final int mAnimationType;public boolean mIsPendingCleanup;float mX;float mY;// if user starts touching a recovering view, we put it into interaction mode again,// instantly.boolean mOverridden = false;boolean mEnded = false;private float mFraction;RecoverAnimation(RecyclerView.ViewHolder viewHolder, int animationType,int actionState, float startDx, float startDy, float targetX, float targetY) {mActionState = actionState;mAnimationType = animationType;mViewHolder = viewHolder;mStartDx = startDx;mStartDy = startDy;mTargetX = targetX;mTargetY = targetY;mValueAnimator = ValueAnimator.ofFloat(0f, 1f);mValueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {@Overridepublic void onAnimationUpdate(ValueAnimator animation) {setFraction(animation.getAnimatedFraction());}});mValueAnimator.setTarget(viewHolder.itemView);mValueAnimator.addListener(this);setFraction(0f);}public void setDuration(long duration) {mValueAnimator.setDuration(duration);}public void start() {mViewHolder.setIsRecyclable(false);mValueAnimator.start();}public void cancel() {mValueAnimator.cancel();}public void setFraction(float fraction) {mFraction = fraction;}/*** We run updates on onDraw method but use the fraction from animator callback.* This way, we can sync translate x/y values w/ the animators to avoid one-off frames.*/public void update() {if (mStartDx == mTargetX) {mX = mViewHolder.itemView.getTranslationX();} else {mX = mStartDx + mFraction * (mTargetX - mStartDx);}if (mStartDy == mTargetY) {mY = mViewHolder.itemView.getTranslationY();} else {mY = mStartDy + mFraction * (mTargetY - mStartDy);}}@Overridepublic void onAnimationStart(Animator animation) {}@Overridepublic void onAnimationEnd(Animator animation) {if (!mEnded) {mViewHolder.setIsRecyclable(true);}mEnded = true;}@Overridepublic void onAnimationCancel(Animator animation) {setFraction(1f); //make sure we recover the view's state.}@Overridepublic void onAnimationRepeat(Animator animation) {}} }

改進版:https://blog.csdn.net/meixi_android/article/details/84939963

總結

以上是生活随笔為你收集整理的Android侧滑删除-RecyclerView轻松实现高效的侧滑菜单的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

精品理论片 | 久久久天堂 | 天天综合网 天天 | 中文字幕 国产视频 | 国产精品第二十页 | 国产精品第三页 | 91精彩视频在线观看 | 久草在线最新免费 | 一 级 黄 色 片免费看的 | 久久综合中文字幕 | 中文在线天堂资源 | 毛片黄色一级 | 欧美一级性生活片 | 手机av网站| 欧美一级性生活片 | 99爱精品在线 | 欧美日本三级 | 亚洲综合国产精品 | 在线v| 久久久久免费精品国产小说色大师 | 精品一区二区免费在线观看 | 毛片网在线 | 国产精品 欧美 日韩 | 99国产一区 | 91麻豆传媒| 九九热在线观看视频 | 人人草在线视频 | 久久99精品久久久久婷婷 | 亚洲综合欧美精品电影 | 黄色aaa级片| 成年人在线观看视频免费 | 久久视频在线免费观看 | 91色综合 | 久亚洲 | 韩国一区二区三区在线观看 | 激情婷婷 | 亚洲最新av网站 | 国产精品18久久久久久vr | 人人澡人| 在线国产视频 | 黄色www免费| 成人中文字幕+乱码+中文字幕 | 麻豆免费观看视频 | 亚洲天天综合 | 亚洲免费精品视频 | 亚洲国产日韩av | 免费亚洲成人 | 999久久a精品合区久久久 | 久草在线资源免费 | 国产精品永久免费 | 精品免费视频123区 午夜久久成人 | 天天干天天射天天爽 | 欧美91片 | 国产在线一区观看 | 美女免费黄网站 | 亚洲成av人影院 | 亚洲v精品 | 九九热免费视频在线观看 | av在线亚洲天堂 | 欧美激情操 | 亚洲精品456在线播放第一页 | 在线成人免费av | 久久成人免费电影 | 日本黄色大片免费 | 狠狠色伊人亚洲综合网站色 | 精品国产黄色片 | av在线永久免费观看 | 亚洲欧美激情精品一区二区 | 日韩电影在线观看一区 | 久久国产精品视频 | 欧美一区二视频在线免费观看 | 欧美一级小视频 | 国产精品18久久久 | 色成人亚洲 | 成人手机在线视频 | 久久九精品 | 日韩免费一区二区在线观看 | 麻豆精品视频在线观看免费 | 日韩影视精品 | av免费在线免费观看 | 中文字幕高清免费日韩视频在线 | 国产黄av| 怡春院av | 九九精品视频在线 | 久久久污| 美女亚洲精品 | 啪啪资源 | 国产精品自产拍在线观看桃花 | 国产成人久久久久 | 婷婷伊人五月 | 免费福利片 | 成人h电影在线观看 | 日本大片免费观看在线 | 91夫妻自拍 | 久久影视中文字幕 | 久久久久久久99精品免费观看 | 国产精品不卡在线观看 | 黄色小说在线观看视频 | 五月婷婷黄色 | 中中文字幕av在线 | 免费视频 你懂的 | 久艹视频在线免费观看 | 成年人黄色大片在线 | 男女精品久久 | 亚洲精品婷婷 | 亚洲在线资源 | 国内精品久久久久久久久 | 精品国产成人在线影院 | 久久伊人热 | 成人精品福利 | 成人性生交大片免费看中文网站 | 字幕网资源站中文字幕 | 日韩天天综合 | 精油按摩av | 成人午夜性影院 | 91福利视频网站 | 91在线观看视频网站 | 国产手机视频在线观看 | 亚洲精品久久久蜜臀下载官网 | 精品国产免费一区二区三区五区 | 亚洲天堂免费视频 | 国产精品99久久久久久小说 | 亚洲污视频| 久久久精品99| 亚洲精品乱码久久久久久蜜桃91 | 国产又粗又猛又色 | 亚洲欧美日本A∨在线观看 青青河边草观看完整版高清 | 国产精品一级在线 | 少妇视频一区 | 69久久夜色精品国产69 | 337p日本大胆噜噜噜噜 | 久久艹艹 | 日韩av在线网站 | 国产韩国日本高清视频 | 国产一级做a爱片久久毛片a | 精品日韩在线一区 | 色多多在线观看 | 探花视频免费观看高清视频 | 国产91成人在在线播放 | 婷婷福利影院 | 欧美成人91 | 亚洲一区精品人人爽人人躁 | 国产精品欧美久久久久无广告 | 久久99国产精品二区护士 | 国产资源免费在线观看 | 99这里只有| 日韩va亚洲va欧美va久久 | 丰满少妇对白在线偷拍 | 国内精品亚洲 | 日本在线观看一区二区三区 | 国产婷婷久久 | 中文字幕在线观看第二页 | 国色天香在线 | 国产群p视频 | 五月婷婷在线视频观看 | 青春草免费视频 | 91精品国产乱码久久桃 | 日本中文字幕视频 | a色视频| 涩涩在线 | 国产精品久久久视频 | 一区三区在线欧 | 午夜精品一二区 | 午夜视频一区二区 | 成人av电影免费在线观看 | 国产人成在线视频 | av成人资源 | 久久天天躁狠狠躁夜夜不卡公司 | 国产91在 | 高清视频一区 | 91视频电影 | 91精品免费 | 亚洲最快最全在线视频 | 中文字幕激情 | 黄色com | 久久久麻豆精品一区二区 | 高清视频一区二区三区 | 日韩动态视频 | 国产又粗又猛又黄又爽的视频 | av在线免费播放 | av在线播放快速免费阴 | 日韩欧美精品在线视频 | 正在播放国产91 | 麻豆视频国产 | 在线天堂中文在线资源网 | 在线播放 日韩专区 | 婷婷 综合 色 | 五月花婷婷 | 亚洲无吗视频在线 | 国产精品久久久久久久久久久久久 | 亚洲国产美女精品久久久久∴ | 能在线观看的日韩av | 欧美aⅴ在线观看 | 成人免费视频网站 | 在线看成人 | av电影中文字幕在线观看 | 97国产小视频 | 色网站免费在线看 | 久久久免费国产 | 五月综合激情 | 日韩在观看线 | 国产精品欧美久久久久三级 | 久久国产精品免费一区 | 三级黄在线 | 婷婷色网址 | 国产探花在线看 | 成人免费共享视频 | 亚洲欧美精品一区 | 粉嫩av一区二区三区四区在线观看 | 国产99久久精品一区二区永久免费 | 免费三级a | 国产美腿白丝袜足在线av | 亚洲乱亚洲乱妇 | 色天天综合久久久久综合片 | 欧美一级黄色网 | 奇米导航 | av片一区二区 | 精品99久久久久久 | 夜夜躁狠狠躁日日躁视频黑人 | 成人av在线直播 | 欧美极品少妇xxxxⅹ欧美极品少妇xxxx亚洲精品 | 在线高清| 综合视频在线 | 久久久久久久久久久久影院 | 亚洲精品久久久久久久蜜桃 | 在线一区电影 | 亚洲激情在线观看 | 日本不卡123 | 国产日韩精品视频 | 欧美日韩国产高清视频 | 亚洲视频每日更新 | 精品亚洲视频在线观看 | 久久超碰97| 九九久久在线看 | 91精品办公室少妇高潮对白 | 久久艹中文字幕 | 欧洲一区精品 | 亚洲 中文字幕av | 狠狠色丁香婷婷综合久久片 | 五月激情站 | 欧美日韩国产mv | 97成人在线免费视频 | 国产亚洲人| 国产一区二区三区高清播放 | 国产精品va在线观看入 | 日本h视频在线观看 | 日韩av综合网站 | 亚洲国产免费网站 | 中文字幕日韩免费视频 | 欧美日韩不卡在线视频 | 亚洲精品成人 | 欧美日韩国产在线观看 | 99视频精品| 亚洲激情综合 | 黄色在线视频网址 | 免费在线观看污 | 日本少妇高清做爰视频 | 91看片在线免费观看 | 国产小视频你懂的 | 国际精品网 | 国产精品99在线播放 | 国产精品久久久久久久久婷婷 | 久久久www成人免费精品张筱雨 | 国产又黄又爽又猛视频日本 | 天天五月天色 | 成人av资源网站 | www五月天| 欧美日在线观看 | 国产精品久久久久久久久岛 | 国产成人精品一区二区三区福利 | 在线欧美小视频 | 男女激情网址 | 九九九九热精品免费视频点播观看 | 亚洲精品短视频 | 91在线区| 久久精品99 | 亚洲va韩国va欧美va精四季 | 日韩中文字幕在线不卡 | 精品1区二区 | 欧美成人aa | 五月天天天操 | 国产精品 日韩精品 | 青青草在久久免费久久免费 | 国产精品18久久久久久不卡孕妇 | 色婷婷天天干 | 在线观看国产区 | 成年人黄色大全 | 99久久精品免费看国产麻豆 | 黄网站a| 国产99久久九九精品免费 | 91激情视频在线播放 | 天天色天天草天天射 | 久久免费福利 | 中文字幕在线观看2018 | 免费91麻豆精品国产自产在线观看 | 粉嫩av一区二区三区四区在线观看 | 亚洲妇女av | 久久久久久影视 | 99免费精品视频 | 综合久久网站 | 婷婷伊人综合 | 久久久久久久久久久成人 | 丁香花中文字幕 | 美女国产免费 | 综合网中文字幕 | 日韩av有码在线 | 久久久精选 | 在线观看91av | 亚洲精品午夜国产va久久成人 | 狠狠色丁香九九婷婷综合五月 | 人人艹人人 | 日韩电影一区二区三区在线观看 | 久久深夜福利免费观看 | 黄色视屏av | 狠狠做六月爱婷婷综合aⅴ 日本高清免费中文字幕 | 91av中文| 欧美日韩伦理一区 | 人人干天天干 | www.色综合.com | 免费看国产一级片 | 国产一级电影在线 | 免费成人黄色 | 麻豆果冻剧传媒在线播放 | 国产伦理一区二区 | 超碰在线1 | 久久久国产精品一区二区三区 | 黄色毛片在线观看 | 免费日韩一区二区三区 | 在线超碰av | 亚洲激情在线 | av在线免费不卡 | 人人插超碰 | 国产五月婷婷 | 500部大龄熟乱视频 欧美日本三级 | 美女视频黄免费 | 国产成人精品亚洲精品 | 视频在线观看入口黄最新永久免费国产 | 男女免费av | 久久久国产毛片 | av在线成人 | 91亚洲精品久久久久图片蜜桃 | 国产精品午夜在线 | 天天干天天拍天天操天天拍 | 国产精品theporn | 91精品久久久久久久久久入口 | 91黄色影视 | 五月天激情开心 | 91av免费在线观看 | 午夜91在线 | 天天做日日爱夜夜爽 | 成年人视频在线观看免费 | av女优中文字幕在线观看 | 婷婷色综合网 | 国产精品第一视频 | 日韩欧美xxx | 丁香婷婷社区 | 国产91精品在线播放 | 在线观看av不卡 | 在线成人av| 久久精品国产99 | 国产精品乱码久久久久久1区2区 | 日韩欧美精品一区二区三区经典 | 亚洲aⅴ一区二区三区 | 五月婷婷丁香六月 | 激情综合五月天 | 久久黄色免费视频 | 国产在线精品国自产拍影院 | 91九色丨porny丨丰满6 | 一本色道久久精品 | 免费黄色激情视频 | 国产精品淫 | 亚洲精品视频免费在线 | 99re视频在线观看 | 国内精品久久久久国产 | 美女视频黄频大全免费 | 少妇按摩av | 欧美一区二区三区在线看 | 中文字幕在线免费 | 热99在线视频 | 爱干视频 | 精品久久久国产 | 超碰在线天天 | 免费黄色特级片 | 黄色视屏免费在线观看 | 色视频在线免费观看 | 四川妇女搡bbbb搡bbbb搡 | a电影在线观看 | 99九九热只有国产精品 | 最新动作电影 | 玖玖综合网| 久久你懂得 | 久久国产免 | 人人狠狠综合久久亚洲婷 | 最新黄色av网址 | 96精品高清视频在线观看软件特色 | 色黄久久久久久 | 久久久久久久久久网站 | 最近中文字幕免费 | 成年人黄色大全 | 国内精品99| 不卡视频一区二区三区 | 久久这里只有精品23 | 天天做天天射 | 精精国产xxxx视频在线播放 | 天天艹天天爽 | 欧美日本日韩aⅴ在线视频 插插插色综合 | 久久国产剧场电影 | 国产高清视频在线播放 | 日韩精品在线一区 | 不卡电影一区二区三区 | 91精品久久久久久久91蜜桃 | 日韩在线不卡视频 | 在线观看国产日韩 | 国产精品网在线观看 | 精品国产综合区久久久久久 | 日韩av免费一区二区 | www.久草.com| 美女免费网视频 | 九九久久免费视频 | 伊人春色电影网 | 色婷婷一区 | 色综合色综合久久综合频道88 | 91社区国产高清 | 视频在线观看入口黄最新永久免费国产 | 最近2019好看的中文字幕免费 | 欧美精选一区二区三区 | 青草视频网 | 亚洲做受高潮欧美裸体 | 国产精品久久久区三区天天噜 | 日韩在线中文字幕视频 | www.com在线观看 | 国产视频二区三区 | 久久图| 欧美网站黄色 | 91福利在线观看 | 国产亚洲精品久久久久久无几年桃 | 日韩免费网址 | 青青草在久久免费久久免费 | 久久99精品一区二区三区三区 | 精品一区二区免费视频 | 国产五月色婷婷六月丁香视频 | 亚洲片在线 | 久久视频免费观看 | 91网在线看| 久久久精品久久日韩一区综合 | 亚洲精品美女久久久 | 色综合婷婷久久 | 黄色av一区二区三区 | 久久久久 免费视频 | 91在线视频导航 | av福利网址导航 | 国产精品久久久网站 | 热re99久久精品国产99热 | 国产黄色片久久 | 精品国产一区二区三区久久久久久 | 亚洲精品国偷自产在线99热 | 亚洲一级电影在线观看 | 日韩精品不卡在线观看 | 99热精品国产一区二区在线观看 | 欧美日韩国产一区二区在线观看 | 国产精品一区在线播放 | av在线小说 | 天天综合在线观看 | 国产成a人亚洲精v品在线观看 | av在线永久免费观看 | 天天射天天干天天爽 | 欧美一区二区三区在线 | 国际精品久久 | 天天看天天干天天操 | 97视频在线免费观看 | 国产成人性色生活片 | 在线看片日韩 | 国产黄色网 | 天天操天天艹 | 日韩毛片在线免费观看 | 91久久人澡人人添人人爽欧美 | 中文成人字幕 | 亚洲国内精品在线 | 五月婷婷视频 | 毛片网站免费 | 国产亚洲精品久 | 懂色av一区二区三区蜜臀 | 国产码电影 | 欧美与欧洲交xxxx免费观看 | 色婷婷狠狠五月综合天色拍 | 激情影音 | 国产免费视频在线 | 在线视频一区观看 | 综合网色 | 久久综合九色综合网站 | 在线观看日本韩国电影 | 久草观看视频 | 久久怡红院 | 免费观看性生交大片3 | 91网址在线 | 91香蕉国产在线观看软件 | 成年美女黄网站色大片免费看 | 在线视频91 | 黄色软件网站在线观看 | 久久成人免费视频 | 欧美永久视频 | 在线 精品 国产 | 亚洲激情六月 | 久久综合五月婷婷 | 欧美日韩亚洲在线观看 | 99久久婷婷国产精品综合 | 91中文字幕永久在线 | 91成熟丰满女人少妇 | 免费看成人av | 免费在线中文字幕 | 国产美女网 | 国产精品不卡一区 | 夜夜夜夜操 | 亚洲区二区 | 99在线高清视频在线播放 | 东方av免费在线观看 | 国产永久免费 | 久久国产精品久久w女人spa | 成人一级电影在线观看 | 成人动态视频 | 中文字幕一二三区 | 亚洲婷婷综合色高清在线 | 免费大片黄在线 | 国产精品午夜在线观看 | 91香蕉视频好色先生 | 亚洲高清视频一区二区三区 | 日韩欧美视频一区二区三区 | 97超碰免费在线观看 | 91在线日韩 | 午夜精品久久久久久 | 97超碰在线免费 | 国产精品v欧美精品 | av片一区 | 又黄又爽的视频在线观看网站 | 天天摸夜夜添 | 91av影视 | 国产美女在线免费观看 | 精品一区二区免费在线观看 | 亚洲高清在线 | 99久久久成人国产精品 | 狠狠伊人 | 色婷婷免费视频 | 奇米网在线观看 | 狠狠色噜噜狠狠狠狠2021天天 | 91漂亮少妇露脸在线播放 | 丁香五月缴情综合网 | 麻豆免费视频 | 久久久久女教师免费一区 | 激情五月婷婷激情 | 国产精品综合久久 | 亚洲狠狠丁香婷婷综合久久久 | 国产小视频国产精品 | 亚洲国产久 | 欧美韩日在线 | 欧美在线久久 | 国产又粗又硬又长又爽的视频 | 中文字幕在线观看完整版 | 国产一级二级视频 | 久久有精品 | 国产女教师精品久久av | 精品久久久久久久久久国产 | 免费在线看成人av | 免费人成网 | 欧美性久久久 | 中文国产在线观看 | 丁香花在线视频观看免费 | 国产精品视频在线看 | 国内综合精品午夜久久资源 | 在线日本看片免费人成视久网 | 国产精品99久久久精品免费观看 | 主播av在线 | 国产手机视频精品 | 久草97| 手机在线看片日韩 | 国产精品免费视频网站 | 97精品在线 | 免费看片色| 国产精品自产拍 | 九九激情视频 | 久久久精品国产免费观看一区二区 | 日韩a级黄色 | www.夜夜夜| av网址aaa| 日韩av一区二区在线 | 成人国产电影在线观看 | 干干夜夜 | 天天摸天天操天天爽 | 999成人| av电影在线免费观看 | 日韩素人在线观看 | 欧美一区二区三区在线 | 五月婷婷激情综合网 | 午夜国产福利在线 | 久保带人| 毛片www| 欧美精品免费一区二区 | 欧美激情视频一区二区三区免费 | 国产91区| 999久久久久久久久6666 | 欧美久久久久久 | 婷婷国产v亚洲v欧美久久 | 欧美少妇18p| 国产亚洲精品福利 | 国产自产高清不卡 | 国产精品a级 | 顶级欧美色妇4khd | 日韩和的一区二在线 | 99久久久成人国产精品 | 五月天丁香综合 | 欧美aa在线 | 亚洲男女精品 | 中文字幕一区二区三区在线播放 | 亚洲精品国产精品国自产观看 | 91精品少妇偷拍99 | 91cn国产在线 | 黄p网站在线观看 | 天天人人综合 | 日本精品视频在线 | 国产乱对白刺激视频不卡 | 中文在线免费一区三区 | 亚洲国产婷婷 | 国产操在线 | 91麻豆精品国产91久久久久久 | 日韩a在线 | 91成人精品一区在线播放69 | 亚洲人成人在线 | 亚洲欧洲日韩 | 国产日韩欧美在线看 | 国产二区免费视频 | 91精品网站| 午夜三级福利 | 亚洲成人黄色网址 | 69av视频在线 | 综合色伊人 | 久久午夜免费观看 | 欧洲av不卡 | 欧美久久综合 | 久久av免费观看 | 亚洲国产三级在线观看 | 久热色超碰 | 91成人精品国产刺激国语对白 | 91在线视频免费 | 中文字幕二区三区 | 久久精品91久久久久久再现 | 日本久久高清视频 | av大片免费在线观看 | 精品嫩模福利一区二区蜜臀 | 91av在线免费视频 | 尤物九九久久国产精品的分类 | 久久午夜精品 | 国内精品久久久久影院男同志 | 一级成人免费视频 | 色婷婷六月 | 黄色的片子 | 91精品国产自产在线观看 | 免费观看性生活大片3 | 91xav| 精品高清美女精品国产区 | 深夜免费福利网站 | 91av福利视频| 日韩在线观看视频免费 | 国产69久久久 | 粉嫩高清一区二区三区 | 在线观看视频日韩 | 日韩在线视频免费看 | 久久久久久久久久影院 | 婷婷黄色片 | 伊人五月天婷婷 | 综合久久综合久久 | 国产亚洲精品久久久久秋 | 中文字幕第一 | 日韩电影黄色 | 欧美另类美少妇69xxxx | 亚洲 欧美日韩 国产 中文 | 99九九免费视频 | 日韩精品91偷拍在线观看 | 婷婷激情影院 | 欧美精品免费视频 | 久久国产精品99久久人人澡 | 亚洲国产精品久久 | 天天干天天草天天爽 | 久久免费精品视频 | 天天草综合网 | 美女视频久久 | 特级西西人体444是什么意思 | 国产亚洲精品日韩在线tv黄 | 成人免费在线观看入口 | 欧美视频www | 精品一区av | 精品久久1| 特级西西444www大精品视频免费看 | 五月激情站 | 91成人精品一区在线播放69 | 久久精品超碰 | 精品国产成人在线影院 | 中文字幕在线观看国产 | 亚洲专区在线播放 | 国产香蕉久久 | 九九久久影视 | 在线视频一区观看 | 久艹视频在线观看 | 最新av在线网站 | 亚洲国产欧美一区二区三区丁香婷 | 成 人 免费 黄 色 视频 | 五月婷婷亚洲 | 日韩精品一区二区久久 | 激情 婷婷 | 中文字幕韩在线第一页 | 国产精品理论片在线播放 | 日韩精品一区二区三区高清免费 | 91在线视频免费 | 91丨九色丨国产女 | 毛片一二区 | 在线 成人 | 久草线 | 亚洲电影影音先锋 | 中国一级片在线 | 一区二区三区在线视频111 | 人人干干人人 | 中文字幕一区二区三区在线播放 | 99热精品久久 | 日韩一区二区三 | 九九色在线观看 | 在线亚洲精品 | 午夜影院一级片 | 啪啪凸凸 | 欧美成年网站 | 亚洲精品国偷拍自产在线观看 | 玖玖视频免费在线 | 欧美一级欧美一级 | 国产精久久| 在线观看日本高清mv视频 | 99久久er热在这里只有精品66 | 国产精品久久精品 | 午夜精品久久久久久久久久久 | 久久婷婷国产色一区二区三区 | 久久久国产精华液 | 成人免费在线看片 | 国产一级一级国产 | 在线观看中文 | 国产欧美精品一区aⅴ影院 99视频国产精品免费观看 | 国产精品久久久久久一区二区三区 | 激情综合交 | 久久精品视频观看 | 夜夜爽夜夜操 | 一区二区三区高清在线 | 精品黄色在线 | 亚洲黄色av网址 | 亚洲成av人片在线观看www | 国产视频91在线 | 久热超碰| 精品一区精品二区 | 欧美片一区二区三区 | 免费成视频 | 久久爱992xxoo| 亚洲国产资源 | 中文字幕日韩有码 | 亚洲在线视频网站 | 视频二区在线 | 国产精品一区二区免费看 | 美女亚洲精品 | 久久五月婷婷综合 | 日韩av专区 | 久久久国产一区 | 九九久久电影 | 六月丁香六月婷婷 | 国产精品成人久久久久久久 | 亚洲精品五月天 | 久久国产热视频 | 国产精品剧情在线亚洲 | 国产精品成人一区二区 | 999成人免费视频 | 超碰97在线资源站 | 91在线视频免费播放 | 色中色亚洲 | 日韩免费观看高清 | 91亚洲狠狠婷婷综合久久久 | 免费三及片 | 国产一区在线观看视频 | 97超碰免费在线观看 | 激情av在线播放 | 久久综合九色综合网站 | 亚洲美女精品视频 | 国产男女无遮挡猛进猛出在线观看 | 日韩在观看线 | 在线观看国产日韩欧美 | 麻豆免费在线视频 | av888.com | 天天搞天天干 | 91新人在线观看 | 97超碰中文 | av大全在线免费观看 | 国产福利精品视频 | 91av资源网 | 国产成人精品一区二 | 欧美老女人xx | 久久天天躁| 亚洲婷婷丁香 | 久久久久久久久电影 | 国产一区二区三区视频在线 | 国产精品美女视频网站 | 欧美色图亚洲图片 | 久久精品欧美一 | 美女免费黄网站 | 国产精品久久精品国产 | 69av视频在线观看 | 国产一线二线三线在线观看 | 视频一区二区在线 | 日韩久久精品一区二区三区下载 | 99在线热播精品免费 | 亚洲一级免费观看 | 久久综合色一综合色88 | 欧美激情综合网 | 国产小视频在线播放 | av网址aaa| 一级成人网 | 日韩精品一区二区在线 | 国产精品一区久久久久 | www日韩视频 | 久久免费视频1 | 毛片网站在线看 | 亚洲成人精品 | 国产精品成人一区 | 在线视频区 | av黄色亚洲 | 三上悠亚一区二区在线观看 | 精品日韩中文字幕 | 在线观看色网 | 狠狠狠色狠狠色综合 | 日韩免费成人av | 天天操夜夜看 | 麻花豆传媒mv在线观看网站 | 国产精品成人a免费观看 | 中文字幕一区二区三区四区在线视频 | 三日本三级少妇三级99 | 国产婷婷色 | 福利视频导航网址 | 国产精品久久久久久久久久久久午夜 | 最新国产在线视频 | 一区二区视频电影在线观看 | 中文字幕av在线免费 | 亚洲人人爱 | 97精品国自产拍在线观看 | 天天操网址 | 日韩精品免费一区二区 | 欧美国产日韩中文 | 国产黄色看片 | 天天天色 | 激情综合啪| 中文字幕精品一区二区精品 | 天天射综合网视频 | 一级片免费观看视频 | 国产精品国产三级国产不产一地 | 91高清免费观看 | 婷婷在线免费观看 | 五月婷婷视频在线 | 久久午夜羞羞影院 | 欧美精品一区二区性色 | 天天操天天干天天玩 | 日本公妇在线观看 | 久色 网| 久久久久久看片 | 日韩精品国产一区 | 国产在线久久久 | 开心色插| 婷婷久久五月天 | 欧美综合在线视频 | 色综合天天天天做夜夜夜夜做 | 黄色av电影网 | 精品亚洲va在线va天堂资源站 | 97在线免费 | 在线a视频免费观看 | 久久这里只有精品1 | av网站手机在线观看 | 日韩av男人的天堂 | 成 人 黄 色 视频播放1 | 日韩精品中文字幕在线 | 中文字幕av免费观看 | 天天爽人人爽夜夜爽 | 婷婷色在线播放 | 91在线免费观看国产 | 9在线观看免费 | 国产精品成人国产乱 | 在线看v片成人 | 国产精品1区2区 | 国产精品露脸在线 | 天天玩夜夜操 | 欧洲色吧 | 亚洲艳情| 国产精品大片在线观看 | 久久99热这里只有精品国产 | 999久久久久久久久 69av视频在线观看 | av电影中文 | 久草97| 玖玖视频国产 | 成年人在线播放视频 | 国产免费xvideos视频入口 | 一区二区精品视频 | 91爱爱电影 | 五月天天天操 | 中文字幕成人网 | 在线观看视频一区二区三区 | 久久视频热| 91传媒免费在线观看 | 91尤物国产尤物福利在线播放 | 亚洲天堂精品 | 日韩免费福利 | 超碰在线资源 | 一区二区三区在线免费观看 | www.国产精品 | 久久这里只有精品视频99 | 成人久久综合 | 免费在线观看日韩欧美 | 亚洲免费不卡 | 国产高清在线免费视频 | 久草在线视频国产 | av日韩av| 久久久久这里只有精品 | 久久久综合| 麻豆久久一区二区 | 黄色中文字幕 | 久久九九久久精品 | 韩国av免费观看 | 国产中文字幕网 | 97成人在线免费视频 | 精品在线观看免费 | 国产精品区二区三区日本 | 黄色精品网站 | 91九色在线观看 | 亚洲国产激情 | 在线看日韩 | www.天天成人国产电影 | 中文字幕在线看视频 | 91大神电影 | 99免费精品视频 | 在线看的av网站 | 亚洲国产综合在线 | 国产尤物在线视频 | 午夜精品久久久久久久久久 | 国产成人一区二区三区在线观看 | 成人精品一区二区三区中文字幕 | 国产精品久久久久久久毛片 | 亚洲精品视频在线免费 | 成人动漫精品一区二区 | 国产精品久久久久久久久岛 | 又爽又黄又无遮挡网站动态图 | 中文字幕韩在线第一页 | 免费a v视频 | 亚洲国产三级 | 欧美国产日韩一区二区三区 | 亚洲欧美va | 91麻豆产精品久久久久久 | 五月天中文字幕mv在线 | 日韩欧美精品一区二区三区经典 | 欧美日韩二区三区 | 一区二区视| av色影院 | 91在线精品秘密一区二区 | 婷婷激情5月天 | 国产免费黄视频在线观看 | 99久久精品视频免费 | 九九久久电影 | 97免费| 综合久久五月天 | 久久精品一区二区三区四区 | 人人要人人澡人人爽人人dvd | 中国一级片免费看 | 亚洲成人av在线 | 亚州精品在线视频 | 香蕉91视频| 欧美成人亚洲 | 激情伊人五月天 | 97超碰超碰久久福利超碰 | 中文字幕高清免费日韩视频在线 | 在线免费观看黄 | 香蕉视频久久久 | 亚洲三级黄| 久久久久久久福利 | 国产一区二区在线影院 | 久久精品一区二区国产 | 日韩在线色 | 成人禁用看黄a在线 | 欧美日韩视频 | 欧美久久久久久久久 | 成人毛片100免费观看 | 在线看国产 | 69xx视频| 丁香色综合 | 蜜臀av性久久久久av蜜臀三区 | 国产精品v欧美精品v日韩 | 日韩欧美在线一区 | 久久久久久国产一区二区三区 | 国产精品美女久久久免费 | 99视频精品 | 国产在线精品区 | 日韩精品中文字幕一区二区 | 亚洲伊人第一页 | 国产五十路毛片 |