zoukankan      html  css  js  c++  java
  • 隐藏当前Activity而不关闭

    startActivity后调用

    overridePendingTransition(R.anim.zoomin, R.anim.zoomout);

    可以实现Activity跳转的动画效果

    打开activity的特效

    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android"
        android:interpolator="@android:anim/decelerate_interpolator">
        <scale
            android:duration="300"
            android:fromXScale="0.1"
            android:fromYScale="0.1"
            android:pivotX="50%p"
            android:pivotY="50%p"
            android:toXScale="1.0"
            android:toYScale="1.0" />
        <!-- 这里为了看到动画演示效果,把动画持续时间设为3秒 -->
        <alpha
            android:duration="300"
            android:fromAlpha="0.1"
            android:toAlpha="1.0" />
    </set>

    关闭activity的特效

    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android"
        android:interpolator="@android:anim/decelerate_interpolator"
        android:zAdjustment="top">
        <scale
            android:duration="300"
            android:fromXScale="1.0"
            android:fromYScale="1.0"
            android:pivotX="50%p"
            android:pivotY="50%p"
            android:toXScale=".5"
            android:toYScale=".5" />
        <!-- 系统内置的动画持续时间
        android:duration="@android:integer/config_mediumAnimTime"
        -->
        <alpha
            android:duration="300"
            android:fromAlpha="1.0"
            android:toAlpha="0" />
    </set>

    最关键的是配置

    android:launchMode="singleInstance"

    将Activity隐藏

    moveTaskToBack(true);
  • 相关阅读:
    Codeforces 985G. Team Players
    关于Hall定理的学习
    bzoj 4561: [JLoi2016]圆的异或并
    UOJ #188. 【UR #13】Sanrd
    LOJ #6053. 简单的函数
    Codeforces F. Cowmpany Cowmpensation
    POJ 3710:Matrix Power Series
    codeforces533E
    luogu2885
    codeforces722E
  • 原文地址:https://www.cnblogs.com/anni-qianqian/p/7273820.html
Copyright © 2011-2022 走看看