Activity动画效果笔记
生活随笔
收集整理的這篇文章主要介紹了
Activity动画效果笔记
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
---恢復內(nèi)容開始---
(一)使用overridePendingTransition方法實現(xiàn)Activity跳轉動畫
startActivity(intent);overridePendingTransition(R.anim.slide_in_left, R.anim.slide_in_left);這個函數(shù)有兩個參數(shù),一個參數(shù)是第一個activity進入時的動畫,另外一個參數(shù)則是第二個activity退出時的動畫。
translate 位移
scale 縮放
translate 透明度
rotate 旋轉
?android:fillAfter="true" android:fillBefore="false" android:fillEnabled="true"
運動完保持當前位子.不是回到原來位子.
<style name="AppTheme.SearchTheme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowEnterAnimation">@anim/system_open_enter</item>
<item name="android:windowExitAnimation">@anim/alpha_no</item>
</style>
system_open_enter.XML <set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:zAdjustment="top">
<alpha android:duration="300" android:fillAfter="true" android:fillBefore="false" android:fillEnabled="true"
android:fromAlpha="0.0" android:interpolator="@anim/decelerate_cubic" android:toAlpha="1.0"/>
<scale android:duration="300" android:fillAfter="true" android:fillBefore="false" android:fillEnabled="true"
android:fromXScale=".8" android:fromYScale=".8" android:interpolator="@anim/decelerate_cubic"
android:pivotX="50%p" android:pivotY="50%p"
android:toXScale="1.0" android:toYScale="1.0"/>
</set>
alpha_no.XML <set xmlns:android="http://schemas.android.com/apk/res/android" >
<alpha
android:duration="300"
android:fromAlpha="1.0"
android:toAlpha="1.0" />
</set> overridePendingTransition(R.anim.search_in, R.anim.anim_no);
search_in.XML <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
<scale android:duration="@android:integer/config_mediumAnimTime"
android:fromXScale="1.0" android:fromYScale="0.9"
android:interpolator="@android:interpolator/decelerate_quint"
android:pivotX="50%" android:pivotY="100%"
android:toXScale="1.0" android:toYScale="1.0"/>
<alpha android:duration="@android:integer/config_mediumAnimTime"
android:fromAlpha="0.6" android:interpolator="@android:interpolator/decelerate_cubic"
android:toAlpha="1.0"/>
</set>
anim_no.XML
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<alpha
android:duration="0"
android:fillAfter="true"
android:fromAlpha="1.0"
android:toAlpha="1.0" />
</set> ?
---恢復內(nèi)容結束---
轉載于:https://www.cnblogs.com/Android-FJH/p/6004475.html
總結
以上是生活随笔為你收集整理的Activity动画效果笔记的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 20161023 NOIP 模拟赛 T1
- 下一篇: //系统版本号