android 页面的切换
startActivity后加:
IntentHelper.jump(mContext, MyBalanceActivity.class);
activity.overridePendingTransition(R.anim.pull_in_right, R.anim.pull_out_left);
进去页面后:finish()后加:
overridePendingTransition(R.anim.pull_in_left, R.anim.pull_out_right);
R.anim.pull_in_right//同样在anim文件下面新建一个pull_in_left.xml文件
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/animTime"
android:fromXScale="0%"
android:fromYScale="100%"
android:pivotX="100%"
android:pivotY="100%"
android:toXScale="100%"
android:toYScale="100%"/>
R.anim.pull_out_left
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:duration="@integer/animTime"
android:fromXScale="100%"
android:fromYScale="100%"
android:pivotX="0%"
android:pivotY="0%"
android:toXScale="0%"
android:toYScale="100%"/>
<alpha
android:duration="@integer/animTime"
android:fromAlpha="1"
android:toAlpha="0.2"
>
</alpha>
</set>
R.anim.pull_in_left
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/animTime"
android:fromXScale="0%"
android:fromYScale="100%"
android:pivotX="0%"
android:pivotY="0%"
android:toXScale="100%"
android:toYScale="100%"/>
R.anim.pull_out_right
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:duration="@integer/animTime"
android:fromXScale="100%"
android:fromYScale="100%"
android:pivotX="100%"
android:pivotY="100%"
android:toXScale="0%"
android:toYScale="100%"/>
<alpha
android:duration="@integer/animTime"
android:fromAlpha="1"
android:toAlpha="0.2"
>
</alpha>
</set>
@integer/animTime为400
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步