I have a method for event coordinates that relates to an internal target.
public boolean isInsideView( View view,float x, float y){ int location[] = new int[2]; view.getLocationInWindow(location); int viewX = location[0]; int viewY = location[1]; if(( x > viewX && x < (viewX + view.getWidth())) && ( y > viewY && y < (viewY + view.getHeight()))){ return true; } else { return false; } }
But it doesnβt work when rotation is set as the viewing target.
<ImageView android:id="@+id/v_checkpoint1_1" android:layout_width="50dp" android:layout_height="150dp" android:background="@android:color/holo_green_dark" android:rotation="-25" />
please help me fix this. thank you very much.
source share