aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/main/res/layout/tunnel_list_fragment.xml
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-03-09 19:06:11 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-03-09 19:24:27 +0530
commit7d48bef70a56d4370856eedab619b1f83ac3d0d0 (patch)
tree76fd859578e499cd3a8fd2f402652530ea36a72d /ui/src/main/res/layout/tunnel_list_fragment.xml
parentEnable nonnull generation for tunnel module (diff)
downloadwireguard-android-7d48bef70a56d4370856eedab619b1f83ac3d0d0.tar.xz
wireguard-android-7d48bef70a56d4370856eedab619b1f83ac3d0d0.zip
Rename app module to ui
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'ui/src/main/res/layout/tunnel_list_fragment.xml')
-rw-r--r--ui/src/main/res/layout/tunnel_list_fragment.xml78
1 files changed, 78 insertions, 0 deletions
diff --git a/ui/src/main/res/layout/tunnel_list_fragment.xml b/ui/src/main/res/layout/tunnel_list_fragment.xml
new file mode 100644
index 0000000..c8144db
--- /dev/null
+++ b/ui/src/main/res/layout/tunnel_list_fragment.xml
@@ -0,0 +1,78 @@
+<?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"
+ xmlns:tools="http://schemas.android.com/tools">
+
+ <data>
+
+ <import type="com.wireguard.android.model.ObservableTunnel" />
+
+ <variable
+ name="fragment"
+ type="com.wireguard.android.fragment.TunnelListFragment" />
+
+ <variable
+ name="rowConfigurationHandler"
+ type="com.wireguard.android.databinding.ObservableKeyedRecyclerViewAdapter.RowConfigurationHandler" />
+
+ <variable
+ name="tunnels"
+ type="com.wireguard.android.util.ObservableKeyedList&lt;String, ObservableTunnel&gt;" />
+ </data>
+
+ <androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/main_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="?attr/colorBackground"
+ android:clipChildren="false">
+
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/tunnel_list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:choiceMode="multipleChoiceModal"
+ android:clipToPadding="false"
+ android:paddingBottom="@{@dimen/design_fab_size_normal * 1.1f}"
+ android:visibility="@{tunnels.size() > 0 ? android.view.View.VISIBLE : android.view.View.GONE}"
+ app:configurationHandler="@{rowConfigurationHandler}"
+ app:items="@{tunnels}"
+ app:layout="@{@layout/tunnel_list_item}"
+ tools:listitem="@layout/tunnel_list_item"
+ tools:itemCount="12" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:orientation="vertical"
+ android:visibility="@{tunnels.size() == 0 ? android.view.View.VISIBLE : android.view.View.GONE}"
+ tools:visibility="gone">
+
+ <androidx.appcompat.widget.AppCompatImageView
+ android:id="@+id/logo_placeholder"
+ android:layout_width="140dp"
+ android:layout_height="140dp"
+ android:layout_gravity="center"
+ android:layout_marginBottom="20dp"
+ android:alpha="0.3333333"
+ android:src="@mipmap/ic_launcher" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:text="@string/tunnel_list_placeholder"
+ android:textSize="20sp" />
+ </LinearLayout>
+ <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
+ style="@style/Widget.MaterialComponents.ExtendedFloatingActionButton.Icon"
+ android:id="@+id/create_fab"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:layout_margin="@dimen/fab_margin"
+ app:icon="@drawable/ic_action_add_white" />
+
+ </androidx.coordinatorlayout.widget.CoordinatorLayout>
+</layout>