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 32.6 Pulling out view references (SunsetFragment.java
)
public class SunsetFragment extends Fragment { private View mSceneView; private View mSunView; private View mSkyView; public static SunsetFragment newInstance() { return new SunsetFragment(); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ...
Get Android Programming: The Big Nerd Ranch Guide, Third 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.