I write an android code that has ripple effect by adding:
android:background="?attr/selectableItemBackground"
I need to tweak it. I know how to change the ripple color. But do you think the following are even possible to tune?
- On tap (click and let go), show regular on press color, no ripple.
- When holding the finger longer - show ripple
- Start fade out after 6 milliseconds after the on press
I know adding a drawable selector allows to control more states, but I don't think it can control duration.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="oval">
<solid android:color="@color/grey200_alpha_10"/>
</shape>
</item>
<item android:state_focused="true">
<shape android:shape="oval">
<solid android:color="@color/grey200_alpha_12"/>
</shape>
</item>
<item android:state_hovered="true">
<shape android:shape="oval">
<solid android:color="@color/grey200_alpha_4"/>
</shape>
</item>
</selector>
Is it possible?