Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Animations and Transitions Animations Basics Introducing ObjectAnimator

Victor Cuc
Victor Cuc
7,281 Points

Found a bug - If you click fast on the album art multiple times the panels disappear

Ben Jakuben Ben Deitch - found a bug. How could we fix this?

I think this is because of the .getBottom() method, as it returns the bottom value. And if the panel doesn't finish its animation and extend fully, the bottom value is smaller. Am I right?

int titleStartValue = titlePanel.getTop();
        int titleEndValue = titlePanel.getBottom();
        ObjectAnimator.ofInt(titlePanel, "bottom", titleStartValue, titleEndValue).start();

        int trackStartValue = trackPanel.getTop();
        int trackEndValue = trackPanel.getBottom();
        ObjectAnimator.ofInt(trackPanel, "bottom", trackStartValue, trackEndValue).start();

Here is a screen recording:

https://photos.app.goo.gl/Vwkwo3cbGIAb8R1p2