Animation For Textview in Android
i have wrote code animation for textview.
where we can textview animation ex: flash news or new message received there we can use it. etc...
source code
private class LocalFadeInAnimationListener implements AnimationListener {
public void onAnimationEnd(Animation animation) {
launchOutAnimation();
}
public void onAnimationRepeat(Animation animation){
}
public void onAnimationStart(Animation animation) {
}
};
/**
* Animation listener for fade-in
*
* @author VIJAYAKUMAR
*
*/
private class LocalFadeOutAnimationListener implements AnimationListener {
public void onAnimationEnd(Animation animation) {
launchInAnimation();
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationStart(Animation animation) {
}
};
anim xml code
fadein.xml
<?xml version="1.0" encoding="utf-8"?>
<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="0.1"
android:toAlpha="1.0"
android:duration="1000"
>
</alpha>
fadeout.xml
<?xml version="1.0" encoding="utf-8"?>
<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="1.0"
android:toAlpha="0.1"
android:duration="1000"
>
</alpha>
i have wrote code animation for textview.
where we can textview animation ex: flash news or new message received there we can use it. etc...
source code
private class LocalFadeInAnimationListener implements AnimationListener {
public void onAnimationEnd(Animation animation) {
launchOutAnimation();
}
public void onAnimationRepeat(Animation animation){
}
public void onAnimationStart(Animation animation) {
}
};
/**
* Animation listener for fade-in
*
* @author VIJAYAKUMAR
*
*/
private class LocalFadeOutAnimationListener implements AnimationListener {
public void onAnimationEnd(Animation animation) {
launchInAnimation();
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationStart(Animation animation) {
}
};
anim xml code
fadein.xml
<?xml version="1.0" encoding="utf-8"?>
<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="0.1"
android:toAlpha="1.0"
android:duration="1000"
>
</alpha>
fadeout.xml
<?xml version="1.0" encoding="utf-8"?>
<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="1.0"
android:toAlpha="0.1"
android:duration="1000"
>
</alpha>