question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] FastImage component with borderRadius above Video shows flickering clipped content

See original GitHub issue

react-native-fast-image version: 4.0.14 (also appears on branch master) 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 a borderRadius 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 a Video component , this issue does not occur. When using the Image component that react-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:

import React, { Component } from 'react'
import { View } from 'react-native'
import PropTypes from 'prop-types'
import FastImage from 'react-native-fast-image'

const sizes = {
  small: 25,
  medium: 50,
  large: 100,
}

export default class GcRoundedImage extends Component {
  shouldComponentUpdate() {
    return false
  }

  render() {
    const {
      props: { imageSource, size = `medium`, style = {} },
    } = this
    const width = sizes[size]
    return (
      <View
        style={{
          height: width,
          width: width,
          borderRadius: width / 2,
          overflow: `hidden`,
          ...style,
        }}
      >
        <FastImage
          resizeMode={FastImage.resizeMode.contain}
          source={imageSource}
          style={{
            height: width,
            width: width,
            borderRadius: width / 2,
            overflow: `hidden`,
            ...style
          }}
          borderRadius={width / 2}
        />
      </View>
    )
  }
}

GcRoundedImage.propTypes = {
  imageSource: PropTypes.object.isRequired,
  size: PropTypes.oneOf([`large`, `medium`, `small`]),
}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dochathuccommented, Sep 15, 2018

I also fork this lib base on @n1ru4l code. I passed borderRadius prop from style to native code, then apply RoundedConner to it.

https://github.com/dochathuc/react-native-fast-image

0reactions
vikjovanovcommented, Feb 16, 2020

Any fix ?

I have exactly the same problem when I scroll my horizontal list, the images inside the flatlist items have their borderRadius flickering and this only happens on Android too!

flickering

Read more comments on GitHub >

github_iconTop Results From Across the Web

Image flickers on first load in ReactNative - Stack Overflow
For me, it was causing flickering issues when I put the Image component in a FlatList ListHeaderComponent component. So,.
Read more >
react-native-fast-image - npm
React Native's Image component handles image caching like browsers for the most part. If the server is returning proper cache control headers ...
Read more >
A React Native reusable and Color Picker Wheel - Morioh
Learn how to cache images in React Native using react-native-fast-image and build your own React Native image caching component from scratch.
Read more >
HTML5 Comprehensive Guide - SlideShare
HTML5 Comprehensive Guide. 1. HTML 5; 2. What is HTML5? “Specification that defines the 5th major revision of the core language of the...
Read more >
Release Notes for Archived Versions - Pale Moon
Cleaned up more Android code from the platform. Updated the embedded emoji font to cater to even more race-dependent profession emoji. Fixed an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found