diff options
author | Samuel Holland <samuel@sholland.org> | 2017-11-25 23:05:39 -0600 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-11-25 23:05:39 -0600 |
commit | 283340f5dcd74f8a6fc3545f567cf1c2f6256318 (patch) | |
tree | a5edae07c32d0c946ad82230a80102a7cc87e338 /app/src/main/res | |
parent | 666dc25cb07e068fc2420f7e03b78ca332aad024 (diff) |
ConfigList: A better toggle switch
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/config_list_item.xml | 9 |
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> |