react-native-big-list icon indicating copy to clipboard operation
react-native-big-list copied to clipboard

Question: show shimmer while scrolling fast

Open ydv0121 opened this issue 4 years ago • 8 comments

is it possible to show shimmer in whitespace when scrolling fast in big list?

ydv0121 avatar Jun 15 '21 09:06 ydv0121

Hi @ydv0121 , this isn't possibile because the blank space is a space from the last item to the end of the scrollview (not visibile) and if we sobstitute it with items the performance drops but there is a possible workaround to make an illusion of a shimmer. This workaround is to add a Image as repeated background. So in the end users should choice the image to repeat (like an image with a single stripe) or a component similar (like a react-native-svg that do the same thing)

Here and example with a repeated image:

https://user-images.githubusercontent.com/36447518/122114731-e967c000-ce23-11eb-87e4-f399f86e6250.mp4

If this is a good solution for you I can implement it.

marcocesarato avatar Jun 15 '21 19:06 marcocesarato

@marcocesarato yes it's great instead of white spaces in big list. Thanks

ydv0121 avatar Jun 16 '21 12:06 ydv0121

Added on 1.3.8 as experimental feature. I have encountered problems with screen resolutions and image resolution so this feature needs to be refined.

Using placeholder={true} you will see the default placeholder. Using placeholderImage={require('./assets/yourImage.png')} you can set your pattern of image to repeat. Using placeholderComponent you can set a component like an svg.

Let me know if you run into any issues and how this feature can be improved.

marcocesarato avatar Jun 16 '21 22:06 marcocesarato

I saw some bugs on android, so it need some improvements.

marcocesarato avatar Jun 17 '21 10:06 marcocesarato

yes there is also UI glitch. so it's not good idea to show shimmer in white space?

ydv0121 avatar Jun 17 '21 11:06 ydv0121

yes there is also UI glitch. so it's not good idea to show shimmer in white space?

Probably the best solution is to use and SVG pattern or find a similar solution, but at the moment it's better don't implement an SVG pattern as default (because need a to add a new dependency) until found a new solution.

marcocesarato avatar Jun 17 '21 12:06 marcocesarato

You could give the option and recommend the svg library to whoever is using and want shimmer. Maybe even restrict and make it required so no glitchs appear.

dougg0k avatar Jun 25 '21 16:06 dougg0k

i am trying to integrate this module with biglist https://github.com/tomzaku/react-native-shimmer-placeholder

ydv0121 avatar Jun 26 '21 05:06 ydv0121