void sanitizeMenuPosition(RectF menuRect){
  Point appUsableScreenSize=getAppUsableScreenSize();
  float margin=flyoutMenuView.menuMargin;
  float right=appUsableScreenSize.x - margin;
  float bottom=appUsableScreenSize.y - margin;
  if (menuRect.left < margin) {
    float dx=margin - menuRect.left;
    menuRect.offset(dx,0);
  }
  if (menuRect.top < margin) {
    float dy=margin - menuRect.top;
    menuRect.offset(0,dy);
  }
  if (menuRect.right > right) {
    float dx=right - menuRect.right;
    menuRect.offset(dx,0);
  }
  if (menuRect.bottom > bottom) {
    float dy=bottom - menuRect.bottom;
    menuRect.offset(0,dy);
  }
}

void sanitizeMenuPosition ( RectF menuRect ) { Point appUsableScreenSize = getAppUsableScreenSize ( ) ; float margin = flyoutMenuView . menuMargin ; float right = appUsableScreenSize . x - margin ; float bottom = appUsableScreenSize . y - margin ; if ( menuRect . left < margin ) { float dx = margin - menuRect . left ; menuRect . offset ( dx , 0 ) ; } if ( menuRect . top < margin ) { float dy = margin - menuRect . top ; menuRect . offset ( 0 , dy ) ; } if ( menuRect . right > right ) { float dx = right - menuRect . right ; menuRect . offset ( dx , 0 ) ; } if ( menuRect . bottom > bottom ) { float dy = bottom - menuRect . bottom ; menuRect . offset ( 0 , dy ) ; } }
attempt to position menurect such that it does not fall off any screen edge or overlap the navigation bar
