aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/main/res/layout/app_list_item.xml
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/main/res/layout/app_list_item.xml')
-rw-r--r--ui/src/main/res/layout/app_list_item.xml61
1 files changed, 61 insertions, 0 deletions
diff --git a/ui/src/main/res/layout/app_list_item.xml b/ui/src/main/res/layout/app_list_item.xml
new file mode 100644
index 0000000..1e81751
--- /dev/null
+++ b/ui/src/main/res/layout/app_list_item.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools">
+
+ <data>
+
+ <import type="com.wireguard.android.model.ApplicationData" />
+
+ <variable
+ name="collection"
+ type="com.wireguard.android.util.ObservableKeyedList&lt;String, com.wireguard.android.model.ApplicationData&gt;" />
+
+ <variable
+ name="key"
+ type="String" />
+
+ <variable
+ name="item"
+ type="com.wireguard.android.model.ApplicationData" />
+ </data>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/list_item_background"
+ android:gravity="center_vertical"
+ android:onClick="@{(view) -> item.setExcludedFromTunnel(!item.excludedFromTunnel)}"
+ android:orientation="horizontal"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp">
+
+ <ImageView
+ android:id="@+id/app_icon"
+ android:layout_width="32dp"
+ android:layout_height="32dp"
+ android:layout_marginStart="16dp"
+ android:src="@{item.icon}"
+ tools:src="@tools:sample/avatars" />
+
+ <TextView
+ android:id="@+id/app_name"
+ style="?android:attr/textAppearanceMedium"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:text="@{key}"
+ tools:text="@tools:sample/full_names" />
+
+ <CheckBox
+ android:id="@+id/excluded_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:checked="@={item.excludedFromTunnel}"
+ tools:checked="true" />
+
+ </LinearLayout>
+</layout>