private View findCurrentCenterView(){
  float centerX=getWidth() / 2;
  float viewHalfWidth=settings.getViewWidthPx() / 2;
  View nearestToCenterView=null;
  int nearestDeltaX=0;
  View item;
  int centerXView;
  for (int count=getChildCount(), i=0; i < count; i++) {
    item=getChildAt(i);
    centerXView=(int)(getDecoratedLeft(item) + viewHalfWidth);
    if (nearestToCenterView == null || Math.abs(nearestDeltaX) > Math.abs(centerX - centerXView)) {
      nearestToCenterView=item;
      nearestDeltaX=(int)(centerX - centerXView);
    }
  }
  return nearestToCenterView;
}

private View findCurrentCenterView ( ) { float centerX = getWidth ( ) / 2 ; float viewHalfWidth = settings . getViewWidthPx ( ) / 2 ; View nearestToCenterView = null ; int nearestDeltaX = 0 ; View item ; int centerXView ; for ( int count = getChildCount ( ) , i = 0 ; i < count ; i ++ ) { item = getChildAt ( i ) ; centerXView = ( int ) ( getDecoratedLeft ( item ) + viewHalfWidth ) ; if ( nearestToCenterView == null || Math . abs ( nearestDeltaX ) > Math . abs ( centerX - centerXView ) ) { nearestToCenterView = item ; nearestDeltaX = ( int ) ( centerX - centerXView ) ; } } return nearestToCenterView ; }
find view in the middle of screen
