Simple Property Animation

Now that you have the scene set up, it is time to make it do your bidding by moving parts of it around. You are going to animate the sun down below the horizon.

But before you start animating, you will want a few bits of information handy in your fragment. Inside of onCreateView(…), pull out a couple of views into fields on SunsetFragment.

Listing 30.6  Pulling out view references (SunsetFragment.java)

p​u​b​l​i​c​ ​c​l​a​s​s​ ​S​u​n​s​e​t​F​r​a​g​m​e​n​t​ ​e​x​t​e​n​d​s​ ​F​r​a​g​m​e​n​t​ ​{​

 ​ ​ ​ ​p​r​i​v​a​t​e​ ​V​i​e​w​ ​m​S​c​e​n​e​V​i​e​w​;​
 ​ ​ ​ ​p​r​i​v​a​t​e​ ​V​i​e​w​ ​m​S​u​n​V​i​e​w​;​
 ​ ​ ​ ​p​r​i​v​a​t​e​ ​V​i​e​w​ ​m​S​k​y​V​i​e​w​;​ ​ ​ ​ ​p​u​b​l​i​c​ ​s​t​a​t​i​c​ ​S​u​n​s​e​t​F​r​a​g​m​e​n​t​ ...

Get Android Programming: The Big Nerd Ranch Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.