add ripple effect to buttons

This commit is contained in:
tibbi 2016-02-26 12:39:16 +01:00
parent 3bd2c6296d
commit a170b946f7
4 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorControlHighlight">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
<size
android:width="80dp"
android:height="80dp"/>
</shape>
</item>
</ripple>

View File

@ -0,0 +1,13 @@
<?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="rectangle">
<solid android:color="@color/lightGrey"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@android:color/transparent"/>
</shape>
</item>
</selector>

View File

@ -11,6 +11,7 @@
android:layout_height="match_parent"
android:layout_alignBottom="@+id/table_month"
android:layout_alignTop="@+id/table_month"
android:background="@drawable/ripple"
android:paddingBottom="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
@ -34,6 +35,7 @@
android:layout_alignBottom="@+id/table_month"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/table_month"
android:background="@drawable/ripple"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"

View File

@ -3,4 +3,5 @@
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="lightGrey">#08000000</color>
</resources>