See the picture, i have a button and it is behind an invisible view (the red l
Yes Its possible. Until or unless your invisible view is not clickable. so check your invisible layout structure. make android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
Declare it in your layout.
Let me know if it helps you.
1 way you can do this is:
1. add an onTouch(View view, MotionEventevent)
Listener to your layout
2. get the buttons bounds
3. Check if the touch event was done inside the bounds
The code should look something like this:
Button button;
Rect rect;
onCreate(){
rect = button.getClipBounds();
layout.setOnTouchListener(this)
}
onTouch(View view, MotionEvent event){
if(rect.contains(event.getX(), event.getY())
//insert action here
}