There seems to be no clean way to do this.
The only viable option I found is to write 4 different xml animations (for 4 corners, more if you want to allow centering), all ScaleAnimations from 0 to 1, with different pivots for each (4 corners )
Then use DialogFragment :
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { final Dialog dialog = super.onCreateDialog(savedInstanceState); dialog.getWindow().getAttributes().windowAnimations = R.style.downRightCornerAnimation;
And one example of such an animation:
<?xml version="1.0" encoding="utf-8"?> <scale xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator" android:fromXScale="0.0" android:toXScale="1.0" android:fromYScale="0.0" android:toYScale="1.0" android:fillAfter="false" android:duration="200" android:pivotX = "0%" android:pivotY = "100%"/>
This is very cumbersome and hacked, but I donโt think the SDK gives us the best tool for this (AFAIK you cannot just enter a dynamic ObjectAnimator in DialogFragment or PopupWindow )
source share