I have set Enter/Exit animation style for PopupWindow
like this
mPopupWindow.setAnimationStyle(R.style.PopupAnimation);
and style as
<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
show/hide it has animations which works fine with Lollipop
and all previous android versions. But with Marshmallow
the popup shows up after the animation time interval and no animation effects.
anim/popup-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>
anim/popup-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>