Narfss / ParallaxEverywhere

Parallax everywhere is a library with alternative android widgets with parallax effects.
MIT License
714 stars 96 forks source link

Parallax effect undoes/jumps when moving between fragments #2

Open lostcart opened 9 years ago

lostcart commented 9 years ago

If I use in a fragment and then switch to a new fragment, as the old fragment containing a PEWImageView animates out, the image jumps a little bit.

Narfss commented 9 years ago

I'm using fragment inside a viewpager and dont see any jump. ¿Can you give us more information? Thanks

lostcart commented 9 years ago

I'm using a drawer layout with a container to hold hold the fragment which I then use fragment transactions to replace with new content when options are selected from the drawer menu. When I switch between sections the PEWImageView content jumps when the new fragment is animating in. Hope that made sense!

Narfss commented 9 years ago

Now the parallax effects updates on two events: OnScrollChangedListener() and OnGlobalLayoutListener()

Probably this events happens after you replace the fragment. I need to check a posible solution, trying to move de image before the replacement, or try a smooth move of the image. But I need time.

lostcart commented 9 years ago

Any luck with this? Or is there something I can tweak to stop it from happening?

Narfss commented 9 years ago

Luck?, only since api 16.

Please, check the experimental attribute "update_onDraw" in the new version 'com.fmsirvent:parallaxeverywhere:1.0.3'.

I hope that this will be useful. ParallaxEveryWhere was created for scroll events. But the "drawer" show/hide hasn't this event.

Sorry.

lostcart commented 9 years ago

I'm not expecting the parallax effect to happen when the drawer comes in and out, is that what you thought I was after?

Narfss commented 9 years ago

Sorry, I was thinking in other issue.

How ever, I have just upload again the library with a little change onMeasure. Can you check if this solve the issue?

About a "tweak", If this don't works. Have you try to customize the transition of the fragment replacement? Until we found the solution a fade will hide the jump.

lostcart commented 9 years ago

Just tried out the latest version, seems to be behaving the same.
I'm currently using a custom transition to do a slide out of the old fragment, and a slide in for the new one.