mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user