I've been learning about material transitions, following this guide. I have a little test app where I'm trying this out.
My activity code looks like this:
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.transition.Slide;
import android.view.View;
public class TransitionsHome extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_transitions_home);
}
public void slide(View view){
//Create a slide object, then set it as the exit transition
Slide slide = new Slide();
slide.setDuration(1000);
getWindow().setExitTransition(slide);
startActivity(new Intent(this, SlideActivity.class));
}
I have a button that calls slide()
when it's pressed.
The problem is, it's changing to the proper activity, but it isn't animating at all. Why doesn't this work?