From b767d04f9ff2d87be650c831431cae731614f17a Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 19 Dec 2021 02:33:12 +0100 Subject: ui,tunnel: add HTTP proxy setting to Go backend Only make the HTTP proxy settings visible on supported Android versions, i.e. Android 10 (AKA Android Q) and later. Signed-off-by: Mikael Magnusson --- ui/src/main/res/layout/http_proxy_menu_item.xml | 8 ++ ui/src/main/res/layout/tunnel_detail_fragment.xml | 37 +++++++- ui/src/main/res/layout/tunnel_editor_fragment.xml | 105 ++++++++++++++++++++-- 3 files changed, 141 insertions(+), 9 deletions(-) create mode 100644 ui/src/main/res/layout/http_proxy_menu_item.xml (limited to 'ui/src/main/res/layout') diff --git a/ui/src/main/res/layout/http_proxy_menu_item.xml b/ui/src/main/res/layout/http_proxy_menu_item.xml new file mode 100644 index 00000000..8ad5c026 --- /dev/null +++ b/ui/src/main/res/layout/http_proxy_menu_item.xml @@ -0,0 +1,8 @@ + + diff --git a/ui/src/main/res/layout/tunnel_detail_fragment.xml b/ui/src/main/res/layout/tunnel_detail_fragment.xml index 332df04a..296dd572 100644 --- a/ui/src/main/res/layout/tunnel_detail_fragment.xml +++ b/ui/src/main/res/layout/tunnel_detail_fragment.xml @@ -5,6 +5,8 @@ + + @@ -223,7 +225,7 @@ android:contentDescription="@string/listen_port" android:nextFocusRight="@id/mtu_text" android:nextFocusUp="@id/dns_search_domains_text" - android:nextFocusDown="@id/applications_text" + android:nextFocusDown="@id/http_proxy_text" android:nextFocusForward="@id/mtu_text" android:onClick="@{ClipboardUtils::copyTextView}" android:text="@{config.interface.listenPort}" @@ -256,7 +258,7 @@ android:contentDescription="@string/mtu" android:nextFocusLeft="@id/listen_port_text" android:nextFocusUp="@id/dns_servers_text" - android:nextFocusForward="@id/applications_text" + android:nextFocusForward="@id/http_proxy_text" android:onClick="@{ClipboardUtils::copyTextView}" android:text="@{config.interface.mtu}" android:textAppearance="?attr/textAppearanceBodyLarge" @@ -275,6 +277,33 @@ app:barrierDirection="bottom" app:constraint_referenced_ids="listen_port_text,mtu_text" /> + + + + + app:layout_constraintTop_toBottomOf="@+id/http_proxy_text" /> - \ No newline at end of file + diff --git a/ui/src/main/res/layout/tunnel_editor_fragment.xml b/ui/src/main/res/layout/tunnel_editor_fragment.xml index 0350486b..42222399 100644 --- a/ui/src/main/res/layout/tunnel_editor_fragment.xml +++ b/ui/src/main/res/layout/tunnel_editor_fragment.xml @@ -5,6 +5,8 @@ + + @@ -210,7 +212,7 @@ android:imeOptions="actionNext" android:inputType="textNoSuggestions|textVisiblePassword" android:nextFocusUp="@id/addresses_label_text" - android:nextFocusDown="@id/set_excluded_applications" + android:nextFocusDown="@id/http_proxy_hostname_text" android:nextFocusForward="@id/mtu_text" android:text="@={config.interface.dnsServers}" /> @@ -235,19 +237,112 @@ android:imeOptions="actionDone" android:inputType="number" android:nextFocusUp="@id/listen_port_text" - android:nextFocusDown="@id/set_excluded_applications" - android:nextFocusForward="@id/set_excluded_applications" + android:nextFocusDown="@id/http_proxy_hostname_text" + android:nextFocusForward="@id/http_proxy_hostname_text" android:text="@={config.interface.mtu}" android:textAlignment="center" /> + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3