I want to replicate the transitions as explained in Material design by Google. This is the link for the preview, but basically the videos I care about are those two:
Step 1:Consider that you are moving from one activity to other.So define onclick method for button
button= (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(), Animation.class);
startActivity(intent, options.toBundle());
startActivity(intent);
overridePendingTransition (R.anim.right_slide_in, R.anim.right_slide_out);
}
});
Step 2:Now define the animation that you need for the second activity while launching
anim.right_slide_in