summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/res
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/drawable/list_item_background.xml11
-rw-r--r--app/src/main/res/layout/tunnel_list_item.xml4
-rw-r--r--app/src/main/res/values/attrs.xml6
3 files changed, 14 insertions, 7 deletions
diff --git a/app/src/main/res/drawable/list_item_background.xml b/app/src/main/res/drawable/list_item_background.xml
index f064676a..d62f3237 100644
--- a/app/src/main/res/drawable/list_item_background.xml
+++ b/app/src/main/res/drawable/list_item_background.xml
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
<item>
<selector>
- <item android:state_activated="true">
+ <item app:state_multiselected="true" android:state_activated="true">
+ <color android:color="?android:attr/colorControlActivated" />
+ </item>
+ <item app:state_multiselected="false" android:state_activated="true">
<color android:color="?android:attr/colorControlHighlight" />
- <!-- TODO(msf): depending on whether or not we are in multiselect mode, choose instead:
- <color android:color="?android:attr/colorControlActivated" />
- -->
</item>
</selector>
</item>
diff --git a/app/src/main/res/layout/tunnel_list_item.xml b/app/src/main/res/layout/tunnel_list_item.xml
index ba36fe65..cf25b83e 100644
--- a/app/src/main/res/layout/tunnel_list_item.xml
+++ b/app/src/main/res/layout/tunnel_list_item.xml
@@ -25,7 +25,7 @@
type="com.wireguard.android.fragment.TunnelListFragment" />
</data>
- <RelativeLayout
+ <com.wireguard.android.widget.MultiselectableRelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/list_item_background"
@@ -51,5 +51,5 @@
android:layout_alignParentEnd="true"
app:checked="@{item.state == State.UP}"
app:onBeforeCheckedChanged="@{fragment::setTunnelState}" />
- </RelativeLayout>
+ </com.wireguard.android.widget.MultiselectableRelativeLayout>
</layout>
diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml
new file mode 100644
index 00000000..85a987f9
--- /dev/null
+++ b/app/src/main/res/values/attrs.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <declare-styleable name="Multiselected">
+ <attr name="state_multiselected" format="boolean"/>
+ </declare-styleable>
+</resources> \ No newline at end of file