Skip to content Skip to sidebar Skip to footer

Android: Can I Use Different Class For Different Child Of Viewflipper

I have different screen to work in an android application. I'm using ViewFlipper for this. I decided to used different class for different view children public main extends Activi

Solution 1:

U can perfrom animation using Intent to:

Step1: create anim folder under res directory in ur project.

Step2: create an slideleft.xml file

Step3: type the following code in that file

<?xml version="1.0" encoding="utf-8"?><setxmlns:android="http://schemas.android.com/apk/res/android"android:interpolator="@android:anim/accelerate_interpolator"><translateandroid:fromXDelta="100%p"android:toXDelta="0"android:duration="400" /></set>

step 4: similarly create slideright.xml

step5: use the above code, but change the following

<translateandroid:fromXDelta="-100%p"android:toXDelta="0"android:duration="400" />

step 6:

 target.startAnimation(AnimationUtils.loadAnimation(HomeScreen.this, R.anim.slide_left));

perfroming fadein operation, just add the following code in fadein.xml file

<?xml version="1.0" encoding="utf-8"?><alphaxmlns:android="http://schemas.android.com/apk/res/android"android:interpolator="@android:anim/accelerate_interpolator"android:fromAlpha="0.0"android:toAlpha="1.0"android:duration="300" />

similarly for fade out too

<?xml version="1.0" encoding="UTF-8"?><alphaxmlns:android="http://schemas.android.com/apk/res/android"android:interpolator="@android:anim/accelerate_interpolator"android:fromAlpha="1.0"android:toAlpha="0.0"android:duration="300" />

Post a Comment for "Android: Can I Use Different Class For Different Child Of Viewflipper"