I am creating a new launcher for myself. Now, when I launch applications from my main activity, she has this default animation, which makes my panel launch and a new application pops up on top of it. Instead, I want to attach my own animation. It is preferable that the default material tangency animation is displayed.
Things I've tried so far:
You need to use Theme.AppCompat theme (or descendant) with this action on Android
http://tips.androidhive.info/2015/09/android-how-to-apply-material-design-theme/
<style name="swLaunch" parent="swLaunch.Base"> <item name="android:windowContentTransitions">true</item> <item name="android:windowAllowEnterTransitionOverlap">true</item> <item name="android:windowAllowReturnTransitionOverlap">true</item> <item name="android:windowSharedElementEnterTransition">@android:transition/explode</item> <item name="android:windowSharedElementExitTransition">@android:transition/explode</item> <item name="android:windowEnterAnimation">@android:transition/explode</item> <item name="android:windowExitAnimation">@android:transition/explode</item> <item name="android:taskToFrontEnterAnimation">@android:transition/explode</item> <item name="android:taskToBackEnterAnimation">@android:transition/explode</item> <item name="android:taskToFrontExitAnimation">@android:transition/explode</item> <item name="android:taskToBackExitAnimation">@android:transition/explode</item> <item name="android:inAnimation">@android:transition/explode</item> <item name="android:layoutAnimation">@android:transition/explode</item> <item name="android:windowShowAnimation">@android:transition/explode</item> <item name="android:activityOpenEnterAnimation">@android:transition/explode</item> <item name="android:fragmentOpenEnterAnimation">@android:transition/explode</item> </style>
this is how i run my applications:
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.google.android.gm"); if (launchIntent != null) { startActivity(launchIntent); }
source share