Android 12闪屏中徽标图标的 Flink 效果

1tuwyuhd  于 2023-03-16  发布在  Android
关注(0)|答案(1)|浏览(197)

无论何时启动我的应用程序,都应该播放一个颜色变化动画,之后还需要通过平移动画将启动画面从屏幕上删除,但就在启动画面平移动画之前,徽标 Flink ,如gif中所示

安卓清单.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="prateek_gupta.physical_device_tester">

    <application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/SplashScreen"
        tools:targetApi="31">
        <activity
            android:name=".MainActivity"
            android:theme="@style/SplashScreen"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

启动画面.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="SplashScreen" parent="Theme.SplashScreen">
        <item name="windowSplashScreenBackground">#ff9900</item>
        <item name="windowSplashScreenAnimatedIcon">@drawable/splash_screen_logo_animation</item>
        <item name="windowSplashScreenAnimationDuration">2000</item>
        <item name="postSplashScreenTheme">@style/Theme.PhysicalDeviceTester</item>
    </style>
</resources>

启动画面徽标动画.xml

<animated-vector
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:aapt="http://schemas.android.com/aapt">
    <aapt:attr name="android:drawable">
        <vector
            android:name="vector"
            android:width="322dp"
            android:height="156dp"
            android:viewportWidth="322"
            android:viewportHeight="156">
            <group
                android:name="group"
                android:pivotX="161"
                android:pivotY="78"
                android:scaleX="0.8"
                android:scaleY="0.4">
                <path
                    android:name="path"
                    android:pathData="M 166 35 C 166 62.8 166.2 67 167.5 67 C 168.8 67 169 62.8 169 35 C 169 7.2 168.8 3 167.5 3 C 166.2 3 166 7.2 166 35 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_1"
                    android:pathData="M 221.2 22.6 C 218.7 27.6 217.7 32 219 32 C 220.6 32 225.4 21 224.2 19.8 C 223.5 19.1 222.6 20 221.2 22.6 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_2"
                    android:pathData="M 113 22 C 113 25.1 116.8 32 118.5 32 C 119.8 32 119.9 31.6 118.6 28.7 C 114.7 19.8 113 17.8 113 22 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_3"
                    android:pathData="M 195.7 22.1 C 195 24.6 191 40.3 188.4 51 C 186.9 56.8 184.6 65.9 183.2 71.2 C 180.4 81.9 180.7 81.7 172.8 80.4 C 169.4 79.8 169.1 79.4 168.8 76.2 C 168.4 71 166 70.8 166 75.9 C 166 79.2 165.7 80 164.1 80 C 163.1 80 160.9 80.3 159.2 80.6 C 156.3 81.2 156.2 81.1 154.6 75.7 C 153.7 72.7 153 69.4 153 68.3 C 153 67.3 151.3 60 149.1 52 C 147 44 144.4 34 143.5 29.7 C 142.4 24.5 141.4 22 140.4 22 C 138.4 22 138.6 22.9 142.5 36.9 C 144.4 43.8 146 50.3 146 51.4 C 146.1 52.6 147.8 59.6 149.9 67 L 153.8 80.5 L 151 81.7 C 149.5 82.4 147.2 83.2 145.9 83.5 C 143.3 84.2 142.8 83.3 131.8 58.5 C 123.8 40.7 122 37 121 37 C 119.2 37 119.9 39.3 124.6 49.5 C 128.7 58.4 131.8 65.4 138.8 81.2 C 141.1 86.3 141 86.5 135.4 89.3 C 132.4 90.8 132.2 90.8 130.1 88.6 C 129 87.4 128 86 128 85.4 C 128 84.9 126.8 83.1 125.4 81.5 C 122.8 78.5 114.5 66.6 112.4 62.9 C 111.8 61.8 110.4 59.9 109.3 58.7 C 108.3 57.5 105.7 53.9 103.6 50.7 C 99.9 45.2 99 44.4 97.7 45.6 C 97.2 46.1 99.4 49.6 108.5 62.2 C 110.2 64.4 112.1 67.5 112.9 68.9 C 113.7 70.3 114.9 71.9 115.5 72.5 C 116.7 73.5 126.2 87 128.8 91.4 C 129.9 93.3 129.7 93.8 127 96.2 C 125.3 97.8 123.6 99 123.1 99 C 122.7 99 120.6 97.3 118.4 95.2 C 116.3 93.2 110.7 88.1 106.1 84 C 95.3 74.3 94 73.1 89.9 69.5 C 88 67.8 82 62.4 76.5 57.5 C 62.9 45.4 63.3 45.7 62.6 46.9 C 62.2 47.4 70.4 55.4 80.7 64.6 C 102.3 83.8 105.7 86.9 111.5 92.7 C 113.8 95.1 116.2 97 116.7 97 C 118.2 97 121 100.4 121 102.3 C 121 104.1 116.9 110.9 115.7 111 C 115.2 111 113.4 109.9 111.7 108.6 C 109.9 107.3 107.5 105.9 106.3 105.5 C 105 105.2 104 104.4 104 103.9 C 104 103.4 103.3 103 102.5 103 C 99.6 103 101.1 104.8 107.5 109.1 C 113.7 113.4 113.9 113.6 113.3 117 C 112.4 122.6 111.7 122.7 103.2 119.6 C 99 118.1 93.3 116.1 90.5 115.3 C 87.8 114.4 80.6 112.1 74.5 110 C 48.2 101.1 48 101 48 103.5 C 48 104.4 48.9 105 50.3 105 C 51.5 105 57.2 106.8 63 109 C 68.8 111.2 74.1 113 74.8 113 C 75.6 113 81.2 114.7 87.3 116.9 C 93.5 119 101.2 121.6 104.5 122.7 L 110.5 124.7 L 110.2 130.5 C 110.1 133.8 109.8 136.6 109.5 136.8 C 109.3 137 104 136.5 97.8 135.7 C 91.6 134.9 86.2 134.4 85.8 134.7 C 84.2 135.6 86.2 137 89.2 137 C 90.9 137 96.3 137.5 101.1 138.2 L 110 139.4 L 110 145.7 L 110 152 L 69.1 152 C 42.8 152 27.9 152.4 27.5 153 C 27.1 153.7 72.8 154 164 154 C 255.2 154 300.9 153.7 300.5 153 C 300.1 152.4 286.2 152 261.9 152 L 224 152 L 224 145.5 C 224 141.9 224.3 139.1 224.8 139.2 C 225.2 139.3 231.2 138.8 238.3 138 C 247.7 137 251 136.3 251 135.3 C 251 134.3 250.1 134.1 247.8 134.5 C 235.5 136.6 224.8 137.6 224.5 136.6 C 224.3 136 223.9 133.2 223.7 130.5 L 223.2 125.5 L 230.8 123.1 C 235 121.8 243.5 119 249.6 116.9 C 255.7 114.7 261.3 113 262.1 113 C 262.9 113 268.2 111.2 274 109 C 279.8 106.8 285.5 105 286.7 105 C 289.2 105 290.6 103.5 288.9 102.4 C 287.8 101.7 280.1 103.9 264 109.7 C 258.8 111.5 252.3 113.6 249.5 114.4 C 246.8 115.1 240.7 117.1 236 118.7 C 222.2 123.6 222.5 123.6 221.2 119.1 C 219.7 114.3 219.7 114 221.3 114 C 223.2 114 236.1 105 235.5 104.1 C 234.9 103.1 230.3 105.3 223.8 109.8 C 218.5 113.5 218 113.6 218 111.4 C 218 110.5 217 108.4 215.8 106.8 L 213.7 103.7 L 220.8 97.1 C 224.8 93.5 230.5 88.2 233.6 85.5 C 248.1 72.7 249.7 71 246.9 71 C 245.9 71 235.4 79.9 226.9 88 C 222.8 91.8 216.3 97.7 214.3 99.4 C 212.1 101.3 212 101.2 208.9 98.2 L 205.8 95.2 L 210.4 88.2 C 213 84.4 215.7 80.7 216.5 80 C 217.3 79.3 218 78.3 218 77.8 C 218 76.9 221.8 71.5 230.6 59.5 C 232.4 57.2 234.3 54.2 235 52.9 C 235.7 51.6 237.1 49.5 238.2 48.4 C 239.7 46.7 239.8 46 238.9 45.4 C 238.1 45 237.1 45.4 236.3 46.6 C 235.5 47.6 233.5 50.5 231.7 52.9 C 229.9 55.3 227.9 58.5 227.1 59.9 C 226.3 61.3 224.2 64.3 222.3 66.4 C 220.5 68.6 219 70.9 219 71.6 C 219 72.3 218.7 73 218.3 73.2 C 217.1 73.7 211 81.7 211 82.7 C 211 83.2 209.2 85.7 207.1 88.2 C 203.7 92.4 203.1 92.8 201.9 91.4 C 201.2 90.5 199.6 89.4 198.3 88.9 C 195.5 87.9 195.4 85.5 197.8 81.5 C 198.8 79.8 200.6 76 201.7 73 C 202.9 70 205.2 64.7 206.9 61.3 C 208.6 57.9 210 54.8 210 54.4 C 210 54 211.6 50.4 213.5 46.4 C 217.1 38.9 217.6 37 216.1 37 C 214.9 37 212.2 41.2 211.4 44.5 C 211 46 209 50.7 207 54.9 C 204.9 59.1 202.9 63.6 202.5 65 C 202.1 66.3 200.2 70.4 198.4 74 C 196.6 77.6 194.8 81.8 194.5 83.3 C 194.1 84.8 193.7 86 193.5 86 C 193.4 86 191.2 85.1 188.6 84 L 184 81.9 L 184.6 77.7 C 184.9 75.4 187.1 66.1 189.5 57 C 197 28 198.2 22.8 197.1 21.7 C 196.4 21 195.9 21.1 195.7 22.1 Z M 179 83.9 C 195.5 88.8 204.3 94.9 212.6 107.2 C 218.8 116.5 220.1 121.6 220.7 138.3 L 221.2 152 L 166.5 152 L 111.7 152 L 112.2 139.8 C 112.8 127.1 113.9 122.6 118.8 112 C 121.3 106.5 124.9 102 130.4 97.1 C 132 95.7 134.7 93.2 136.4 91.7 C 138.1 90.2 140.6 88.6 142 88.3 C 143.4 87.9 146.4 86.8 148.8 85.8 C 157.9 81.7 169.3 81 179 83.9 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_4"
                    android:pathData="M 50 36.3 C 50 37.5 58.2 45 59.4 45 C 61 45 59.5 42.4 55.9 38.9 C 51.7 34.8 50 34.1 50 36.3 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_5"
                    android:pathData="M 267 51.8 C 265.6 53.3 261.7 57 258.2 60 C 252 65.5 250.9 67 253.3 67 C 255.1 67 272.3 50.6 271.4 49.7 C 270.3 48.6 269.7 48.9 267 51.8 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_6"
                    android:pathData="M 74 87 C 74 87.5 74.4 88 74.9 88 C 75.4 88 77.1 89.1 78.7 90.4 C 84 94.9 97.9 102.9 98.6 101.9 C 98.9 101.3 99 100.7 98.9 100.6 C 98.7 100.4 95.8 98.5 92.6 96.4 C 77 86.1 74 84.6 74 87 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_7"
                    android:pathData="M 256.9 88.4 C 255 89.5 250.7 92.3 247.3 94.5 C 244 96.7 240.4 99 239.4 99.6 C 238 100.5 237.8 101.1 238.6 101.9 C 239.3 102.7 240.6 102.3 243.1 100.4 C 244.9 99 247.4 97.4 248.5 96.9 C 252.2 95.3 262.9 87.2 262.3 86.6 C 261.4 85.8 261 85.9 256.9 88.4 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_8"
                    android:pathData="M 3.5 124.9 C 2.7 126.3 6.1 127.6 13.3 128.4 C 17.9 128.9 19 128.7 19 127.6 C 19 126.6 17.4 125.9 14.3 125.5 C 11.6 125.2 8.3 124.6 6.8 124.4 C 5.4 124.1 3.9 124.4 3.5 124.9 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_9"
                    android:pathData="M 299.5 128.2 C 290.7 129.2 277.3 130.8 269.7 131.7 C 256.6 133.3 254.2 133.9 255.4 135.8 C 255.7 136.3 266.6 135.1 279.7 133.3 C 292.8 131.5 307.2 129.6 311.8 129.2 C 316.3 128.8 320.1 128 320.1 127.5 C 320.1 126 316.9 126.1 299.5 128.2 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_10"
                    android:pathData="M 23 127.7 C 23 128.2 35.3 130.3 50.3 132.4 C 84.2 137 81.5 136.8 81.5 135 C 81.5 133.5 71.7 131.9 43.5 129 C 37.5 128.4 30.4 127.6 27.8 127.3 C 25 127 23 127.1 23 127.7 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
            </group>
        </vector>
    </aapt:attr>
    <target android:name="path">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#cc0000"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_1">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#cc0000"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_2">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#cc0000"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_3">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#cc0000"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_4">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#cc0000"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_5">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#cc0000"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_6">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#cc0000"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_7">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#cc0000"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_8">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#cc0000"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_9">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#cc0000"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_10">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#cc0000"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
</animated-vector>

主要活动.java

package prateek_gupta.physical_device_tester;

import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.splashscreen.SplashScreen;
import androidx.core.splashscreen.SplashScreenViewProvider;

import prateek_gupta.physical_device_tester.databinding.ActivityMain2Binding;

public class MainActivity extends AppCompatActivity {

    ActivityMain2Binding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
        splashScreen.setOnExitAnimationListener(new SplashScreen.OnExitAnimationListener() {
            @Override
            public void onSplashScreenExit(@NonNull SplashScreenViewProvider splashScreenViewProvider) {
                TranslateAnimation rightTranslateAnimation=new TranslateAnimation(Animation.RELATIVE_TO_PARENT,0f,Animation.RELATIVE_TO_PARENT,-1f,Animation.RELATIVE_TO_PARENT,0,Animation.RELATIVE_TO_PARENT,0f);
                splashScreenViewProvider.getIconAnimationDurationMillis();
                rightTranslateAnimation.setDuration(1000);
                //rightTranslateAnimation.setFillAfter(true);
                rightTranslateAnimation.setAnimationListener(new Animation.AnimationListener() {
                    @Override
                    public void onAnimationStart(Animation animation) {

                    }

                    @Override
                    public void onAnimationEnd(Animation animation) {
                        splashScreenViewProvider.remove();
                    }

                    @Override
                    public void onAnimationRepeat(Animation animation) {

                    }
                });
                splashScreenViewProvider.getView().startAnimation(rightTranslateAnimation);

            }
        });
        super.onCreate(savedInstanceState);
        binding=ActivityMain2Binding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
}}

所以我的问题是我怎样才能避免标志的 Flink ?

2hh7jdfx

2hh7jdfx1#

Flink 效果的原因是当徽标动画结束并且启动画面的退出动画开始时,启动画面视图刷新。
因此,为了避免这种 Flink 效果,改变徽标动画,使徽标与背景融合(或者我们可以说徽标淡出)。
已更新闪屏徽标动画.xml

<animated-vector
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:aapt="http://schemas.android.com/aapt">
    <aapt:attr name="android:drawable">
        <vector
            android:name="vector"
            android:width="322dp"
            android:height="156dp"
            android:viewportWidth="322"
            android:viewportHeight="156">
            <group
                android:name="group"
                android:pivotX="161"
                android:pivotY="78"
                android:scaleX="0.8"
                android:scaleY="0.4">
                <path
                    android:name="path"
                    android:pathData="M 166 35 C 166 62.8 166.2 67 167.5 67 C 168.8 67 169 62.8 169 35 C 169 7.2 168.8 3 167.5 3 C 166.2 3 166 7.2 166 35 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_1"
                    android:pathData="M 221.2 22.6 C 218.7 27.6 217.7 32 219 32 C 220.6 32 225.4 21 224.2 19.8 C 223.5 19.1 222.6 20 221.2 22.6 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_2"
                    android:pathData="M 113 22 C 113 25.1 116.8 32 118.5 32 C 119.8 32 119.9 31.6 118.6 28.7 C 114.7 19.8 113 17.8 113 22 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_3"
                    android:pathData="M 195.7 22.1 C 195 24.6 191 40.3 188.4 51 C 186.9 56.8 184.6 65.9 183.2 71.2 C 180.4 81.9 180.7 81.7 172.8 80.4 C 169.4 79.8 169.1 79.4 168.8 76.2 C 168.4 71 166 70.8 166 75.9 C 166 79.2 165.7 80 164.1 80 C 163.1 80 160.9 80.3 159.2 80.6 C 156.3 81.2 156.2 81.1 154.6 75.7 C 153.7 72.7 153 69.4 153 68.3 C 153 67.3 151.3 60 149.1 52 C 147 44 144.4 34 143.5 29.7 C 142.4 24.5 141.4 22 140.4 22 C 138.4 22 138.6 22.9 142.5 36.9 C 144.4 43.8 146 50.3 146 51.4 C 146.1 52.6 147.8 59.6 149.9 67 L 153.8 80.5 L 151 81.7 C 149.5 82.4 147.2 83.2 145.9 83.5 C 143.3 84.2 142.8 83.3 131.8 58.5 C 123.8 40.7 122 37 121 37 C 119.2 37 119.9 39.3 124.6 49.5 C 128.7 58.4 131.8 65.4 138.8 81.2 C 141.1 86.3 141 86.5 135.4 89.3 C 132.4 90.8 132.2 90.8 130.1 88.6 C 129 87.4 128 86 128 85.4 C 128 84.9 126.8 83.1 125.4 81.5 C 122.8 78.5 114.5 66.6 112.4 62.9 C 111.8 61.8 110.4 59.9 109.3 58.7 C 108.3 57.5 105.7 53.9 103.6 50.7 C 99.9 45.2 99 44.4 97.7 45.6 C 97.2 46.1 99.4 49.6 108.5 62.2 C 110.2 64.4 112.1 67.5 112.9 68.9 C 113.7 70.3 114.9 71.9 115.5 72.5 C 116.7 73.5 126.2 87 128.8 91.4 C 129.9 93.3 129.7 93.8 127 96.2 C 125.3 97.8 123.6 99 123.1 99 C 122.7 99 120.6 97.3 118.4 95.2 C 116.3 93.2 110.7 88.1 106.1 84 C 95.3 74.3 94 73.1 89.9 69.5 C 88 67.8 82 62.4 76.5 57.5 C 62.9 45.4 63.3 45.7 62.6 46.9 C 62.2 47.4 70.4 55.4 80.7 64.6 C 102.3 83.8 105.7 86.9 111.5 92.7 C 113.8 95.1 116.2 97 116.7 97 C 118.2 97 121 100.4 121 102.3 C 121 104.1 116.9 110.9 115.7 111 C 115.2 111 113.4 109.9 111.7 108.6 C 109.9 107.3 107.5 105.9 106.3 105.5 C 105 105.2 104 104.4 104 103.9 C 104 103.4 103.3 103 102.5 103 C 99.6 103 101.1 104.8 107.5 109.1 C 113.7 113.4 113.9 113.6 113.3 117 C 112.4 122.6 111.7 122.7 103.2 119.6 C 99 118.1 93.3 116.1 90.5 115.3 C 87.8 114.4 80.6 112.1 74.5 110 C 48.2 101.1 48 101 48 103.5 C 48 104.4 48.9 105 50.3 105 C 51.5 105 57.2 106.8 63 109 C 68.8 111.2 74.1 113 74.8 113 C 75.6 113 81.2 114.7 87.3 116.9 C 93.5 119 101.2 121.6 104.5 122.7 L 110.5 124.7 L 110.2 130.5 C 110.1 133.8 109.8 136.6 109.5 136.8 C 109.3 137 104 136.5 97.8 135.7 C 91.6 134.9 86.2 134.4 85.8 134.7 C 84.2 135.6 86.2 137 89.2 137 C 90.9 137 96.3 137.5 101.1 138.2 L 110 139.4 L 110 145.7 L 110 152 L 69.1 152 C 42.8 152 27.9 152.4 27.5 153 C 27.1 153.7 72.8 154 164 154 C 255.2 154 300.9 153.7 300.5 153 C 300.1 152.4 286.2 152 261.9 152 L 224 152 L 224 145.5 C 224 141.9 224.3 139.1 224.8 139.2 C 225.2 139.3 231.2 138.8 238.3 138 C 247.7 137 251 136.3 251 135.3 C 251 134.3 250.1 134.1 247.8 134.5 C 235.5 136.6 224.8 137.6 224.5 136.6 C 224.3 136 223.9 133.2 223.7 130.5 L 223.2 125.5 L 230.8 123.1 C 235 121.8 243.5 119 249.6 116.9 C 255.7 114.7 261.3 113 262.1 113 C 262.9 113 268.2 111.2 274 109 C 279.8 106.8 285.5 105 286.7 105 C 289.2 105 290.6 103.5 288.9 102.4 C 287.8 101.7 280.1 103.9 264 109.7 C 258.8 111.5 252.3 113.6 249.5 114.4 C 246.8 115.1 240.7 117.1 236 118.7 C 222.2 123.6 222.5 123.6 221.2 119.1 C 219.7 114.3 219.7 114 221.3 114 C 223.2 114 236.1 105 235.5 104.1 C 234.9 103.1 230.3 105.3 223.8 109.8 C 218.5 113.5 218 113.6 218 111.4 C 218 110.5 217 108.4 215.8 106.8 L 213.7 103.7 L 220.8 97.1 C 224.8 93.5 230.5 88.2 233.6 85.5 C 248.1 72.7 249.7 71 246.9 71 C 245.9 71 235.4 79.9 226.9 88 C 222.8 91.8 216.3 97.7 214.3 99.4 C 212.1 101.3 212 101.2 208.9 98.2 L 205.8 95.2 L 210.4 88.2 C 213 84.4 215.7 80.7 216.5 80 C 217.3 79.3 218 78.3 218 77.8 C 218 76.9 221.8 71.5 230.6 59.5 C 232.4 57.2 234.3 54.2 235 52.9 C 235.7 51.6 237.1 49.5 238.2 48.4 C 239.7 46.7 239.8 46 238.9 45.4 C 238.1 45 237.1 45.4 236.3 46.6 C 235.5 47.6 233.5 50.5 231.7 52.9 C 229.9 55.3 227.9 58.5 227.1 59.9 C 226.3 61.3 224.2 64.3 222.3 66.4 C 220.5 68.6 219 70.9 219 71.6 C 219 72.3 218.7 73 218.3 73.2 C 217.1 73.7 211 81.7 211 82.7 C 211 83.2 209.2 85.7 207.1 88.2 C 203.7 92.4 203.1 92.8 201.9 91.4 C 201.2 90.5 199.6 89.4 198.3 88.9 C 195.5 87.9 195.4 85.5 197.8 81.5 C 198.8 79.8 200.6 76 201.7 73 C 202.9 70 205.2 64.7 206.9 61.3 C 208.6 57.9 210 54.8 210 54.4 C 210 54 211.6 50.4 213.5 46.4 C 217.1 38.9 217.6 37 216.1 37 C 214.9 37 212.2 41.2 211.4 44.5 C 211 46 209 50.7 207 54.9 C 204.9 59.1 202.9 63.6 202.5 65 C 202.1 66.3 200.2 70.4 198.4 74 C 196.6 77.6 194.8 81.8 194.5 83.3 C 194.1 84.8 193.7 86 193.5 86 C 193.4 86 191.2 85.1 188.6 84 L 184 81.9 L 184.6 77.7 C 184.9 75.4 187.1 66.1 189.5 57 C 197 28 198.2 22.8 197.1 21.7 C 196.4 21 195.9 21.1 195.7 22.1 Z M 179 83.9 C 195.5 88.8 204.3 94.9 212.6 107.2 C 218.8 116.5 220.1 121.6 220.7 138.3 L 221.2 152 L 166.5 152 L 111.7 152 L 112.2 139.8 C 112.8 127.1 113.9 122.6 118.8 112 C 121.3 106.5 124.9 102 130.4 97.1 C 132 95.7 134.7 93.2 136.4 91.7 C 138.1 90.2 140.6 88.6 142 88.3 C 143.4 87.9 146.4 86.8 148.8 85.8 C 157.9 81.7 169.3 81 179 83.9 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_4"
                    android:pathData="M 50 36.3 C 50 37.5 58.2 45 59.4 45 C 61 45 59.5 42.4 55.9 38.9 C 51.7 34.8 50 34.1 50 36.3 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_5"
                    android:pathData="M 267 51.8 C 265.6 53.3 261.7 57 258.2 60 C 252 65.5 250.9 67 253.3 67 C 255.1 67 272.3 50.6 271.4 49.7 C 270.3 48.6 269.7 48.9 267 51.8 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_6"
                    android:pathData="M 74 87 C 74 87.5 74.4 88 74.9 88 C 75.4 88 77.1 89.1 78.7 90.4 C 84 94.9 97.9 102.9 98.6 101.9 C 98.9 101.3 99 100.7 98.9 100.6 C 98.7 100.4 95.8 98.5 92.6 96.4 C 77 86.1 74 84.6 74 87 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_7"
                    android:pathData="M 256.9 88.4 C 255 89.5 250.7 92.3 247.3 94.5 C 244 96.7 240.4 99 239.4 99.6 C 238 100.5 237.8 101.1 238.6 101.9 C 239.3 102.7 240.6 102.3 243.1 100.4 C 244.9 99 247.4 97.4 248.5 96.9 C 252.2 95.3 262.9 87.2 262.3 86.6 C 261.4 85.8 261 85.9 256.9 88.4 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_8"
                    android:pathData="M 3.5 124.9 C 2.7 126.3 6.1 127.6 13.3 128.4 C 17.9 128.9 19 128.7 19 127.6 C 19 126.6 17.4 125.9 14.3 125.5 C 11.6 125.2 8.3 124.6 6.8 124.4 C 5.4 124.1 3.9 124.4 3.5 124.9 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_9"
                    android:pathData="M 299.5 128.2 C 290.7 129.2 277.3 130.8 269.7 131.7 C 256.6 133.3 254.2 133.9 255.4 135.8 C 255.7 136.3 266.6 135.1 279.7 133.3 C 292.8 131.5 307.2 129.6 311.8 129.2 C 316.3 128.8 320.1 128 320.1 127.5 C 320.1 126 316.9 126.1 299.5 128.2 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
                <path
                    android:name="path_10"
                    android:pathData="M 23 127.7 C 23 128.2 35.3 130.3 50.3 132.4 C 84.2 137 81.5 136.8 81.5 135 C 81.5 133.5 71.7 131.9 43.5 129 C 37.5 128.4 30.4 127.6 27.8 127.3 C 25 127 23 127.1 23 127.7 Z"
                    android:fillColor="#cc0000"
                    android:strokeColor="#00000000"/>
            </group>
        </vector>
    </aapt:attr>
    <target android:name="path">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#ff9900"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_1">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#ff9900"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_2">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#ff9900"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_3">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#ff9900"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_4">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#ff9900"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_5">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#ff9900"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_6">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#ff9900"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_7">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#ff9900"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_8">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#ff9900"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_9">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#ff9900"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
    <target android:name="path_10">
        <aapt:attr name="android:animation">
            <set>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:duration="1000"
                    android:valueFrom="#cc0000"
                    android:valueTo="#3700b3"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
                <objectAnimator
                    android:propertyName="fillColor"
                    android:startOffset="1000"
                    android:duration="1000"
                    android:valueFrom="#3700b3"
                    android:valueTo="#ff9900"
                    android:valueType="colorType"
                    android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
            </set>
        </aapt:attr>
    </target>
</animated-vector>

相关问题