Skip to content

Commit 6486097

Browse files
yungstersfacebook-github-bot
authored andcommitted
RN: Adjust Image Blur on Android
Summary: Adjusts the behavior of `blurRadius` for `Image` on Android so that it behaves more closely to other platforms (web and iOS). Changelog: [Android][Changed] - Effect of `blurRadius` now more closely matches other platforms. Reviewed By: shergin Differential Revision: D22118680 fbshipit-source-id: c6d14aef29b4a086e43badfa78407bfa07f9fee2
1 parent a69bd9d commit 6486097

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,12 @@ public void onFailure(String id, Throwable throwable) {
275275
}
276276

277277
public void setBlurRadius(float blurRadius) {
278-
int pixelBlurRadius = (int) PixelUtil.toPixelFromDIP(blurRadius);
278+
// Divide `blurRadius` by 2 to more closely match other platforms.
279+
int pixelBlurRadius = (int) PixelUtil.toPixelFromDIP(blurRadius) / 2;
279280
if (pixelBlurRadius == 0) {
280281
mIterativeBoxBlurPostProcessor = null;
281282
} else {
282-
mIterativeBoxBlurPostProcessor = new IterativeBoxBlurPostProcessor(pixelBlurRadius);
283+
mIterativeBoxBlurPostProcessor = new IterativeBoxBlurPostProcessor(2, pixelBlurRadius);
283284
}
284285
mIsDirty = true;
285286
}

0 commit comments

Comments
 (0)