aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/src/main/res/layout
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2017-11-25 23:05:39 -0600
committerSamuel Holland <samuel@sholland.org>2017-11-25 23:05:39 -0600
commit7f4320ab4ba18e7309f876cf2631373a038ad5bc (patch)
treea5edae07c32d0c946ad82230a80102a7cc87e338 /app/src/main/res/layout
parentwidgets: Import ToggleSwitch from the AOSP Settings app (diff)
downloadwireguard-android-7f4320ab4ba18e7309f876cf2631373a038ad5bc.tar.xz
wireguard-android-7f4320ab4ba18e7309f876cf2631373a038ad5bc.zip
ConfigList: A better toggle switch
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r--app/src/main/res/layout/config_list_item.xml9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/src/main/res/layout/config_list_item.xml b/app/src/main/res/layout/config_list_item.xml
index 87380dee..207f95ef 100644
--- a/app/src/main/res/layout/config_list_item.xml
+++ b/app/src/main/res/layout/config_list_item.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<layout xmlns:android="http://schemas.android.com/apk/res/android">
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
@@ -35,13 +36,13 @@
android:text="@{key}"
android:textStyle="@{item.primary ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT}" />
- <Switch
+ <com.wireguard.android.widgets.ToggleSwitch
android:id="@+id/config_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/config_name"
android:layout_alignParentEnd="true"
- android:checked="@{item.enabled}"
- android:onCheckedChanged="@{(v, checked) -> checked ? VpnService.instance.enable(item.name) : VpnService.instance.disable(item.name)}" />
+ app:checked="@{item.enabled}"
+ app:onBeforeCheckedChanged="@{(v, checked) -> checked ? VpnService.instance.enable(item.name) : VpnService.instance.disable(item.name)}" />
</RelativeLayout>
</layout>