Android examples for android.view:View
Is point In View
import android.view.View; public class Main { private static int sLocation[] = new int[2]; public static boolean pointInView(float x, float y, View v) { v.getLocationInWindow(sLocation);/* ww w . j a v a2 s. co m*/ return x >= sLocation[0] && x < (sLocation[0] + v.getWidth()) && y >= sLocation[1] && y < (sLocation[1] + v.getHeight()); } }