I need to drag and select a portion of an image set in an ImageView
and retrieve the end points of the selected rectangle without causing any modifications (suc
I just tried out your solution, it's pretty cool. Maybe I am wrong, but I think there is a typo in your Toast output:
mCallback.onRectFinished(new Rect(Math.min(mStartX, mEndX), Math.min(mStartY, mEndY),
Math.max(mEndX, mStartX), Math.max(mEndY, mStartX)));
must be:
mCallback.onRectFinished(new Rect(Math.min(mStartX, mEndX), Math.min(mStartY, mEndY),
Math.max(mEndX, mStartX), Math.max(mEndY, mStartY)));
otherwise the value of the bottom sometimes is calculated wrong.