Activity Transitions

Introduction

Storyteller supports android shared element transitions for opening Story or Clip and closing Story pager. Closing pager will sync Story or Clip list view with last viewed Story or Clip on pager. While opening Story works out of the box, properly handling return transitions would require simple modification in the hosting activity. This chapter will explain why its that and how to integrate these changes into your code.

Changes in hosting activity

Changes in hosting activity are minimal. Hosting activity is required to call one Activity extension function activityReentered()

import com.storyteller.Storyteller.Companion.activityReentered
//~~~
//~~~
class MyActivity: Activity(){
    ///~~
    //~~~
    override fun onActivityReenter(resultCode: Int, data: Intent?) {
      super.onActivityReenter(resultCode, data)
      activityReentered()
    }
}

This method will inform all hosted Storyteller views to check if they are returning and provide information about reenter tile view that will be used as a destination of the return animation.

Note If this onActivityReenter method is not called, Story list views will still sync their position however shared transition will not animate towards the tile.

PREVIOUS
Forward Arrow