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

General Discussion

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Forum Contest: Android Animations

EDIT: This contest has ended! Congratulations to Liam Peters for the winning entry! Our next contest on creating a Compass extension is up!

Hey Android developers! I'm excited to bring you another Android Forum Contest!

This week's challenge is fun: use any kind of animation to cycle through a small set of quotes:

After you've watched the video, please read the details below carefully. We're looking forward to your entries!

Contests Rules:

This contest is pretty open ended. The main objective is to loop through the set of quotes (download quotes as a string array), animating each onto the screen. Your animations can be simple and elegant, fun and creative, or over the top and crazy. It's totally up to you! Create your app as a native app; i.e. the app must be installable on Android devices (web apps are not permitted).

Help:

Here is a Forum post with a few examples of some simple animations: Android Animations. For more help, check out the developer documentation (with sample code).

How to Enter:

Post a link as an answer to this post. It can be a link to downloadable project files or a GitHub repo. If you want to submit a link to an app on Google Play (you're encouraged to publish your entries!), then also provide a link to the source code. Source code is required for this contest.

Due Date:

All entries must be submitted by August 3rd at 11:59pm ET. Here's a timezone chart so you can see what time that is for your locale.

Prize:

The entries will be judged by Treehouse teachers based on both design and code. One winner will receive a free month of Treehouse Pro (formerly called "Gold") on us! We'll announce the winner on August 4th and reveal the next contest.

19 Answers

J T
J T
10,091 Points

Only 1 month?

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Yes, that's our standard prize for Forum contests.

Hi Ratik Sharma, I gather that we can use any version of android. He mentioned the rules above already. There are no constraints on the Android version you use,

Nicholas Olsen
seal-mask
.a{fill-rule:evenodd;}techdegree
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 Points

"Collaboration is more important than competition"—I love that!

This contest is not in my area of expertise but I would love to collaborate on a contest project with someone in the future! :D

Ben Jakuben
Ben Jakuben
Treehouse Teacher

It's such a great way to learn and produce. Hopefully we can offer more structured tools for collaboration in the future.

Joannie Huang
Joannie Huang
6,195 Points

It sounds very interesting contest! I will try it!

Shane Desouza
Shane Desouza
3,523 Points

Sounds like a good contest! I think I might try it!

                         Anyone want to collaborate? Would be great!
Shane Desouza
Shane Desouza
3,523 Points

Same! I would be interested in a collaboration!

I take it the use of third part libraries is a no-no? Specifically Android View Animations, which is a pretty nifty library!

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Anything that makes your job easier counts positively to your rating. :) I am a huge proponent of using open source and 3rd party libraries whenever it helps. I plan on covering more here by the end of the year.

The goal with a 3rd party library should be to use them well, not just as a grab bag of tools. Good luck!

First thrown together attempt (YouTube Video). In the spirits of collaboration, any thoughts? I'll obviously polish it a bit before submitting source etc. It's a bit similar to the example video at the minute I think!

Ben Jakuben
Ben Jakuben
Treehouse Teacher

That is so fantastic. I love these contests because it's so inspiring to see what everyone comes up with.

Rachit Agarwal
Rachit Agarwal
6,235 Points

Awesometacular! That's actually really cool, especially with the color transitions and smooth animations. Is it on GitHub?

any collabs please email me: corextechnologies@gmail.com, would be nice to work some of you guys and possibly become friends! Thanks to TreeHouse. Due dates coming.

Shane Desouza
Shane Desouza
3,523 Points

Anyone want to collaborate on this project? Email me: shanedesouza657@gmail.com. Thanks!

Ratik Sharma
Ratik Sharma
32,885 Points

Hi! Quick question for the people participating: is there a way one can infinitely loop through the quotes? I'm currently using a button to switch the text and I want to avoid it. Any help is appreciated!

I Guess you'd use a timer. Timers in Java (and subsequently Android) have a method called "scheduleAtFixedRate"

class MyTimerTask extends TimerTask
{
     public void run()
     {
          //Here you would increment a counter.
          //Then check that your counter isn't larger than
          //the number of quotes. If it is, reset it to 0
          //Then change your quote based on what value
          //your counter holds!
     }
}

TimerTask task = new MyTimerTask();
timer.scheduleAtFixedRate(task, delay, period);

Without obviously doing it for you (as this is a competition :P) this should set you off in a workable direction! Google the method name if you need help using it!

Edit: Also, please bear in mind that the times above are in milliseconds! (1000 milliseconds is 1 second)!

Ratik Sharma
Ratik Sharma
32,885 Points

Liam Peters, thanks! That's actually more than what I needed :p

Here's my entry. Github Repo. It's not the finest thing I've ever done. Runs as intended on the android L preview (I only did styles for v21). It will compile for older versions if you change the build.gradle file). Not had a great deal of time to add much polish.

Good luck everyone! Remember, it's not the winning that matters. It's about getting the creative and problem solving juices flowing!

Hi , here's my entry ForumChallengeApp

Good luck to all!

Ratik Sharma
Ratik Sharma
32,885 Points

Here's my entry: entry! I could have done so much more if I had time but I'm fairly proud of what I'm submitting. Cheers!

Note: The project contains a DreamService so anyone trying the app should give it a go!

Kurt Kandora
Kurt Kandora
5,312 Points

I did something, all the animation in a random mode, sometimes looks good, depends on luck... github I don't like very much how it looks, but was a nice thing to try. Good luck to all!

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Wow, this was really tough! As usual, I am so impressed by your work. Thanks for participating!

After a bit of debate, I've decided to crown Liam Peters as our champion this week. Congratulations, Liam! :crown::sparkles::thumbsup: Liam's submission (video has a really sharp, simple design with animations that focus on key words in each quote. It's delightful! His code is really solid, too. Some highlights:

  • Elegant and simple Material design example
  • Themed ActionBar, which is encouraged for Material Design
  • Animation used for emphasis
  • Neat info dialog about the current fragment. It's a good practice to extend DialogFragment like he did,
  • Great color transition on swipes instead of a simple instant change
  • Good use of SpannableStringBuilder to emphasize key words
  • Good use of the powerful AndroidViewAnimations library

One negative is that you must swipe through the quotes, whereas the objective of the contest was to automatically loop through them. Simple enough to change. :)

I also want to commend Ratik Sharma as a really close runner up. Ratik's code is superb and his design was solid. Ratik won the previous contest, but I didn't want that to count against him! Because it was so close, I am going to follow-up with our community manager about getting you some sort of consolation prize, Ratik. :)

Some highlights of Ratik's submission:

  • Great use of Daydream and immersive modes
  • Has a settings Settings screen with custom slide in and out transitions. It also extends PreferencesActivity, which is a good practice.
  • Uses onPause() and onResume() to manage the lifecycle
  • Another good use of the powerful AndroidViewAnimations library
  • It does currently have a bug: I get an ArrayOutOfBoundsException at this line: mQuotesTextView.setText(quotes[counter]);. Easily fixable!
  • Good color choice in the design

I'd highly recommend checking out the code of all these submissions to see some good practices and examples. Thanks again for participating, and stay tuned for this week's contest, which should be announced shortly!

This is quite a shock. I personally thought Ratik Sharma's was better than mine. Especially loved the use of immersion mode and daydream. Would love to see this cycle through my twitter feed or something! Look forward to the next Android forum contest!! :)

Great job Liam, Ratik and everyone who participated. Unfortuntaley I could'nt participate because of health issues. Great seeing the creativity you guys put into this! Can't wait for the next one!

Ratik Sharma
Ratik Sharma
32,885 Points

Haha, I actually thought Liam Peters would win and he did! Congrats, mate! And thanks, Ben Jakuben for the mention! I seriously appreciate it!

See you in the contest, guys!