diff options
author | Samuel Holland <samuel@sholland.org> | 2017-07-29 06:09:55 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-07-29 06:09:55 -0500 |
commit | 7ceafaf2bb57cbfae7f724a9fe0c07ae4faff415 (patch) | |
tree | 5a74c80dd665f9854a16b4313c32bd913a1b8959 /app/src/main/res | |
parent | 85f1d4f1d3554be5c8103cacfe7121145d90c90c (diff) |
ProfileList: Add minimal activity
For now, it simply reads the files in the app's data directory with
file names ending in ".conf" and displays them in a list.
This includes the generic list data binding setup for future use.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/profile_list_activity.xml | 17 | ||||
-rw-r--r-- | app/src/main/res/layout/profile_list_item.xml | 29 |
2 files changed, 46 insertions, 0 deletions
diff --git a/app/src/main/res/layout/profile_list_activity.xml b/app/src/main/res/layout/profile_list_activity.xml new file mode 100644 index 00000000..4e7b251f --- /dev/null +++ b/app/src/main/res/layout/profile_list_activity.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<layout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + <data> + + <variable + name="profiles" + type="android.databinding.ObservableList<com.wireguard.config.Profile>" /> + </data> + + <ListView + android:layout_width="match_parent" + android:layout_height="match_parent" + app:items="@{profiles}" + app:layout="@{@layout/profile_list_item}" /> +</layout> diff --git a/app/src/main/res/layout/profile_list_item.xml b/app/src/main/res/layout/profile_list_item.xml new file mode 100644 index 00000000..aeafaf0f --- /dev/null +++ b/app/src/main/res/layout/profile_list_item.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<layout xmlns:android="http://schemas.android.com/apk/res/android"> + + <data> + + <variable + name="item" + type="com.wireguard.config.Profile" /> + </data> + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="16dp"> + + <TextView + android:id="@+id/profile_name" + style="?android:attr/textAppearanceMedium" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@{item.name}" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/profile_name" + android:text="@{item.toString()}" /> + </RelativeLayout> +</layout> |