Rather than using transitions to return to the original state of the activity (because you can't trivially reverse a transition), it instead sets the state to be not in list mode and calls Activity.recreate() to restart it in the previous state.
It can be a little slow and looks odd but does the job. It also is more prone to issues if there were to be more state to maintain.