我正在尝试将AlertDialog
动画解散实施到Button
中的Activity
。
我找到了如何使用AlertDialog
资源实现Animation
动画。
(http://android-er.blogspot.kr/2012/07/dialog-animation-using-windowanimations.html)
但是我不知道如何在下面的照片中点击按钮。
感谢您的建议。
答案 0 :(得分:0)
set animation to dialog and also code in xml.
yourdialog.getWindow().getAttributes().windowAnimations = R.style.DAnimation;
put these in style.xml
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="DialogAnimation">
<item name="android:windowEnterAnimation">@android:anim/slide_in_left</item>
<item name="android:windowExitAnimation">@anim/slide_out_left</item>
</style>
<style name="DAnimation">
<item name="android:windowEnterAnimation">@anim/slide_in</item>
<item name="android:windowExitAnimation">@anim/slide_up</item>
</style>
<style name="saveanim">
<item name="android:windowEnterAnimation">@anim/slide_down</item>
<item name="android:windowExitAnimation">@anim/slide_top</item>
</style>
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>