I have an ImageView. In its onClick I get its Drawable:
Drawable dr = ((ImageView) v).getDrawable();
And set it to a dialog\'s ImageView:>
I managed to copy the drawable using following code:
drawable.mutate().getConstantState().newDrawable();
Here mutate()
makes the drawable mutable to avoid sharing its state, and getConstantState().newDrawable()
creates a new copy.
Thus different ImageView
s use different drawables and there's no stretching.