2

I've been trying to follow this answer for adding an animation to a dialog box. However I'm getting an error on the first style addition.

I've added the following to res/values/styles.xml (not completely sure if this is correct)

<style name="DialogAnimation">
    <item name="android:windowEnterAnimation">@anim/slide_down_dialog.xml</item>
    <item name="android:windowExitAnimation">@anim/slide_out_up</item>
</style>

The first item, android:windowEnterAnimation, does not seem to exist when I tab complete android:. This also applies to android:windowExitAnimation. The error I receive in the XML file is:

error: Error: No resource found that matches the given name (at 'android:windowEnterAnimation' with value '@anim/slide_down_dialog.xml').

All the questions I've found regarding animation like this uses windowEnter/ExitAnimation. I looked at the android docs and it supposedly has this attribute, but I cannot for the life of me get it to appear.

Thanks in advance for any help/advice. If this is a duplicate please point me in the right direction, I couldn't find any related questions.

Community
  • 1
  • 1
RoraΖ
  • 634
  • 9
  • 21

2 Answers2

2

you sholud put @ letter before android and remove the .xml like:

<item name="@android:windowEnterAnimation">@anim/slide_down_dialog</item>
Rene
  • 4,033
  • 2
  • 24
  • 29
sulu.dev
  • 1,159
  • 1
  • 11
  • 16
1

I think it is: remove (.xml) to be like (@anim/slide_down_dialog)

msh1521962
  • 21
  • 3