-1

I have one relative layout whose coordinates are (0,207).

I have another view whose coordinates are (1138,750) and second view x-offset and y-offset (397,96) and I have calculated left (x-xoffset) and right (y-yoffset). Now, I want to check if the view a exists in view b area, then I want to get callback.

How can I achieve this? I am not able to find a solution.

  • view A is imageview inside Relativelayout
  • view B is text and imageview inside Relativelayout

I am dragging view B to view A.

Pang
  • 9,564
  • 146
  • 81
  • 122
Manoj Kumar
  • 97
  • 1
  • 1
  • 10

1 Answers1

0

You can find your view inside another view by this code.It will help you find another view of the relative layout.

for (int i = 0; i < relativelayout.getChildCount(); i++) {

    if (relativelayout.getChildAt(i) instanceof Imageview) {

       //Do your stuff

        ((ImageView) relativelayout.getChildAt(i)).disableAll();// Like this you can do something with it
    }

}
Farhana Naaz Ansari
  • 7,524
  • 26
  • 65
  • 105