Skip to content
This repository was archived by the owner on Jun 23, 2022. It is now read-only.

Commit c3e328f

Browse files
author
Lyla
committed
5.11 Coding Task for Activated List Item
1 parent c6432e8 commit c3e328f

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
4+
5+
<!-- State when a row is being pressed, but hasn't yet been activated (finger down) -->
6+
<item android:state_pressed="true">
7+
<ripple android:color="@color/grey" />
8+
</item>
9+
10+
<!-- When the view is "activated". In SINGLE_CHOICE_MODE, it flags the active row
11+
of a ListView -->
12+
<item android:state_activated="true"
13+
android:drawable="@color/sunshine_light_blue" />
14+
15+
<!-- Default, "just hangin' out" state. -->
16+
<item android:drawable="@android:color/transparent" />
17+
</selector>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
4+
5+
<!-- State when a row is being pressed, but hasn't yet been activated (finger down) -->
6+
<item android:state_pressed="true"
7+
android:drawable="@color/sunshine_light_blue" />
8+
9+
<!-- When the view is "activated". In SINGLE_CHOICE_MODE, it flags the active row
10+
of a ListView -->
11+
<item android:state_activated="true"
12+
android:drawable="@color/sunshine_light_blue" />
13+
14+
<!-- Default, "just hangin' out" state. -->
15+
<item android:drawable="@android:color/transparent" />
16+
</selector>

app/src/main/res/values/colors.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<color name="grey">#cccccc</color>
5+
<color name="sunshine_light_blue">#ff64c2f4</color>
6+
7+
</resources>

0 commit comments

Comments
 (0)