I want to use ripple effects on Buttons. AppCompat v22.1 added AppCompatButton and new functionalities to AppCompat tinting.
My Layout:
<android.support.v7.widget.AppCompatButton
android:id="@+id/add_remove_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:backgroundTint="@color/primary"
android:textColor="@android:color/white"
android:text="Remove" />
On my API 22 test device the ripple effect works perfectly, but i'm coding for API 11 and unfortunately backgroundTint needs API >= 21. How can i set the ripple effect to Buttons on older API versions?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…