summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/res
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-07-06 03:40:18 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-06 16:28:46 +0200
commitd132087b3ca55b96724b48d36c2b82cdfe5d6533 (patch)
tree99d7ff2af12c41dac7cf72e998ffa545836a0b59 /app/src/main/res
parent124f186983f95648867ba1fdd2bec1e098ae95ba (diff)
PeerEditor: add exclude private IPs functionality
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/layout/tunnel_editor_peer.xml13
-rw-r--r--app/src/main/res/values/strings.xml1
2 files changed, 13 insertions, 1 deletions
diff --git a/app/src/main/res/layout/tunnel_editor_peer.xml b/app/src/main/res/layout/tunnel_editor_peer.xml
index 309ef7bb..5a84fd92 100644
--- a/app/src/main/res/layout/tunnel_editor_peer.xml
+++ b/app/src/main/res/layout/tunnel_editor_peer.xml
@@ -4,6 +4,7 @@
<data>
+ <import type="android.view.View"/>
<import type="com.wireguard.android.widget.KeyInputFilter" />
<variable
@@ -103,12 +104,22 @@
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/allowed_ips_text"
+ android:layout_below="@+id/exclude_private_ips"
android:layout_toStartOf="@+id/persistent_keepalive_label"
android:labelFor="@+id/endpoint_text"
android:text="@string/endpoint" />
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index b44e3121..b4105d2d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -43,6 +43,7 @@
<string name="error_root">Please obtain root access and try again</string>
<string name="error_up">Error bringing up tunnel: %s</string>
<string name="excluded_applications">Excluded Applications</string>
+ <string name="exclude_private_ips">Exclude Private IPs</string>
<string name="generate">Generate</string>
<string name="hint_automatic">(auto)</string>
<string name="hint_generated">(generated)</string>