Im added shared element transition to launch Activity B from activity A. Normally shared element transition is working, but its not working, if app launch through deep link and showing Activity A view.
Activity B launch mode : SingleTask
Im added shared element transition to launch Activity B from activity A. Normally shared element transition is working, but its not working, if app launch through deep link and showing Activity A view.
Activity B launch mode : SingleTask
First Solution One way to solve this is launch No UI Activity(RouterActivity) from deeplink and form this activity you can try launch with animation. Inside Router Activity set theme in onCreate.
getTheme().applyStyle(R.style.NO_UI, true);
In style
<style name="Theme.NO_UI" parent="AppTheme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
And launch screen with animation from onCreate().
Second Solution Define animation in style: Define a new animation style in your styles.xml, as follows
<style name="MyTheme.Window" parent="@android:style/Animation.Activity">
<item name="android:activityOpenEnterAnimation">@anim/your_desired_animation</item>
Then set this style in a theme (themes.xml) as follows :
<style name="MyTheme" parent="@android:style/Theme">
<item name="android:windowAnimationStyle">@style/MyTheme.Window</item>
</style>
And then you can simply set these themes to every activity in your AndroidManifest.xml as follows:
<activity
android:name="your_activity"
android:theme="@style/MyTheme">
</activity>