private void addChildDrawingOrderCallback() { if (VERSION.SDK_INT < 21) { if (this.mChildDrawingOrderCallback == null) { this.mChildDrawingOrderCallback = new ChildDrawingOrderCallback() { public int onGetChildDrawingOrder(int childCount, int i) { if (ItemTouchHelper.this.mOverdrawChild == null) { return i; } int childPosition = ItemTouchHelper.this.mOverdrawChildPosition; if (childPosition == -1) { childPosition = ItemTouchHelper.this.mRecyclerView.indexOfChild(ItemTouchHelper.this.mOverdrawChild); ItemTouchHelper.this.mOverdrawChildPosition = childPosition; } if (i == childCount - 1) { return childPosition; } return i >= childPosition ? i + 1 : i; } }; } this.mRecyclerView.setChildDrawingOrderCallback(this.mChildDrawingOrderCallback); } }