react-native-fast-image icon indicating copy to clipboard operation
react-native-fast-image copied to clipboard

Blur support for Android

Open dkunin9 opened this issue 3 years ago • 3 comments

Would be really happy to set blur for Fast Image on Android 😌

dkunin9 avatar Sep 25 '21 22:09 dkunin9

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 and pixel?: number to the source object (not happy with this but it was the quickest way for me)
  • Apply transformations inside method getOptions in file FastImageViewConverter.java:
if (blurRadius != null) {
    options = options.transform(new BlurTransformation(blurRadius, 3));
}

if (pixel != null) {
    options = options.transform(new PixelationFilterTransformation(pixel));
}

hatem-72 avatar Sep 28 '21 08:09 hatem-72

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 and pixel?: number to the source object (not happy with this but it was the quickest way for me)
  • Apply transformations inside method getOptions in file FastImageViewConverter.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 🙂

dkunin9 avatar Sep 28 '21 16:09 dkunin9

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??

dezudas avatar Nov 05 '23 16:11 dezudas