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 Choreograph an Animation

Strange Learning
STAFF
Strange Learning
Treehouse Guest Teacher

Why is there a compiler error?

Triple checked my code and can't find any issues. Also, I believe there must be a bug. Even after I click reset code (in case I was doing something incorrectly) and immediately recheck work after that, I still get a compiler error. Anyone having the same problems?

CodeChallenge.java
ObjectAnimator fadeInAnimator = ObjectAnimator.ofFloat(button, View.ALPHA, 0, 1);
fadeInAnimator.setDuration(1000);

ObjectAnimator moveUpAnimator = ObjectAnimator.ofInt(button, "top", buttonTop, 16);
moveUpAnimator.setDuration(1000);

ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(button, "scaleX", 1.0f, 1.5f);
scaleXAnimator.setDuration(300);

ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(button, "scaleY", 1.0f, 1.5f);
scaleYAnimator.setDuration(300);

// Add code below!
AnimatorSet fadeAndMove = new AnimatorSet();
fadeAndMove.playTogether(fadeInAnimator, moveUpAnimator);

AnimatorSet scaleXandY = new AnimatorSet();
scaleXandY.playTogether(scaleXAnimator, scaleYAnimator);

AnimatorSet fadeAndMoveThenScaleXandY = new AnimatorSet();
fadeAndMoveThenScaleXandY.playSequentially(fadeAndMove, scaleXandY);
fadeAndMoveThenScaleXandY.start();

3 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Sorry about that - I was missing the file that allowed you to see compiler errors. I added that and used your code to troubleshoot and found an error in how I was checking parameters in my tests. This code now passes!

Strange Learning
STAFF
Strange Learning
Treehouse Guest Teacher

Awesome! Thanks for looking into that Ben! Another great lesson by the way. I think this is the best one yet! Looking forward to seeing many, many more. I know this one just came out, but can you shed any light on what's coming in the future?

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Thanks! As I mentioned in the post - we created this with a ton of help from Linton Ye . I'm so glad to finally have it in the library. It's been in the works for a long time!

Check out our public roadmap for upcoming content. It's also available at the bottom of the Android section of the library.

But if you don't want to click, here's a list of what's in the works:

Courses:

  • Testing in Android
  • Introduction to Kotlin
  • Intents and Background Services

Workshops:

  • Retrofit
  • RxJava
  • Using the Camera in Android
  • Compare Code: Kotlin vs Java
Strange Learning
STAFF
Strange Learning
Treehouse Guest Teacher

You're the man Ben. Truly. What a fantastic service you guys provide. Thanks a lot and looking forward to everything! You can never learn too much, especially in Android! Cheers man!