From 673ef39561ce6640e447fa40299c263961e4f178 Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Thu, 15 Nov 2018 20:30:44 -0800 Subject: [PATCH] resizeMode applies to Image.defaultSource (#22216) Summary: resizeMode applies to Image.defaultSource, because depending on screen resolution sometimes we see padding around defaultSource image while source loading. Now we can control scale of both source and defaultSource. Changelog: ---------- [Android] [Fixed] - Image.resizeMode will apply to defaultSource, enhanced user experience. Previously, resizeMode didn't applied to defaultSource, therefore depending on screen resolution sometimes we see padding around defaultSource image while source loading. Pull Request resolved: https://github.com/facebook/react-native/pull/22216 Differential Revision: D13088220 Pulled By: mdvacca fbshipit-source-id: 92c66cf6228f3b7666b9ef2404d034f0005b5234 --- .../java/com/facebook/react/views/image/ReactImageView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java b/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java index ff720bd8156dec..722dd1225095f8 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java @@ -439,7 +439,7 @@ public void maybeUpdateView() { hierarchy.setActualImageScaleType(mScaleType); if (mDefaultImageDrawable != null) { - hierarchy.setPlaceholderImage(mDefaultImageDrawable, ScalingUtils.ScaleType.CENTER); + hierarchy.setPlaceholderImage(mDefaultImageDrawable, mScaleType); } if (mLoadingImageDrawable != null) {