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

Leonardo Fettucciari
Leonardo Fettucciari
158 Points

Animations and transitions Android

Hi, I'm facing this simple task on Animations and Transitions but it looks like I can't figure out how to proceed.

This is what I've been asked to do:

"Next, use the methods to animate the scale of a view to double the image's width and height. Remember that this is a fluent interface, meaning you can chain methods one after another."

This is what I've tried:

// Use the variable named 'imageView' int x = imageView.getScaleX(); int y = imageView.getScaleY(); imageView.animate().scaleX(x*2).scaleY(y*2).start();

But I get compile errors.

What's the deal?

Jarvis Chandler
Jarvis Chandler
7,619 Points

Hi I was curious is to see if you have figured this code out?

Jarvis Chandler
Jarvis Chandler
7,619 Points

Found your answer took sometime but here it is.

imageView.animate().scaleX(2).scaleY(2).start();