View animation while ListView is not working without scrolling

I am trying to make sure that the Google+ application for Android has a view that is at the bottom of the screen, and when the user scrolls the ListView that is behind it. UP View displays down, the screen is off. When the user scrolls the ListView down, even a little, View enlivens the backup on the screen.

I installed a GestureDetector that gives me callbacks for a scroll event in my ListView, and callbacks are constant when I view, so I know this part works.

In my callback, I am trying to use ViewPropertyAnimator to animate my y value as such:

 headerView.animate().yBy(distanceY).start(); 

Nothing happens until I stop scrolling. Is there a way to throw this ListView scroll animation in the UI thread? I feel it is waiting.

+4
source share
1 answer

I also fought this. The trick I used was to replace

 headerView.animate().yBy(distanceY).start(); 

with

 headerView.setTranslationY(floatValue); 

Hope this helps!

+1
source

All Articles