question: private void snapInCenter ( ) { final ViewItem currentItem = mViewItem [ mCurrentItem ] ; final int currentViewCenter = currentItem . getCenterX ( ) ; if ( mController . isScrolling ( ) || mIsUserScrolling || mCenterX == currentViewCenter ) { return ; } int snapInTime = ( int ) ( SNAP_IN_CENTER_TIME_MS * ( ( float ) Math . abs ( mCenterX - currentViewCenter ) ) / mDrawArea . width ( ) ) ; mController . scrollToPosition ( currentViewCenter , snapInTime , false ) ; if ( getCurrentViewType ( ) == ImageData . VIEW_TYPE_STICKY && ! mController . isScaling ( ) && mScale != FULL_SCREEN_SCALE ) { mController . goToFullScreen ( ) ; } }
target:  Keep the current item in the center. This functions does not check if the current item is null.