android - Can I affect the color of ripple touch feedback while targeting API 16? -
is there way make ripple have darkening effect instead of lightening one?
i can set background of cardview darker color , see ripple feedback. however, card has white background. ripple invisible because noticeable on top of dark text within card.
backgroundtint (a common response) api 21+.
build
compilesdkversion 23 minsdkversion 16 targetsdkversion 23 compile 'com.android.support:recyclerview-v7:23.1.1' compile 'com.android.support:cardview-v7:23.1.+'
xml
<android.support.v7.widget.cardview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/my_card" android:layout_width="match_parent" android:layout_height="wrap_content" card_view:cardbackgroundcolor="@color/colorgraydark" android:foreground="?android:attr/selectableitembackground" card_view:cardcornerradius="2dp" card_view:cardelevation="2dp" card_view:cardpreventcorneroverlap="false" card_view:cardusecompatpadding="true"> ... </android.support.v7.widget.cardview>
Comments
Post a Comment