is Touch Point In Clickable View - Android User Interface

Android examples for User Interface:View Click

Description

is Touch Point In Clickable View

Demo Code


//package com.java2s;
import android.view.View;

public class Main {

    public static boolean isTouchPointInClickableView(View view, int x,
            int y) {
        if (view.isClickable() && y >= view.getTop()
                && y <= view.getBottom() && x >= view.getLeft()
                && x <= view.getRight()) {
            return true;
        }/*from   w  ww.  j a va2  s  .c  om*/
        return false;
    }
}

Related Tutorials