Skip to content
This repository was archived by the owner on May 1, 2021. It is now read-only.

Commit a3ef8e8

Browse files
Merge pull request #21 from jemshit/master
Almost fixed ripple effect issue on android 6 when pressing preferences items. See this: #19 Also, for some reason, now it sometimes show the ripple in the middle.
2 parents cb3802e + 6d43215 commit a3ef8e8

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<ripple
2+
xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:color="#a5a5a5">
4+
<item>
5+
<shape
6+
android:shape="rectangle">
7+
<solid android:color="@android:color/transparent" />
8+
</shape>
9+
</item>
10+
</ripple>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<selector
2+
xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item>
4+
<shape
5+
android:shape="rectangle">
6+
<solid android:color="@android:color/transparent" />
7+
</shape>
8+
</item>
9+
<item android:state_pressed="true">
10+
<shape
11+
android:shape="rectangle">
12+
<solid android:color="@android:color/transparent" />
13+
</shape>
14+
</item>
15+
<item android:state_focused="true">
16+
<shape
17+
android:shape="rectangle">
18+
<solid android:color="@android:color/transparent" />
19+
</shape>
20+
</item>
21+
</selector>

material_preferences_library/src/main/res/layout/mpl__preference_activity.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<ListView
2626
android:id="@android:id/list"
2727
android:layout_width="match_parent"
28-
android:layout_height="match_parent"/>
28+
android:layout_height="match_parent"
29+
android:listSelector="@drawable/mpl__custom_ripple_effect_background"/>
2930

3031
<ImageView
3132
android:id="@+id/abp__shadowView"

0 commit comments

Comments
 (0)