I have three activities whose launch modes are single instance.
Using onfling()
, I swing them left and right.
The problem is when I swipe right to
If you want to apply the animation on "activity" start. then write below code.
startActivity(intent);
overridePendingTransition(R.anim.opening_anim, R.anim.closing_anim);
If you want to apply the animation on "dialog" then firstly add below code in
styles.xml
file
Use this style as I defined below.
final Dialog dialog = new Dialog(activity);
dialog.getWindow().getAttributes().windowAnimations = R.style.my_style;
If you want to apply the animation on "view" then write below code
txtMessage = (TextView) findViewById(R.id.txtMessage);
// load the animation
Animation animFadein = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.animation);
// start the animation
txtMessage.startAnimation(animFadein);
Below, I have mentioned most of the animation
.xml
code.
===========================================
==========================================
==========================================
==========================================
==========================================
==========================================
==========================================
==========================================
==========================================
==========================================
==========================================
==========================================
==========================================
==========================================
==========================================
========================================
========================================
========================================
========================================
========================================
========================================
========================================
========================================
========================================