summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/res/layout
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2018-01-08 04:33:37 -0600
committerSamuel Holland <samuel@sholland.org>2018-01-08 04:33:54 -0600
commitc4e91f8040968ad51ffccbd2ef9f17d4d322f579 (patch)
tree2c9a776734c959af09e2f8718f1b49c7e64aa9c7 /app/src/main/res/layout
parentc40555c1bd25ed1c832004e01438ec170ba93712 (diff)
Handle tunnel state change errors appropriately
This class should probably be renamed and moved, but I don't know to what or where. Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r--app/src/main/res/layout/tunnel_detail_fragment.xml4
-rw-r--r--app/src/main/res/layout/tunnel_list_item.xml4
2 files changed, 6 insertions, 2 deletions
diff --git a/app/src/main/res/layout/tunnel_detail_fragment.xml b/app/src/main/res/layout/tunnel_detail_fragment.xml
index e10bc4e1..900d08ed 100644
--- a/app/src/main/res/layout/tunnel_detail_fragment.xml
+++ b/app/src/main/res/layout/tunnel_detail_fragment.xml
@@ -5,6 +5,8 @@
<data>
+ <import type="com.wireguard.android.fragment.TunnelController" />
+
<import type="com.wireguard.android.model.Tunnel.State" />
<import type="com.wireguard.android.util.ClipboardUtils" />
@@ -52,7 +54,7 @@
android:layout_alignBaseline="@+id/interface_title"
android:layout_alignParentEnd="true"
app:checked="@{tunnel.state == State.UP}"
- app:onBeforeCheckedChanged="@{() -> tunnel.setState(State.TOGGLE)}" />
+ app:onBeforeCheckedChanged="@{TunnelController::setTunnelState}" />
<TextView
android:id="@+id/interface_name_label"
diff --git a/app/src/main/res/layout/tunnel_list_item.xml b/app/src/main/res/layout/tunnel_list_item.xml
index 1ed157e9..7fbd61f7 100644
--- a/app/src/main/res/layout/tunnel_list_item.xml
+++ b/app/src/main/res/layout/tunnel_list_item.xml
@@ -4,6 +4,8 @@
<data>
+ <import type="com.wireguard.android.fragment.TunnelController" />
+
<import type="com.wireguard.android.model.Tunnel" />
<import type="com.wireguard.android.model.Tunnel.State" />
@@ -47,6 +49,6 @@
android:layout_alignBaseline="@+id/tunnel_name"
android:layout_alignParentEnd="true"
app:checked="@{item.state == State.UP}"
- app:onBeforeCheckedChanged="@{() -> item.setState(State.TOGGLE)}" />
+ app:onBeforeCheckedChanged="@{TunnelController::setTunnelState}" />
</RelativeLayout>
</layout>