Skip to content

Commit

Permalink
Add custom ripple effect
Browse files Browse the repository at this point in the history
  • Loading branch information
szugyi committed May 4, 2020
1 parent 4b7b0dc commit 1b3c19f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
26 changes: 18 additions & 8 deletions app/src/main/res/drawable/background_item_pokemon.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape>
<solid android:color="@color/backgroundLight"/>
<corners android:radius="15dp"/>
</shape>
</item>
</layer-list>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorControlHighlight">

<item>
<shape>
<solid android:color="@color/backgroundLight" />
<corners android:radius="15dp" />
</shape>
</item>

<item android:id="@android:id/mask">
<shape>
<!-- Color doesn't matter -->
<solid android:color="@android:color/white" />
<corners android:radius="15dp" />
</shape>
</item>
</ripple>
2 changes: 0 additions & 2 deletions app/src/main/res/layout/item_generation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
android:clipToPadding="false"
android:elevation="8dp"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="vertical"
android:padding="8dp">

<TextView
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/res/layout/item_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
android:clickable="true"
android:clipToPadding="false"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="vertical"
android:padding="8dp">
android:padding="8dp"
tools:backgroundTint="@color/lightTeal">

<TextView
android:id="@+id/textViewName"
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/res/layout/item_pokemon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
android:clickable="true"
android:clipToPadding="false"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="vertical"
android:padding="8dp">
android:padding="8dp"
tools:backgroundTint="@color/lightTeal">

<TextView
android:id="@+id/textViewName"
Expand Down

0 comments on commit 1b3c19f

Please sign in to comment.