2

I am trying to give simple animation effect to dialog. Here I set animation theme to dialog for how it enters and how it exits. This code works properly on unlocked device but on locked device when that dialog comes and I clicked on cancel button, dialog disappear and locked screen is displayed but when i try to unlock screen immediately after clicking button then I see the dialog exits with that animation effect. But this effects goes to background and I want to show that animation effect on locked screen. The same code works on tablet but when i tried to do it on mobile it gives me this abnormal behavior.

this is zoom_out_exit.xml file.



    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android"
        android:interpolator="@android:anim/decelerate_interpolator"
        android:zAdjustment="top" >

        <translate
            android:duration="5000"
            android:fromYDelta="0%p"
            android:toYDelta="50%p" />

    </set>


this is style.xml file

 <style name="AnimationTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
    <item name="android:windowAnimationStyle">@style/DialogAnimation</item>
</style>

<style name="DialogAnimation" >
    <item name="android:windowEnterAnimation">@anim/zoom_in_enter</item>
    <item name="android:windowExitAnimation">@anim/zoom_out_exit</item>
</style>

and this theme of animationtheme is set to dialog.




     class MyDialog extends Dialog { 
        MyDialog(Context context) {
    super(context, R.style.AnimationTheme);
        }
    }

can anybody solve my problem ? thanks in advance.
Dreamwalker
  • 3,032
  • 4
  • 30
  • 60
manishak
  • 21
  • 4

0 Answers0