private float calculateBasePageTargetY(PanelState expandedState){
  if (!isFullscreenSizePanel())   return 0.f;
  final float selectionY=mBasePageSelectionYPx * mPxToDp;
  final float expandedHeight=getPanelHeightFromState(expandedState) - mSearchBarPaddingTop;
  final float fullscreenHeight=getFullscreenHeight();
  final float availableHeight=fullscreenHeight - expandedHeight;
  float offset=-selectionY + availableHeight / 2;
  offset=Math.min(offset,0.f);
  if (mIsToolbarShowing)   offset-=mToolbarHeight;
  offset=Math.max(offset,-expandedHeight);
  return offset;
}

private float calculateBasePageTargetY ( PanelState expandedState ) { if ( ! isFullscreenSizePanel ( ) ) return 0.f ; final float selectionY = mBasePageSelectionYPx * mPxToDp ; final float expandedHeight = getPanelHeightFromState ( expandedState ) - mSearchBarPaddingTop ; final float fullscreenHeight = getFullscreenHeight ( ) ; final float availableHeight = fullscreenHeight - expandedHeight ; float offset = - selectionY + availableHeight / 2 ; offset = Math . min ( offset , 0.f ) ; if ( mIsToolbarShowing ) offset -= mToolbarHeight ; offset = Math . max ( offset , - expandedHeight ) ; return offset ; }
calculates the target offset of the base page in order to keep the selection in view after expanding the panel to the given | expandedstate | .
