Program: 69197
Project: 69197
Buggy source:
/** 
 * Show at relative position to anchor View with translation.
 * @param anchor Anchor View
 * @param vertPos Vertical Position Flag
 * @param horizPos Horizontal Position Flag
 * @param x Translation X
 * @param y Translation Y
 * @param fitInScreen Automatically fit in screen or not
 */
public void showOnAnchor(@NonNull View anchor,@VerticalPosition int vertPos,@HorizontalPosition int horizPos,int x,int y,boolean fitInScreen){
  setClippingEnabled(fitInScreen);
  View contentView=getContentView();
  contentView.measure(makeDropDownMeasureSpec(getWidth()),makeDropDownMeasureSpec(getHeight()));
  final int measuredW=contentView.getMeasuredWidth();
  final int measuredH=contentView.getMeasuredHeight();
  if (!fitInScreen) {
    final int[] anchorLocation=new int[2];
    anchor.getLocationInWindow(anchorLocation);
    x+=anchorLocation[0];
    y+=anchorLocation[1] + anchor.getHeight();
  }
switch (vertPos) {
case VerticalPosition.ABOVE:
    y-=measuredH + anchor.getHeight();
  break;
case VerticalPosition.ALIGN_BOTTOM:
y-=measuredH;
break;
case VerticalPosition.CENTER:
y-=anchor.getHeight() / 2 + measuredH / 2;
break;
case VerticalPosition.ALIGN_TOP:
y-=anchor.getHeight();
break;
case VerticalPosition.BELOW:
break;
}
switch (horizPos) {
case HorizontalPosition.LEFT:
x-=measuredW;
break;
case HorizontalPosition.ALIGN_RIGHT:
x-=measuredW - anchor.getWidth();
break;
case HorizontalPosition.CENTER:
x+=anchor.getWidth() / 2 - measuredW / 2;
break;
case HorizontalPosition.ALIGN_LEFT:
break;
case HorizontalPosition.RIGHT:
x+=anchor.getWidth();
break;
}
if (fitInScreen) {
PopupWindowCompat.showAsDropDown(this,anchor,x,y,Gravity.NO_GRAVITY);
}
 else {
showAtLocation(anchor,Gravity.NO_GRAVITY,x,y);
}
}

Fixed version (ground truth):
/** 
 * Show at relative position to anchor View with translation.
 * @param anchor Anchor View
 * @param vertPos Vertical Position Flag
 * @param horizPos Horizontal Position Flag
 * @param x Translation X
 * @param y Translation Y
 * @param fitInScreen Automatically fit in screen or not
 */
public void showOnAnchor(@NonNull View anchor,@VerticalPosition int vertPos,@HorizontalPosition int horizPos,int x,int y,boolean fitInScreen){
  setClippingEnabled(fitInScreen);
  View contentView=getContentView();
  contentView.measure(makeDropDownMeasureSpec(getWidth()),makeDropDownMeasureSpec(getHeight()));
  final int measuredW=contentView.getMeasuredWidth();
  final int measuredH=contentView.getMeasuredHeight();
  if (!fitInScreen) {
    final int[] anchorLocation=new int[2];
    anchor.getLocationInWindow(anchorLocation);
    x+=anchorLocation[0];
    y+=anchorLocation[1] + anchor.getHeight();
  }
switch (vertPos) {
case VerticalPosition.ABOVE:
    y-=measuredH + anchor.getHeight();
  break;
case VerticalPosition.ALIGN_BOTTOM:
y-=measuredH;
break;
case VerticalPosition.CENTER:
y-=anchor.getHeight() / 2 + measuredH / 2;
break;
case VerticalPosition.ALIGN_TOP:
y-=anchor.getHeight();
break;
case VerticalPosition.BELOW:
break;
default :
break;
}
switch (horizPos) {
case HorizontalPosition.LEFT:
x-=measuredW;
break;
case HorizontalPosition.ALIGN_RIGHT:
x-=measuredW - anchor.getWidth();
break;
case HorizontalPosition.CENTER:
x+=anchor.getWidth() / 2 - measuredW / 2;
break;
case HorizontalPosition.ALIGN_LEFT:
break;
case HorizontalPosition.RIGHT:
x+=anchor.getWidth();
break;
default :
break;
}
if (fitInScreen) {
PopupWindowCompat.showAsDropDown(this,anchor,x,y,Gravity.NO_GRAVITY);
}
 else {
showAtLocation(anchor,Gravity.NO_GRAVITY,x,y);
}
}