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>
This commit is contained in:
Samuel Holland
2017-07-29 06:09:55 -05:00
parent 85f1d4f1d3
commit 7ceafaf2bb
6 changed files with 246 additions and 0 deletions
@@ -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&lt;com.wireguard.config.Profile&gt;" />
</data>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:items="@{profiles}"
app:layout="@{@layout/profile_list_item}" />
</layout>
@@ -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>