Skip to content

Commit 73d9e9a

Browse files
committed
demo the improved touch listener (try to touch items under sticky header)
1 parent 7613505 commit 73d9e9a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item android:state_pressed="true">
4+
<shape android:shape="rectangle">
5+
<solid android:color="@android:color/holo_blue_light" />
6+
</shape>
7+
</item>
8+
<item>
9+
<shape android:shape="rectangle">
10+
<solid android:color="@android:color/white" />
11+
</shape>
12+
</item>
13+
</selector>

sample/src/main/res/layout/view_item.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
xmlns:android="http://schemas.android.com/apk/res/android"
55
xmlns:tools="http://schemas.android.com/tools"
66
android:orientation="horizontal"
7+
android:clickable="true"
78
android:layout_width="match_parent"
89
android:layout_height="wrap_content"
910
android:padding="@dimen/small"
1011
android:textSize="14sp"
1112
tools:text="Aardvark"
12-
android:background="@android:color/white"
13+
android:background="@drawable/white_touch"
1314
tools:context=".MainActivity"/>

0 commit comments

Comments
 (0)