How to create activity transition animations on Android Lollipop

Android KitKat introduced the transition framework, which is a very convenient set of APIs for animating between different UI states in an application. The framework is built around scenes and transitions. A scene refers to a given UI state in an application (think of a scene like a ViewGroup, so the entire layout of an Activity can be a Scene, and also there can be multiple Scenes in a single Activity), while a transition is the animated change from one scene to another. Lollipop has taken transitions to a whole new level.