react-native-lightbox icon indicating copy to clipboard operation
react-native-lightbox copied to clipboard

[Android] Fix jumpy animation

Open ncuillery opened this issue 7 years ago • 10 comments

Description

The y coordinate sent by the React Native measure seems to take the StatusBar height into account. There is no need to do the subtraction anymore.

Steps to reproduce

  • Run the Example on an Android device
  • Touch the pig with the hat
    • Before the beginning of the opening animation, the image moves suddenly few pixels upward (very fast, hard to see)
    • When the lightbox is open, touch/untouch the image makes it jump vertically of few pixels too
    • At the end of the closing animation, the image moves suddendly few pixels downward to fit in its container again.

With that fix, the 3 issues disappear.

CC my teammate @philtrep

ncuillery avatar Oct 26 '17 14:10 ncuillery

+1 @oblador anything we can to to help get this merged quicker?

i8wu avatar Nov 08 '17 20:11 i8wu

+1

RossKinsella avatar Jan 11 '18 22:01 RossKinsella

@ncuillery I forked the repo and put your PR into it and I seem to be getting a flash of white at the end of the close animation for android now. Any ideas? Please see gif attached.

https://cl.ly/0E2k3f410x0n

RossKinsella avatar Jan 12 '18 13:01 RossKinsella

+1

jacklj avatar Jan 17 '18 10:01 jacklj

+1

verzil avatar Jan 18 '18 21:01 verzil

@RossKinsella I didn't really see a white flash on your gif. I guess the bitrate of your recording is too slow. But I'm pretty sure it's the Fresco splash screen.

Fresco (the lib used by RN to handle images on Android) displays the white rectangle while your image is loaded.

Maybe you change your image source when the lightbox is opened/closed (for replacing a small thumbnail by a full-res image for example) ? If so, you should leave the image untouched and use the renderContent props instead.

ncuillery avatar Jan 18 '18 22:01 ncuillery

@ncuillery - I can confirm @RossKinsella's issue. I'm using a standard implementation, no new render in the lightbox. You don't see it when you try?

jhalborg avatar Jan 31 '18 14:01 jhalborg

+1

venkatmithun avatar Sep 21 '18 09:09 venkatmithun

I am also facing jumpy effect on close of image @RossKinsella i can share video for this as well.

waheedakhtar694 avatar Nov 29 '18 15:11 waheedakhtar694

The white flash seems to be due to a short time gap between the lightbox overlay's image hiding and the original image appearing. I did a dirty fix by running an animation in parallel to increase the lightbox's image's opacity to 1 alongside the lightbox overlay's image shrinking.

Anyone with a better alternative is greatly appreciated.

nevaehph avatar Dec 06 '18 05:12 nevaehph