private List<Quadrant> findContainingQuadrants(Rect firstRect,Rect secondRect){
  List<Quadrant> quadrants=new ArrayList<>();
  int radiusX=(firstRect.right - firstRect.left) / 2;
  int radiusY=(firstRect.bottom - firstRect.top) / 2;
  for (  Quadrant quadrant : Quadrant.values()) {
    int x=firstRect.centerX() + quadrant.getxSign() * radiusX;
    int y=firstRect.centerY() + quadrant.getySign() * radiusY;
    Rect quadrantRect=new Rect(Math.min(x,firstRect.centerX()),Math.min(y,firstRect.centerY()),Math.max(firstRect.centerX(),x),Math.max(firstRect.centerY(),y));
    if (secondRect.contains(quadrantRect)) {
      quadrants.add(quadrant);
    }
  }
  return quadrants;
}

private List < Quadrant > findContainingQuadrants ( Rect firstRect , Rect secondRect ) { List < Quadrant > quadrants = new ArrayList < > ( ) ; int radiusX = ( firstRect . right - firstRect . left ) / 2 ; int radiusY = ( firstRect . bottom - firstRect . top ) / 2 ; for ( Quadrant quadrant : Quadrant . values ( ) ) { int x = firstRect . centerX ( ) + quadrant . getxSign ( ) * radiusX ; int y = firstRect . centerY ( ) + quadrant . getySign ( ) * radiusY ; Rect quadrantRect = new Rect ( Math . min ( x , firstRect . centerX ( ) ) , Math . min ( y , firstRect . centerY ( ) ) , Math . max ( firstRect . centerX ( ) , x ) , Math . max ( firstRect . centerY ( ) , y ) ) ; if ( secondRect . contains ( quadrantRect ) ) { quadrants . add ( quadrant ) ; } } return quadrants ; }
returns the quadrants which the second rect contains in itself fully .
