I want to implement a transition between the fragments (exit and enter). First of all I tried the following:

```
f.setEnterTransition(new Slide(Gravity.RIGHT));
f.setExitTransition(new Slide(Gravity.LEFT));

```

This is working perfectly on API > 21 but the app crashes on API < 21.
Then I tried the answer in [this](https://stackoverflow.com/a/33992609/4956266) post.

But the problem is that when the fragment is exiting it does not animate. The first fragment is directly gone and the second fragment animates into the screen.

The approach I need is the same as the first solution above. On enter animate the fragment from right to left. On exit push the first fragment to the left and animate the second.