I have to slide in an AlertDialog
when it enters and slide it out when it is dismissed,
but it is not animating.
So how do I get the animation to work ?
Here is what I have,
public class SlideDialogFragment extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new AlertDialog.Builder(new ContextThemeWrapper(getActivity(),R.style.SlidingDialog))
.setTitle("Sliding dialog")
.create()
}
themes.xml
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="SlidingDialog" parent="@android:style/Theme.DeviceDefault.Dialog">
<item name="android:windowAnimationStyle">@style/SlidingDialogAnimation</item>
</style>
<style name="SlidingDialogAnimation">
<item name="android:windowEnterAnimation">@android:anim/slide_in_left</item>
<item name="android:windowExitAnimation">@android:anim/slide_out_right</item>
</style>
</resources>
I have referred too many resources and there doesn't seem to be a single proper way to do this that works for me, may be I am missing something
I am using
- Android ICS
- App is built for API 15+
Here are some related resources that I couldn't get the answer from