I set the Enter / Exit animation style for PopupWindow as follows
mPopupWindow.setAnimationStyle(R.style.PopupAnimation);
and style like
<style name="PopupAnimation" parent="Widget.AppCompat.PopupWindow"> <item name="android:windowEnterAnimation">@anim/popup_show</item> <item name="android:windowExitAnimation">@anim/popup_hide</item> </style>
So when PopupWindow shows / hides, it has an animation that works great with Lollipop and all previous versions of Android. But with Marshmallow popup window appears after the animation time interval and without animation effects.
anit / pop-ups show.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:interpolator="@android:anim/accelerate_interpolator" android:duration="1000"/> </set>
anit / popup windows hide.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:fromAlpha="1.0" android:toAlpha="0" android:interpolator="@android:anim/accelerate_interpolator" android:duration="1000"/> </set>
source share