14.01.2013 Views

Android™ Application Development - Bahar Ali Khan

Android™ Application Development - Bahar Ali Khan

Android™ Application Development - Bahar Ali Khan

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.6. Create slide_left_out.xml.<br />

Chapter 11: Advanced Android <strong>Development</strong><br />

<br />

<br />

<br />

3.7. Create slide_right_in.xml.<br />

<br />

<br />

<br />

3.8. Create slide_right_out.xml.<br />

<br />

<br />

<br />

4. Return to the ContentSlider Activity and get references to the TextView and each of the animations<br />

you created in Step 3.<br />

Animation slideInLeft;<br />

Animation slideOutLeft;<br />

Animation slideInRight;<br />

Animation slideOutRight;<br />

Animation slideInTop;<br />

Animation slideOutTop;<br />

Animation slideInBottom;<br />

Animation slideOutBottom;<br />

TextView myTextView;<br />

@Override<br />

public void onCreate(Bundle icicle) {<br />

super.onCreate(icicle);<br />

setContentView(R.layout.main);<br />

slideInLeft = AnimationUtils.loadAnimation(this, R.anim.slide_left_in);<br />

slideOutLeft = AnimationUtils.loadAnimation(this, R.anim.slide_left_out);<br />

slideInRight = AnimationUtils.loadAnimation(this, R.anim.slide_right_in);<br />

slideOutRight = AnimationUtils.loadAnimation(this, R.anim.slide_right_out);<br />

slideInTop = AnimationUtils.loadAnimation(this, R.anim.slide_top_in);<br />

slideOutTop = AnimationUtils.loadAnimation(this, R.anim.slide_top_out);<br />

367

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!