zoukankan      html  css  js  c++  java
  • 仿微信Activity跳转

    res/anim下建立四个文件

    文件1:slide_left_in.xml

    <?xml version="1.0" encoding="utf-8"?>
    <set
      xmlns:android="http://schemas.android.com/apk/res/android">
        <translate android:duration="300" android:fromXDelta="-100.0%p" android:toXDelta="0.0" />
    </set>

    文件2:slide_left_out.xml

    <?xml version="1.0" encoding="utf-8"?>
    <set
      xmlns:android="http://schemas.android.com/apk/res/android">
        <translate android:duration="300" android:fromXDelta="0.0" android:toXDelta="-100.0%p" />
    </set>

    文件3:slide_right_in.xml

    <?xml version="1.0" encoding="utf-8"?>
    <set
      xmlns:android="http://schemas.android.com/apk/res/android">
        <translate android:duration="300" android:fromXDelta="100.0%p" android:toXDelta="0.0" />
    </set>

    文件4:slide_right_out.xml

    <?xml version="1.0" encoding="utf-8"?>
    <set
      xmlns:android="http://schemas.android.com/apk/res/android">
        <translate android:duration="300" android:fromXDelta="0.0" android:toXDelta="100.0%p" />
    </set>

    自己调速度即可!!!!

    重写res/values/styles.xml文件下的AppTheme,改为:

        <style name="AppTheme" parent="@android:style/Theme">     
            <!-- 设置activity切换动画 -->
            <item name="android:windowAnimationStyle">@style/activityAnimation</item>
        </style>
        
        <!-- animation 样式 -->
        <style name="activityAnimation" parent="@android:style/Animation">
            <item name="android:activityOpenEnterAnimation">@anim/slide_right_in</item>
            <item name="android:activityOpenExitAnimation">@anim/slide_left_out</item>
            <item name="android:activityCloseEnterAnimation">@anim/slide_left_in</item>
            <item name="android:activityCloseExitAnimation">@anim/slide_right_out</item>
        </style>

    修改AndroidManifest.xml文件application标签下的

    android:theme="@style/AppTheme"
  • 相关阅读:
    [luogu4799 CEOI2015 Day2] 世界冰球锦标赛(折半搜索)
    [luogu3230 HNOI2013] 比赛 (搜索+Hash)
    [luogu2317 HNOI2005] 星际贸易 (dp)
    [luogu2414 NOI2011]阿狸的打字机 (AC自动机)
    [bzoj3507 Cqoi2014]通配符匹配 (hash+DP)
    [luogu2054 AHOI2005] 洗牌 (数论)
    bzoj1491 [NOI2007]社交网络
    bzoj1022 [SHOI2008]小约翰的游戏John
    bzoj1088 [SCOI2005]扫雷Mine
    bzoj1295 [SCOI2009]最长距离
  • 原文地址:https://www.cnblogs.com/jinglingJuly/p/3071355.html
Copyright © 2011-2022 走看看