-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] FastImage component with borderRadius above Video shows flickering clipped content #255
Comments
I was able to patch a workaround onto patch-package
--- a/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageViewConverter.java
+++ b/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageViewConverter.java
@@ -84,12 +84,21 @@ class FastImageViewConverter {
case IMMUTABLE:
// Use defaults.
}
- return new RequestOptions()
+ RequestOptions options = new RequestOptions()
.diskCacheStrategy(diskCacheStrategy)
.onlyRetrieveFromCache(onlyFromCache)
.skipMemoryCache(skipMemoryCache)
.priority(priority)
.placeholder(TRANSPARENT_DRAWABLE);
+ try {
+ if (source.getBoolean("circle") == true) {
+ options = options.circleCropTransform();
+ }
+ } catch (NoSuchKeyException e) {
+
+ }
+
+ return options;
}
private static FastImageCacheControl getCacheControl(ReadableMap source) { This allows a new boolean property |
I think this is react-native issue facebook/react-native#20278 |
I also fork this lib base on @n1ru4l code. I passed borderRadius prop from style to native code, then apply RoundedConner to it. |
@dochatuc That is awesome, have you thought about making a pull request for your changes? |
@n1ru4l In my opinion, the fork is a temperate approach. We should wait for a fix from react-native lib |
This link might be helpful, seems like we could implement border-radius cropping on the native android thread: @DylanVann What is your opinion on this? If you feel alright with it I could sent a pull request based upon glide-transformations. |
Is this issue fixed? |
@nehacurefit No it is not fixed |
@DylanVann are we planning to fix this anytime soon in this library? |
I observe the same issue with Android in the FlatList of images while using borderRadius as style property. |
@andrewkslv did you manage to fix it? i have the same issue as well |
@hotdev405 I didn't. I've decided to use Image component from React Native for Android and Fast Image for iOS. |
Thanks @dochathuc. Your temporary solution works for me. |
react-native-fast-image version:
4.0.14
(also appears on branchmaster
)react-native-video version:
3.1.0
android version:
7.0.0
,7.1.1
The application that I am building contains videos (
Video
component) which have an image overlay (FastImage
component). The overlay image has aborderRadius
property to appear in a circle shape. However on android the FlatList image component is flickering and showing the clipped content of the image. However when rendered above anything else than aVideo
component , this issue does not occur. When using theImage
component thatreact-native
provides this issue does not occur.react-native-video uses exoplayer and react-native-fast-image uses glide, so this might be a conflict between those two libraries. I am not a native android developer so my know-how is limited. Any hints are appreciated. Also I had not the opportunity to test on android version
8.x.x
yet.Video that demonstrates the issue: https://s3.eu-central-1.amazonaws.com/groove.cat/.misc/2018_07_30_12_22_02.mp4
This is the code of the image component:
The text was updated successfully, but these errors were encountered: