private void switchViews ( final View switchView , final long switchId , final float translationY ) { assert mHoverDrawable != null ; assert mAdapter != null ; assert mMobileView != null ; final int switchViewPosition = mWrapper . getPositionForView ( switchView ) ; int mobileViewPosition = mWrapper . getPositionForView ( mMobileView ) ; ( ( Swappable ) mAdapter ) . swapItems ( switchViewPosition - mWrapper . getHeaderViewsCount ( ) , mobileViewPosition - mWrapper . getHeaderViewsCount ( ) ) ; ( ( BaseAdapter ) mAdapter ) . notifyDataSetChanged ( ) ; mHoverDrawable . shift ( switchView . getHeight ( ) ) ; mSwitchViewAnimator . animateSwitchView ( switchId , translationY ) ; }
Switches the item that is currently being dragged with the item belonging to given id by notifying the adapter to swap positions and that the data set has changed .