Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scene Transition Flicker

I have a simple view containing a scene root FrameLayout, ListView and a couple of buttons on the bottom.

scene root is used to load and show different scenes, the size changes dynamically depending on the current scene. ListView is set to match_parent in both directions and is positioned behind scene root.

Here's the issue:

If I start a transition using the buttons on the bottom everything works ok, no problem, magic. However, if I transition (✝) to a different scene while scrolling (✝✝) the transition seems to flicker before starting.

It almost looks like the rendering engine fails to load the first frame of the animation before the ListView invalidates the hierarchy due to scrolling.

Thanks for the help ;)

TransitionManager.go(Scene, Transition)

✝✝ I've added a couple of methods to the ListView to allow that

like image 771
LambergaR Avatar asked Apr 28 '15 12:04

LambergaR


1 Answers

All the Google apps that use Scene Transition that I've seen transit from some item in a ListView to its detail Activity. Since ListView has the convenient behavior of immediately stop the scrolling when touched, such a transition doesn't produce flickering.

So it appears the best thing to do may be to programmatically stop the scrolling before transiting to the new Activity, which is accomplished by the code here.

like image 111
Kai Avatar answered Oct 21 '22 20:10

Kai