Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Animations and Transitions Animations Basics Property Animation

michael lee
michael lee
5,179 Points

challenge 1 of 3

I was thinking maybe I oversimplified this challenge, but what an I missing?

CodeChallenge.java
// Use the variable named 'imageView'
 public void animate();

1 Answer

Tonnie Fanadez
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Tonnie Fanadez
UX Design Techdegree Graduate 22,795 Points

Hi Lee

animate() method is the easiest form of animation for views. It allows us to configure the animation using method chaining called straight from the a view Object.

See the code solution for this challenge below; Since you are not creating a new method you don't need the return type(void).

Simply call animate() from the imageView.

scaleX() is the width while scaleY() is the height. To double the height and the width you just put a 2. Don't forget to call start() method so that the animation can go live.

Cheers

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