Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ce586b3 authored by Sihua Ma's avatar Sihua Ma Committed by Android (Google) Code Review
Browse files

Merge "Fill the fade-in ImageView with its content for the cross fade animation" into tm-qpr-dev

parents 1092ccac ecc27244
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -363,7 +363,10 @@ public abstract class DragView<T extends Context & ActivityContext> extends Fram
            // If the content is already removed, ignore
            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.layout(0, 0, 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);
        iv.setImageDrawable(drawable);
        return iv;