在 XML 中定义插值器

Defining interpolator in XML

<?xml version="1.0" encoding="utf-8"?>
<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:width="140dp" android:height="140dp"
            android:viewportWidth="24.0" android:viewportHeight="24.0">
            <group android:name="ringer" android:pivotX="12" android:pivotY="10.5">
                <path
                    android:fillColor="#d3d3d3"
                    android:pathData="M7.58,4.08L6.15,2.65C3.75,4.48 2.17,7.3 2.03,10.5h2c0.15,-2.65 1.51,-4.97 3.55,-6.42zM19.97,10.5h2c-0.15,-3.2 -1.73,-6.02 -4.12,-7.85l-1.42,1.43c2.02,1.45 3.39,3.77 3.54,6.42z" />
            </group>
            <path
                android:fillColor="#d3d3d3"
                android:pathData="M18,11c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2v-5zM12,22c0.14,0 0.27,-0.01 0.4,-0.04 0.65,-0.14 1.18,-0.58 1.44,-1.18 0.1,-0.24 0.15,-0.5 0.15,-0.78h-4c0.01,1.1 0.9,2 2.01,2z" />
        </vector>
    </aapt:attr>
    <target android:name="ringer">
        <aapt:attr name="android:animation">
            <set android:ordering="sequentially"
                android:interpolator="@android:accelerate_interpolator"
                >
            <objectAnimator
                android:duration="300"
                android:startOffset="3000"
                android:propertyName="rotation"
                android:valueFrom="30"
                android:valueTo="-30"
                android:repeatCount="infinite"
                android:repeatMode="reverse" />
            </set>
        </aapt:attr>

    </target>
</animated-vector>

当我尝试设置 android:interpolator 时,出现错误:

Error:(20, 39) No resource type specified (at 'interpolator' with value '@android:accelerate_interpolator').

如何在不创建额外的 XML 资源文件的情况下解决此问题?

使用

@android:anim/accelerate_interpolator

而不是

@android:accelerate_interpolator