PeerEditor: put exclusion checkbox next to label
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -93,9 +93,21 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/pre_shared_key_text"
|
||||
android:layout_toStartOf="@+id/exclude_private_ips"
|
||||
android:labelFor="@+id/allowed_ips_text"
|
||||
android:text="@string/allowed_ips" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/exclude_private_ips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBaseline="@+id/allowed_ips_label"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:checked="@{item.allowedIPsContainsDefaultRouteModRFC1918}"
|
||||
android:onClick="@{() -> item.toggleExcludePrivateIPs()}"
|
||||
android:text="@string/exclude_private_ips"
|
||||
android:visibility="@{(item.allowedIPsContainsDefaultRoute || item.allowedIPsContainsDefaultRouteModRFC1918) ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/allowed_ips_text"
|
||||
android:layout_width="match_parent"
|
||||
@@ -104,22 +116,12 @@
|
||||
android:inputType="textNoSuggestions|textVisiblePassword"
|
||||
android:text="@={item.allowedIPs}" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/exclude_private_ips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/allowed_ips_text"
|
||||
android:visibility="@{(item.allowedIPsContainsDefaultRoute || item.allowedIPsContainsDefaultRouteModRFC1918) ? View.VISIBLE : View.GONE}"
|
||||
android:checked="@{item.allowedIPsContainsDefaultRouteModRFC1918}"
|
||||
android:onClick="@{() -> item.toggleExcludePrivateIPs()}"
|
||||
android:text="@string/exclude_private_ips" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/endpoint_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@+id/exclude_private_ips"
|
||||
android:layout_below="@+id/allowed_ips_text"
|
||||
android:layout_toStartOf="@+id/persistent_keepalive_label"
|
||||
android:labelFor="@+id/endpoint_text"
|
||||
android:text="@string/endpoint" />
|
||||
|
||||
Reference in New Issue
Block a user