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

Commit 64cf3ae5 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Copy branding image drawable even while the view is Gone." into main

parents 36d58260 566c4335
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -733,11 +733,12 @@ public final class SplashScreenView extends FrameLayout {
                mIconBitmap = iconView != null
                        ? copyDrawable(((ImageView) view.getIconView()).getDrawable()) : null;
            }
            mBrandingBitmap = copyDrawable(view.getBrandingView().getBackground());

            ViewGroup.LayoutParams params = view.getBrandingView().getLayoutParams();
            final ViewGroup.LayoutParams params = view.getBrandingView().getLayoutParams();
            mBrandingWidth = params.width;
            mBrandingHeight = params.height;
            mBrandingBitmap = copyDrawableWithSize(view.getBrandingView().getBackground(),
                    mBrandingWidth, mBrandingHeight);

            if (view.getIconAnimationStart() != null) {
                mIconAnimationStartMillis = view.getIconAnimationStart().toEpochMilli();
@@ -752,6 +753,13 @@ public final class SplashScreenView extends FrameLayout {
                final Rect initialBounds = drawable.copyBounds();
                final int width = initialBounds.width();
                final int height = initialBounds.height();
                return copyDrawableWithSize(drawable, width, height);
            }
            return null;
        }

        private Bitmap copyDrawableWithSize(Drawable drawable, int width, int height) {
            if (drawable != null) {
                if (width <= 0 || height <= 0) {
                    return null;
                }