How to use shared element snapshot views during an Activity transition?

I am confused about the List<View> sharedElementSnapshots argument that is passed to the SharedElementCallback‘s onSharedElementStart() and onSharedElementEnd() methods. Presumably these snapshot views are meant to be used as temporary placeholders during a shared element transition. For example, let’s say activity A displayed a thumbnail image and activity B displays a high-resolution version of that same image that will take a couple seconds to load and be displayed. Instead of having to wait for the high-resolution image to finish loading, the snapshot view could be temporarily used in its place instead.

The part I’m confused me about is how the snapshot views are meant to be used in the first place. Are they supposed to be added to the activity’s view hierarchy? Or maybe they are meant to be added to the window decor view’s ViewOverlay instead? Either way, I don’t see how it is possible to switch the transitioning shared element views at this point… onMapSharedElements() is called before onSharedElementStart() and onSharedElementEnd(), meaning the final mapping of transition names to shared element Views will have already been established.

  • particle effects?
  • Build Android job with connectedInstrumentTest not working on Jenkins
  • How to change color of the back arrow in the new material theme?
  • Extending RelativeLayout, and overriding dispatchDraw() to create a zoomable ViewGroup
  • Activity with fragments does not resize when the keyboard opens
  • Internet Connectivity check in Android
  • Any hints would be greatly appreciated.

    Related posts:

    Counting Chars in EditText Changed Listener
    changing screen brightness programmatically in android
    Visual studio android emulator will not start fully
    Android Themes: Define colors/gradients in &ldquo;baseTheme.xml&rdquo;, use within controls,...
    Latest Apache HttpClient in Android SDK
    Read the response body in an Android Spring Interceptor
    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.