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
This commit is contained in:
Tim Yung
2020-06-18 14:44:15 -07:00
committed by Facebook GitHub Bot
parent a69bd9dadf
commit 64860972be
@@ -275,11 +275,12 @@ public class ReactImageView extends GenericDraweeView {
}
public void setBlurRadius(float blurRadius) {
int pixelBlurRadius = (int) PixelUtil.toPixelFromDIP(blurRadius);
// Divide `blurRadius` by 2 to more closely match other platforms.
int pixelBlurRadius = (int) PixelUtil.toPixelFromDIP(blurRadius) / 2;
if (pixelBlurRadius == 0) {
mIterativeBoxBlurPostProcessor = null;
} else {
mIterativeBoxBlurPostProcessor = new IterativeBoxBlurPostProcessor(pixelBlurRadius);
mIterativeBoxBlurPostProcessor = new IterativeBoxBlurPostProcessor(2, pixelBlurRadius);
}
mIsDirty = true;
}