Learn Android App Development by Wallace Jackson

Learn Android App Development by Wallace Jackson

Author:Wallace Jackson [Jackson, Wallace]
Language: eng
Format: epub, pdf
Tags: Computers, Programming, Hardware, Games, Mobile Devices
ISBN: 9781430257462
Publisher: Apress
Published: 2013-05-06T04:00:00+00:00


Figure 10-6. Configuring <scale> tag’s scaling definition parameters for the anim_scale_virus.xml file in Eclipse

Adding Java Code for the Scaling

Now it’s time to implement the scale Animation object in our AttackPlanet Java code. Add a line of space under the infectButton ImageButton object declaration and copy the two lines of code above it, Animation rotateBomb and bombButton.startAnimation( ) and paste them into that space.

Next change the Animation name to scaleVirus and set the infectButton startAnimation( ) method to call this scaleVirus Animation object, using the following two lines of Java code:

Animation scaleVirus = AnimationUtils.loadAnimation(this, R.anim.anim_scale_virus);

infectButton.startAnimation(scaleVirus);

This Java code implementing the scaleVirus is shown in Figure 10-7.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.