private void switchId(View targetView,View view){
  ViewGroup parent=(ViewGroup)view.getParent();
  targetView.getLocationOnScreen(sLocation);
  if (!mVertical) {
    targetView.setX(mDragOrigin - parent.getLeft());
    mDragOrigin=sLocation[0];
  }
 else {
    targetView.setY(mDragOrigin - parent.getTop());
    mDragOrigin=sLocation[1];
  }
  int targetIndex=mButtonViews.indexOf(targetView);
  int draggedIndex=mButtonViews.indexOf(view);
  Collections.swap(mButtonViews,draggedIndex,targetIndex);
}

private void switchId ( View targetView , View view ) { ViewGroup parent = ( ViewGroup ) view . getParent ( ) ; targetView . getLocationOnScreen ( sLocation ) ; if ( ! mVertical ) { targetView . setX ( mDragOrigin - parent . getLeft ( ) ) ; mDragOrigin = sLocation [ 0 ] ; } else { targetView . setY ( mDragOrigin - parent . getTop ( ) ) ; mDragOrigin = sLocation [ 1 ] ; } int targetIndex = mButtonViews . indexOf ( targetView ) ; int draggedIndex = mButtonViews . indexOf ( view ) ; Collections . swap ( mButtonViews , draggedIndex , targetIndex ) ; }
switches positions of two views and updates their mbuttonviews entry
