Mohammad Tazehkar Mohammad Tazehkar - 3 months ago 35
Android Question

Option Menu Animation

How can i give a slide down animation like this :

<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="1000"
android:fromYDelta="0"
android:toYDelta="100%" />
</set>


for " Option Menu " Opening .like this animation :

enter image description here

Answer

just add this line into your style.xml please add this on your Application main Style that you define in manifest

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:popupAnimationStyle">@style/Animation</item>
</style>

style.xml :

<style name="Animation">
<item name="android:windowEnterAnimation">@anim/your_specific_animation</item>
<item name="android:windowExitAnimation">@anim/your_specific_animation</item>
</style>

enter image description here

Comments