Wie kann ich mithilfe der Support-Bibliothek eine Ripple-Animation erzielen?

Ich versuche, beim Klicken auf eine Schaltfläche eine Ripple-Animation hinzuzufügen. Ich mochte unten, aber es erfordert minSdKVersion bis 21.

ripple.xml

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="?android:colorControlHighlight">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="?android:colorAccent" />
        </shape>
    </item>
</ripple>

Tast

<com.devspark.robototextview.widget.RobotoButton
    android:id="@+id/loginButton"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/ripple"
    android:text="@string/login_button" />

Ich möchte es abwärtskompatibel mit der Designbibliothek machen.

Wie kann das gemacht werden?

Antworten auf die Frage(6)

Ihre Antwort auf die Frage