Merge "Fill the fade-in ImageView with its content for the cross fade animation" into tm-qpr-dev
This commit is contained in:
@@ -363,7 +363,10 @@ public abstract class DragView<T extends Context & ActivityContext> extends Fram
|
|||||||
// If the content is already removed, ignore
|
// If the content is already removed, ignore
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
View newContent = getViewFromDrawable(getContext(), crossFadeDrawable);
|
ImageView newContent = getViewFromDrawable(getContext(), crossFadeDrawable);
|
||||||
|
// We need to fill the ImageView with the content, otherwise the shapes of the final view
|
||||||
|
// and the drag view might not match exactly
|
||||||
|
newContent.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||||
newContent.measure(makeMeasureSpec(mWidth, EXACTLY), makeMeasureSpec(mHeight, EXACTLY));
|
newContent.measure(makeMeasureSpec(mWidth, EXACTLY), makeMeasureSpec(mHeight, EXACTLY));
|
||||||
newContent.layout(0, 0, mWidth, mHeight);
|
newContent.layout(0, 0, mWidth, mHeight);
|
||||||
addViewInLayout(newContent, 0, new LayoutParams(mWidth, mHeight));
|
addViewInLayout(newContent, 0, new LayoutParams(mWidth, mHeight));
|
||||||
@@ -573,7 +576,7 @@ public abstract class DragView<T extends Context & ActivityContext> extends Fram
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static View getViewFromDrawable(Context context, Drawable drawable) {
|
private static ImageView getViewFromDrawable(Context context, Drawable drawable) {
|
||||||
ImageView iv = new ImageView(context);
|
ImageView iv = new ImageView(context);
|
||||||
iv.setImageDrawable(drawable);
|
iv.setImageDrawable(drawable);
|
||||||
return iv;
|
return iv;
|
||||||
|
|||||||
Reference in New Issue
Block a user