react-native-fast-image
react-native-fast-image copied to clipboard
Blur support for Android
Would be really happy to set blur for Fast Image on Android 😌
While waiting for the official support of this feature, I patched the library this way to get a "Blur" effect and a "Pixel" effect:
- Add this dependency to
build.gradle
: https://github.com/wasabeef/glide-transformations - Pass extra properties
blurRadius?: number
andpixel?: number
to thesource
object (not happy with this but it was the quickest way for me) - Apply transformations inside method
getOptions
in fileFastImageViewConverter.java
:
if (blurRadius != null) {
options = options.transform(new BlurTransformation(blurRadius, 3));
}
if (pixel != null) {
options = options.transform(new PixelationFilterTransformation(pixel));
}
While waiting for the official support of this feature, I patched the library this way to get a "Blur" effect and a "Pixel" effect:
- Add this dependency to
build.gradle
: https://github.com/wasabeef/glide-transformations- Pass extra properties
blurRadius?: number
andpixel?: number
to thesource
object (not happy with this but it was the quickest way for me)- Apply transformations inside method
getOptions
in fileFastImageViewConverter.java
:if (blurRadius != null) { options = options.transform(new BlurTransformation(blurRadius, 3)); } if (pixel != null) { options = options.transform(new PixelationFilterTransformation(pixel)); }
oh, thank you! I will try 🙂
what about the ios looks like https://github.com/HyopeR/react-native-fast-image is working for few people can't we include it in official release??