I'll answer the general question - find out when two views overlap:
private boolean viewsOverlap(View v1, View v2) {
int[] v1_coords = new int[2];
v1.getLocationOnScreen(v1_coords);
int v1_w = v1.getWidth();
int v1_h = v1.getHeight();
Rect v1_rect = new Rect(v1_coords[0], v1_coords[1], v1_coords[0] + v1_w, v1_coords[1] + v1_h);
int[] v2_coords = new int[2];
v2.getLocationOnScreen(v1_coords);
int v2_w = v2.getWidth();
int v2_h = v2.getHeight();
Rect v2_rect = new Rect(v2_coords[0], v2_coords[1], v2_coords[0] + v2_w, v2_coords[1] + v2_h);
return v1_rect.intersect(v2_rect) || v1_rect.contains(v2_rect) || v2_rect.contains(v1_rect);
}
My trigonometry is a little shaky these days so I'm not sure about this part:
OVERLAP == v1_rect.intersect(v2_rect) || v1_rect.contains(v2_rect) || v2_rect.contains(v1_rect);
Double check me. Good luck.