diff options
Diffstat (limited to 'ui/src/main/res')
-rw-r--r-- | ui/src/main/res/layout/http_proxy_menu_item.xml | 8 | ||||
-rw-r--r-- | ui/src/main/res/layout/tunnel_detail_fragment.xml | 135 | ||||
-rw-r--r-- | ui/src/main/res/layout/tunnel_detail_peer.xml | 62 | ||||
-rw-r--r-- | ui/src/main/res/layout/tunnel_editor_fragment.xml | 105 | ||||
-rw-r--r-- | ui/src/main/res/values-ar-rSA/strings.xml | 4 | ||||
-rw-r--r-- | ui/src/main/res/values-da-rDK/strings.xml | 4 | ||||
-rw-r--r-- | ui/src/main/res/values-no-rNO/strings.xml | 12 | ||||
-rw-r--r-- | ui/src/main/res/values-ru/strings.xml | 7 | ||||
-rw-r--r-- | ui/src/main/res/values-zh-rCN/strings.xml | 3 | ||||
-rw-r--r-- | ui/src/main/res/values/dimens.xml | 1 | ||||
-rw-r--r-- | ui/src/main/res/values/strings.xml | 8 |
11 files changed, 286 insertions, 63 deletions
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 @@ +<?xml version="1.0" encoding="utf-8"?> +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="16dp" + android:ellipsize="end" + android:maxLines="1" +/> diff --git a/ui/src/main/res/layout/tunnel_detail_fragment.xml b/ui/src/main/res/layout/tunnel_detail_fragment.xml index 3ebe24e8..425b364d 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 @@ <data> + <import type="android.os.Build" /> + <import type="com.wireguard.android.backend.Tunnel.State" /> <import type="com.wireguard.android.util.ClipboardUtils" /> @@ -19,7 +21,7 @@ <variable name="config" - type="com.wireguard.config.Config" /> + type="com.wireguard.android.viewmodel.ConfigDetail" /> </data> <ScrollView @@ -71,7 +73,7 @@ <TextView android:id="@+id/interface_name_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:labelFor="@+id/interface_name_text" @@ -81,7 +83,7 @@ <TextView android:id="@+id/interface_name_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/name" android:nextFocusUp="@id/tunnel_switch" @@ -96,7 +98,7 @@ <TextView android:id="@+id/public_key_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:labelFor="@+id/public_key_text" @@ -106,7 +108,7 @@ <TextView android:id="@+id/public_key_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/public_key" android:ellipsize="end" @@ -116,7 +118,7 @@ android:nextFocusForward="@id/addresses_text" android:onClick="@{ClipboardUtils::copyTextView}" android:singleLine="true" - android:text="@{config.interface.keyPair.publicKey.toBase64}" + android:text="@{config.config.interface.keyPair.publicKey.toBase64}" android:textAppearance="?attr/textAppearanceBodyLarge" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/public_key_label" @@ -124,81 +126,108 @@ <TextView android:id="@+id/addresses_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:labelFor="@+id/addresses_text" android:text="@string/addresses" - android:visibility="@{config.interface.addresses.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{config.config.interface.addresses.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/public_key_text" /> <TextView android:id="@+id/addresses_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/addresses" android:nextFocusUp="@id/public_key_text" + android:nextFocusDown="@id/dynamic_addresses_text" + android:nextFocusForward="@id/dynamic_addresses_text" + android:onClick="@{ClipboardUtils::copyTextView}" + android:text="@{config.config.interface.addresses}" + android:textAppearance="?attr/textAppearanceBodyLarge" + android:visibility="@{config.config.interface.addresses.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/addresses_label" + tools:text="fc00:bbbb:bbbb:bb11::3:368b/128" /> + + <TextView + android:id="@+id/dynamic_addresses_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:labelFor="@+id/dynamic_addresses_text" + android:text="@string/dynamic_addresses" + android:visibility="@{tunnel.dhcp == null ? android.view.View.GONE : android.view.View.VISIBLE}" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/addresses_text" /> + + <TextView + android:id="@+id/dynamic_addresses_text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:contentDescription="@string/dynamic_addresses" + android:nextFocusUp="@id/addresses_text" android:nextFocusDown="@id/dns_servers_text" android:nextFocusForward="@id/dns_servers_text" android:onClick="@{ClipboardUtils::copyTextView}" - android:text="@{config.interface.addresses}" + android:text="@{tunnel.dhcp.addresses}" android:textAppearance="?attr/textAppearanceBodyLarge" - android:visibility="@{config.interface.addresses.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{tunnel.dhcp == null ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/addresses_label" + app:layout_constraintTop_toBottomOf="@+id/dynamic_addresses_label" tools:text="fc00:bbbb:bbbb:bb11::3:368b/128" /> <TextView android:id="@+id/dns_servers_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:labelFor="@+id/dns_servers_text" android:text="@string/dns_servers" - android:visibility="@{config.interface.dnsServers.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{config.config.interface.dnsServers.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/addresses_text" /> + app:layout_constraintTop_toBottomOf="@id/dynamic_addresses_text" /> <TextView android:id="@+id/dns_servers_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/dns_servers" - android:nextFocusUp="@id/addresses_text" + android:nextFocusUp="@id/dynamic_addresses_text" android:nextFocusDown="@id/dns_search_domains_text" android:nextFocusForward="@id/dns_search_domains_text" android:onClick="@{ClipboardUtils::copyTextView}" - android:text="@{config.interface.dnsServers}" + android:text="@{config.config.interface.dnsServers}" android:textAppearance="?attr/textAppearanceBodyLarge" - android:visibility="@{config.interface.dnsServers.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{config.config.interface.dnsServers.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/dns_servers_label" tools:text="8.8.8.8, 8.8.4.4" /> <TextView android:id="@+id/dns_search_domains_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:labelFor="@+id/dns_search_domain_text" android:text="@string/dns_search_domains" - android:visibility="@{config.interface.dnsSearchDomains.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{config.config.interface.dnsSearchDomains.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/dns_servers_text" /> <TextView android:id="@+id/dns_search_domains_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/dns_search_domains" android:nextFocusUp="@id/dns_servers_text" android:nextFocusDown="@id/listen_port_text" android:nextFocusForward="@id/listen_port_text" android:onClick="@{ClipboardUtils::copyTextView}" - android:text="@{config.interface.dnsSearchDomains}" + android:text="@{config.config.interface.dnsSearchDomains}" android:textAppearance="?attr/textAppearanceBodyLarge" - android:visibility="@{config.interface.dnsSearchDomains.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{config.config.interface.dnsSearchDomains.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/dns_search_domains_label" tools:text="zx2c4.com" /> @@ -210,7 +239,7 @@ android:layout_marginTop="8dp" android:labelFor="@+id/listen_port_text" android:text="@string/listen_port" - android:visibility="@{!config.interface.listenPort.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{!config.config.interface.listenPort.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintEnd_toStartOf="@id/mtu_label" app:layout_constraintHorizontal_weight="0.5" app:layout_constraintStart_toStartOf="parent" @@ -223,12 +252,12 @@ 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}" + android:text="@{config.config.interface.listenPort}" android:textAppearance="?attr/textAppearanceBodyLarge" - android:visibility="@{!config.interface.listenPort.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{!config.config.interface.listenPort.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintEnd_toStartOf="@id/mtu_label" app:layout_constraintHorizontal_weight="0.5" app:layout_constraintStart_toStartOf="parent" @@ -242,7 +271,7 @@ android:layout_marginTop="8dp" android:labelFor="@+id/mtu_text" android:text="@string/mtu" - android:visibility="@{!config.interface.mtu.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{!config.config.interface.mtu.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_weight="0.5" app:layout_constraintLeft_toRightOf="@id/listen_port_label" @@ -256,11 +285,11 @@ 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:text="@{config.config.interface.mtu}" android:textAppearance="?attr/textAppearanceBodyLarge" - android:visibility="@{!config.interface.mtu.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{!config.config.interface.mtu.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_weight="0.5" app:layout_constraintStart_toEndOf="@id/listen_port_label" @@ -276,28 +305,55 @@ app:constraint_referenced_ids="listen_port_text,mtu_text" /> <TextView + android:id="@+id/http_proxy_label" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:labelFor="@+id/http_proxy_text" + android:text="@string/http_proxy" + android:visibility="@{(Build.VERSION.SDK_INT < Build.VERSION_CODES.Q || !config.config.interface.httpProxy.isPresent()) ? android.view.View.GONE : android.view.View.VISIBLE}" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/listen_port_mtu_barrier" /> + + <TextView + android:id="@+id/http_proxy_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:contentDescription="@string/http_proxy" + android:nextFocusUp="@id/listen_port_text" + android:nextFocusDown="@id/applications_text" + android:nextFocusForward="@id/applications_text" + android:onClick="@{ClipboardUtils::copyTextView}" + android:text="@{config.config.interface.httpProxy}" + android:textAppearance="?attr/textAppearanceBodyLarge" + android:visibility="@{(Build.VERSION.SDK_INT < Build.VERSION_CODES.Q || !config.config.interface.httpProxy.isPresent()) ? android.view.View.GONE : android.view.View.VISIBLE}" + app:layout_constraintTop_toBottomOf="@id/http_proxy_label" + app:layout_constraintStart_toStartOf="parent" + tools:text="http://example.com:8888" /> + + <TextView android:id="@+id/applications_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:labelFor="@+id/applications_text" android:text="@string/applications" - android:visibility="@{config.interface.includedApplications.isEmpty() && config.interface.excludedApplications.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{config.config.interface.includedApplications.isEmpty() && config.config.interface.excludedApplications.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/listen_port_mtu_barrier" /> + app:layout_constraintTop_toBottomOf="@+id/http_proxy_text" /> <TextView android:id="@+id/applications_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/applications" android:nextFocusUp="@id/mtu_text" android:nextFocusDown="@id/peers_layout" android:nextFocusForward="@id/peers_layout" android:onClick="@{ClipboardUtils::copyTextView}" - android:text="@{config.interface.includedApplications.isEmpty() ? @plurals/n_excluded_applications(config.interface.excludedApplications.size(), config.interface.excludedApplications.size()) : @plurals/n_included_applications(config.interface.includedApplications.size(), config.interface.includedApplications.size())}" + android:text="@{config.config.interface.includedApplications.isEmpty() ? @plurals/n_excluded_applications(config.config.interface.excludedApplications.size(), config.config.interface.excludedApplications.size()) : @plurals/n_included_applications(config.config.interface.includedApplications.size(), config.config.interface.includedApplications.size())}" android:textAppearance="?attr/textAppearanceBodyLarge" - android:visibility="@{config.interface.includedApplications.isEmpty() && config.interface.excludedApplications.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{config.config.interface.includedApplications.isEmpty() && config.config.interface.excludedApplications.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/applications_label" tools:text="8 excluded" /> @@ -311,6 +367,7 @@ android:layout_marginTop="8dp" android:divider="@null" android:orientation="vertical" + app:fragment="@{fragment}" app:items="@{config.peers}" app:layout="@{@layout/tunnel_detail_peer}" app:layout_constraintStart_toStartOf="parent" @@ -318,4 +375,4 @@ tools:ignore="UselessLeaf" /> </androidx.constraintlayout.widget.ConstraintLayout> </ScrollView> -</layout>
\ No newline at end of file +</layout> diff --git a/ui/src/main/res/layout/tunnel_detail_peer.xml b/ui/src/main/res/layout/tunnel_detail_peer.xml index 5aeca08b..89bb85ec 100644 --- a/ui/src/main/res/layout/tunnel_detail_peer.xml +++ b/ui/src/main/res/layout/tunnel_detail_peer.xml @@ -9,7 +9,7 @@ <variable name="item" - type="com.wireguard.config.Peer" /> + type="com.wireguard.android.viewmodel.PeerDetail" /> </data> <com.google.android.material.card.MaterialCardView @@ -23,7 +23,7 @@ <com.google.android.material.textview.MaterialTextView android:id="@+id/peer_title" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/peer" android:textAppearance="?attr/textAppearanceTitleMedium" @@ -32,7 +32,7 @@ <TextView android:id="@+id/public_key_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:labelFor="@+id/public_key_text" @@ -42,7 +42,7 @@ <TextView android:id="@+id/public_key_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/public_key" android:ellipsize="end" @@ -59,18 +59,18 @@ <TextView android:id="@+id/pre_shared_key_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:labelFor="@+id/pre_shared_key_text" android:text="@string/pre_shared_key" - android:visibility="@{!item.preSharedKey.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{!item.peer.preSharedKey.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/public_key_text" /> <TextView android:id="@+id/pre_shared_key_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/pre_shared_key" android:ellipsize="end" @@ -81,14 +81,14 @@ android:singleLine="true" android:text="@string/pre_shared_key_enabled" android:textAppearance="?attr/textAppearanceBodyLarge" - android:visibility="@{!item.preSharedKey.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" + android:visibility="@{!item.peer.preSharedKey.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/pre_shared_key_label" tools:text="8VyS8W8XeMcBWfKp1GuG3/fZlnUQFkqMNbrdmZtVQIM=" /> <TextView android:id="@+id/allowed_ips_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:labelFor="@+id/allowed_ips_text" @@ -99,7 +99,7 @@ <TextView android:id="@+id/allowed_ips_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/allowed_ips" android:nextFocusUp="@id/pre_shared_key_text" @@ -115,7 +115,7 @@ <TextView android:id="@+id/endpoint_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:labelFor="@+id/endpoint_text" @@ -126,7 +126,7 @@ <TextView android:id="@+id/endpoint_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/endpoint" android:nextFocusUp="@id/allowed_ips_text" @@ -142,7 +142,7 @@ <TextView android:id="@+id/persistent_keepalive_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:labelFor="@+id/persistent_keepalive_text" @@ -153,7 +153,7 @@ <TextView android:id="@+id/persistent_keepalive_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/persistent_keepalive" android:nextFocusUp="@id/endpoint_text" @@ -169,9 +169,9 @@ <TextView android:id="@+id/transfer_label" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_below="@+id/endpoint_text" + android:layout_below="@+id/persistent_keepalive_text" android:layout_marginTop="8dp" android:labelFor="@+id/transfer_text" android:text="@string/transfer" @@ -182,7 +182,7 @@ <TextView android:id="@+id/transfer_text" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/transfer_label" android:contentDescription="@string/transfer" @@ -194,6 +194,34 @@ app:layout_constraintTop_toBottomOf="@+id/transfer_label" tools:text="1024 MB" tools:visibility="visible" /> + + <TextView + android:id="@+id/latest_handshake_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/transfer_text" + android:layout_marginTop="8dp" + android:labelFor="@+id/latest_handshake_text" + android:text="@string/latest_handshake" + android:visibility="gone" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/transfer_text" + tools:visibility="visible" /> + + <TextView + android:id="@+id/latest_handshake_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/latest_handshake_label" + android:contentDescription="@string/latest_handshake" + android:nextFocusUp="@id/transfer_text" + android:onClick="@{ClipboardUtils::copyTextView}" + android:textAppearance="?attr/textAppearanceBodyLarge" + android:visibility="gone" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/latest_handshake_label" + tools:text="4 minutes, 27 seconds ago" + tools:visibility="visible" /> </androidx.constraintlayout.widget.ConstraintLayout> </com.google.android.material.card.MaterialCardView> </layout> 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 @@ <data> + <import type="android.os.Build" /> + <import type="com.wireguard.android.util.ClipboardUtils" /> <import type="com.wireguard.android.widget.KeyInputFilter" /> @@ -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}" /> </com.google.android.material.textfield.TextInputLayout> @@ -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" /> </com.google.android.material.textfield.TextInputLayout> + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/http_proxy_menu" + style="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="4dp" + android:hint="@string/http_proxy" + app:expandedHintEnabled="false" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/dns_servers_label_layout"> + + <AutoCompleteTextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="none" + android:text="@={config.interface.httpProxyMenu}" + /> + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/http_proxy_hostname_label_layout" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="4dp" + android:hint="@string/http_proxy_hostname" + android:visibility="@{config.interface.httpProxyManualVisibility}" + app:layout_constraintEnd_toStartOf="@id/http_proxy_port_label_layout" + app:layout_constraintHorizontal_chainStyle="spread" + app:layout_constraintHorizontal_weight="0.7" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/http_proxy_menu"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/http_proxy_hostname_text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:imeOptions="actionNext" + android:inputType="textNoSuggestions|textVisiblePassword" + android:nextFocusUp="@id/mtu_text" + android:nextFocusDown="@id/set_excluded_applications" + android:nextFocusForward="@id/http_proxy_port_text" + android:text="@={config.interface.httpProxyHostname}" /> + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/http_proxy_port_label_layout" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="4dp" + android:hint="@string/http_proxy_port" + android:visibility="@{config.interface.httpProxyManualVisibility}" + app:expandedHintEnabled="false" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_weight="0.3" + app:layout_constraintStart_toEndOf="@id/http_proxy_hostname_label_layout" + app:layout_constraintTop_toBottomOf="@id/http_proxy_menu"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/http_proxy_port_text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:imeOptions="actionDone" + android:nextFocusUp="@id/mtu_text" + android:nextFocusDown="@id/http_proxy_pac_label_layout" + android:nextFocusForward="@id/http_proxy_pac_label_layout" + android:text="@={config.interface.httpProxyPort}" + android:textAlignment="center" /> + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/http_proxy_pac_label_layout" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="4dp" + android:hint="@string/http_proxy_pac" + android:visibility="@{config.interface.httpProxyPacVisibility}" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/http_proxy_hostname_label_layout"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/http_proxy_pac_text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:imeOptions="actionNext" + android:inputType="textNoSuggestions|textVisiblePassword" + android:nextFocusUp="@id/http_proxy_hostname_text" + android:nextFocusDown="@id/set_excluded_applications" + android:nextFocusForward="@id/set_excluded_applications" + android:text="@={config.interface.httpProxyPac}" /> + </com.google.android.material.textfield.TextInputLayout> + <com.google.android.material.button.MaterialButton android:id="@+id/set_excluded_applications" style="@style/Widget.Material3.Button.TextButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="4dp" - android:nextFocusUp="@id/dns_servers_text" + android:nextFocusUp="@id/http_proxy_hostname_text" android:nextFocusDown="@id/peers_layout" android:nextFocusForward="@id/peers_layout" android:onClick="@{fragment::onRequestSetExcludedIncludedApplications}" @@ -256,7 +351,7 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/mtu_label_layout" + app:layout_constraintTop_toBottomOf="@id/http_proxy_pac_label_layout" app:rippleColor="?attr/colorSecondary" tools:text="4 excluded applications" /> </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/ui/src/main/res/values-ar-rSA/strings.xml b/ui/src/main/res/values-ar-rSA/strings.xml index 755fd117..32bf386f 100644 --- a/ui/src/main/res/values-ar-rSA/strings.xml +++ b/ui/src/main/res/values-ar-rSA/strings.xml @@ -111,6 +111,8 @@ <string name="tv_select_a_storage_drive">تحديد محرك تخزين</string> <string name="tv_no_file_picker">الرجاء تثبيت مدير ملفات لتتمكن من تصفح الملفات</string> <string name="tv_add_tunnel_get_started">أضف نفقاً لتبدأ</string> + <string name="donate_title">♥️ تبرع لمشروع وايرجارد</string> + <string name="donate_summary">كل مساهمة تساعد</string> <string name="disable_config_export_title">تعطيل تصدير التكوين</string> <string name="disable_config_export_description">تعطيل تصدير الإعدادات يجعل المفاتيح الخاصة غير متاحة</string> <string name="dns_servers">خوادم DNS</string> @@ -120,6 +122,7 @@ <string name="error_down">خطأ في فصل النفق:%s</string> <string name="error_fetching_apps">خطأ في جلب قائمة التطبيقات: %s</string> <string name="error_root">الرجاء الحصول على صلاحيات الروت وحاول مرة أخرى</string> + <string name="error_prepare">خطأ في تحضير النفق: %s</string> <string name="error_up">خطأ خلال إنشاء النفق: %s</string> <string name="exclude_private_ips">استبعاد عناوين بروتوكول الإنترنت (IP) الخاصة</string> <string name="generate_new_private_key">توليد مفتاح خاص جديد</string> @@ -215,6 +218,7 @@ <string name="tunnel_create_success">تم إنشاء نفق \"%s\" بنجاح</string> <string name="tunnel_error_already_exists">النفق \"%s\" موجود بالفعل</string> <string name="tunnel_error_invalid_name">إسم غير صالح</string> + <string name="tunnel_list_placeholder">أضف نفق باستخدام الزر أدناه</string> <string name="tunnel_name">إسم النفق</string> <string name="tunnel_on_error">غير قادر على تشغيل النفق (wgTurnOn أعاد %d)</string> <string name="tunnel_dns_failure">غير قادر على حل اسم مضيف نظام أسماء النطاقات (DNS hostname): \"%s\"</string> diff --git a/ui/src/main/res/values-da-rDK/strings.xml b/ui/src/main/res/values-da-rDK/strings.xml index 371c23fe..98f8de6e 100644 --- a/ui/src/main/res/values-da-rDK/strings.xml +++ b/ui/src/main/res/values-da-rDK/strings.xml @@ -72,6 +72,8 @@ <string name="config_file_exists_error">Konfigurationsfilen \"%s\" findes allerede</string> <string name="config_not_found_error">Konfigurationsfilen \"%s\" blev ikke fundet</string> <string name="config_rename_error">Kan ikke omdøbe konfigurationsfilen \"%s\"</string> + <string name="config_save_error">Kan ikke gemme konfigurationen for \"%1$s\": %2$s</string> + <string name="config_save_success">Konfiguration for \"%s\" blev gemt</string> <string name="create_activity_title">Opret WireGuard tunnel</string> <string name="create_empty">Opret fra ny</string> <string name="create_from_file">Importér fra fil eller arkiv</string> @@ -88,6 +90,7 @@ <string name="dns_search_domains">DNS-søgedomæner</string> <string name="edit">Redigér</string> <string name="endpoint">Slutpunkt</string> + <string name="error_prepare">Fejl ved forberedelse af tunnel: %s</string> <string name="error_up">Fejl under aktivering af tunnel: %s</string> <string name="exclude_private_ips">Eksludér private IP-adresser</string> <string name="generate_new_private_key">Generér ny privat nøgle</string> @@ -152,6 +155,7 @@ <string name="tunnel_create_success">Tunnelen blev succesfuldt oprettet \"%s\"</string> <string name="tunnel_error_already_exists">Tunnel \"%s\" eksisterer allerede</string> <string name="tunnel_error_invalid_name">Ugyldigt navn</string> + <string name="tunnel_list_placeholder">Tilføj en tunnel ved hjælp af knappen nedenfor</string> <string name="tunnel_name">Tunnel Navn</string> <string name="tunnel_dns_failure">Kunne ikke opslå DNS adresse: \"%s\"</string> <string name="tunnel_rename_error">Kan ikke omdøbe tunnel: %s</string> diff --git a/ui/src/main/res/values-no-rNO/strings.xml b/ui/src/main/res/values-no-rNO/strings.xml index 8596017e..ca51975e 100644 --- a/ui/src/main/res/values-no-rNO/strings.xml +++ b/ui/src/main/res/values-no-rNO/strings.xml @@ -21,7 +21,7 @@ <item quantity="other">Importerte %d tunneler</item> </plurals> <plurals name="set_excluded_applications"> - <item quantity="one">%d ekskludert program</item> + <item quantity="one">%d ekskludert app</item> <item quantity="other">%d ekskluderte apper</item> </plurals> <plurals name="set_included_applications"> @@ -79,6 +79,8 @@ <string name="bad_config_reason_unknown_section">Ukjent seksjon</string> <string name="bad_config_reason_value_out_of_range">Verdien er utenfor gyldig område</string> <string name="bad_extension_error">Filen må være .conf eller .zip</string> + <string name="error_no_qr_found">Ingen QR-kode funnet i bildet</string> + <string name="error_qr_checksum">Feil ved sjekksumverifisering av QR-kode</string> <string name="cancel">Avbryt</string> <string name="config_delete_error">Kan ikke slette konfigurasjonsfilen %s</string> <string name="config_exists_error">Konfigurasjon for «%s» finnes allerede</string> @@ -105,14 +107,19 @@ <string name="tv_select_a_storage_drive">Velg en lagringsenhet</string> <string name="tv_no_file_picker">Vennligst installer et filhåndteringsverktøy for å bla i filer</string> <string name="tv_add_tunnel_get_started">Opprett en ny tunnel for å komme i gang</string> + <string name="donate_title">♥ Donér til WireGuard-prosjektet</string> + <string name="donate_summary">Hvert bidrag hjelper</string> + <string name="donate_google_play_disappointment">Takk for at du støtter WireGuard-prosjektet!\n\nPå grunn av Googles retningslinjer, kan vi dessverre ikke linke til den delen av prosjektets nettside der du kan donere. Forhåpentligvis klarer du å finne denne selv!\n\nVi takker igjen for ditt bidrag.</string> <string name="disable_config_export_title">Deaktiver eksport av konfigurasjon</string> <string name="disable_config_export_description">Deaktivering av konfigurasjonseksport gjør private nøkler mindre tilgjengelig</string> <string name="dns_servers">DNS tjenere</string> + <string name="dns_search_domains">Søk gjennom domener</string> <string name="edit">Rediger</string> <string name="endpoint">Endepunkt</string> <string name="error_down">Feil når tunnel skulle tas ned: %s</string> <string name="error_fetching_apps">Feil ved henting av applikasjonsliste: %s</string> <string name="error_root">Vennligst få root-tilgang og prøv igjen</string> + <string name="error_prepare">Feil ved klargjøring av tunnel: %s</string> <string name="error_up">Feil når tunnel skulle tas opp: %s</string> <string name="exclude_private_ips">Utelukk private IP-adresser</string> <string name="generate_new_private_key">Lag ny privat nøkkel</string> @@ -210,13 +217,16 @@ <string name="tunnel_create_success">Opprettet tunnelen «%s»</string> <string name="tunnel_error_already_exists">Tunnel «%s» finnes allerede</string> <string name="tunnel_error_invalid_name">Ugyldig navn</string> + <string name="tunnel_list_placeholder">Legg til en tunnel ved å bruke knappen under</string> <string name="tunnel_name">Tunnelnavn</string> <string name="tunnel_on_error">Kan ikke slå på tunnel (wgTurnOn returnerte %d)</string> + <string name="tunnel_dns_failure">Kan ikke slå opp DNS-vertsnavn: “%s\"</string> <string name="tunnel_rename_error">Kan ikke endre navn på tunnel: %s</string> <string name="tunnel_rename_success">Endret navn på tunnelen til «%s»</string> <string name="type_name_go_userspace">Bruk userspace</string> <string name="type_name_kernel_module">Kjernemodul</string> <string name="unknown_error">Ukjent feil</string> + <string name="version_summary">%1$s backend %2$s</string> <string name="version_summary_checking">Sjekker %s backend versjon</string> <string name="version_summary_unknown">Ukjent %s versjon</string> <string name="version_title">WireGuard for Android v%s</string> diff --git a/ui/src/main/res/values-ru/strings.xml b/ui/src/main/res/values-ru/strings.xml index ba7d4557..fd747768 100644 --- a/ui/src/main/res/values-ru/strings.xml +++ b/ui/src/main/res/values-ru/strings.xml @@ -133,6 +133,9 @@ <string name="tv_select_a_storage_drive">Выберите накопитель</string> <string name="tv_no_file_picker">Пожалуйста, установите утилиту управления файлами для их просмотра</string> <string name="tv_add_tunnel_get_started">Добавьте туннель, чтобы начать</string> + <string name="donate_title">♥ Пожертвовать проекту WireGuard</string> + <string name="donate_summary">Каждое пожертвование помогает</string> + <string name="donate_google_play_disappointment">Спасибо за поддержку проекта WireGuard!\n\nК сожалению, из-за политики Google, нельзя размещать ссылку на тот раздел сайта проекта, где можно сделать пожертвование. Надеемся, вы сможете разобраться самостоятельно!\n\nЕщё раз спасибо за ваш вклад.</string> <string name="disable_config_export_title">Отключить экспорт конфигурации</string> <string name="disable_config_export_description">Отключение экспорта конфигурации делает приватные ключи менее доступными</string> <string name="dns_servers">DNS-серверы</string> @@ -142,6 +145,7 @@ <string name="error_down">Ошибка при выходе из туннеля: %s</string> <string name="error_fetching_apps">Ошибка при получении списка приложений: %s</string> <string name="error_root">Пожалуйста, получите root-доступ и попробуйте снова</string> + <string name="error_prepare">Ошибка при подготовке туннеля: %s</string> <string name="error_up">Ошибка при запуске туннеля: %s</string> <string name="exclude_private_ips">Исключить частные IP-адреса</string> <string name="generate_new_private_key">Сгенерировать новый приватный ключ</string> @@ -161,6 +165,8 @@ <string name="key_length_explanation_base64">: ключи WireGuard base64 должны содержать 44 символа (32 байта)</string> <string name="key_length_explanation_binary">: ключи WireGuard должны быть 32 байта</string> <string name="key_length_explanation_hex">: HEX-ключи WireGuard должны содержать 64 символа (32 байта)</string> + <string name="latest_handshake">Последнее рукопожатие</string> + <string name="latest_handshake_ago">%s назад</string> <string name="listen_port">Порт</string> <string name="log_export_error">Не удалось экспортировать журнал: %s</string> <string name="log_export_subject">Файл журнала WireGuard Android</string> @@ -239,6 +245,7 @@ <string name="tunnel_create_success">Успешно создан туннель “%s”</string> <string name="tunnel_error_already_exists">Туннель “%s” уже существует</string> <string name="tunnel_error_invalid_name">Неправильное имя</string> + <string name="tunnel_list_placeholder">Добавьте туннель с помощью кнопки ниже</string> <string name="tunnel_name">Название туннеля</string> <string name="tunnel_on_error">Не удалось включить туннель (wgTurnOn вернул %d)</string> <string name="tunnel_dns_failure">Не удалось определить DNS имя: “%s”</string> diff --git a/ui/src/main/res/values-zh-rCN/strings.xml b/ui/src/main/res/values-zh-rCN/strings.xml index 88dedc74..4b30afca 100644 --- a/ui/src/main/res/values-zh-rCN/strings.xml +++ b/ui/src/main/res/values-zh-rCN/strings.xml @@ -106,6 +106,7 @@ <string name="error_down">断开连接时出错:%s</string> <string name="error_fetching_apps">获取应用列表时出错:%s</string> <string name="error_root">请获取 root 权限并重试</string> + <string name="error_prepare">准备连接时出错:%s</string> <string name="error_up">建立连接时出错:%s</string> <string name="exclude_private_ips">排除局域网</string> <string name="generate_new_private_key">生成新的私钥</string> @@ -125,6 +126,8 @@ <string name="key_length_explanation_base64">:WireGuard 的 Base64 密钥长度必须为 44 个字符(32 字节)</string> <string name="key_length_explanation_binary">:WireGuard 密钥大小必须为 32 字节</string> <string name="key_length_explanation_hex">:WireGuard 的十六进制密钥长度必须为 64 个字符(32 字节)</string> + <string name="latest_handshake">上次握手时间</string> + <string name="latest_handshake_ago">%s之前</string> <string name="listen_port">监听端口</string> <string name="log_export_error">无法导出日志:%s</string> <string name="log_export_subject">WireGuard 日志文件</string> diff --git a/ui/src/main/res/values/dimens.xml b/ui/src/main/res/values/dimens.xml index ddb4deac..8ea07dfb 100644 --- a/ui/src/main/res/values/dimens.xml +++ b/ui/src/main/res/values/dimens.xml @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="fab_margin">16dp</dimen> - <dimen name="extra_margin">12dp</dimen> <dimen name="bottom_sheet_item_height">56dp</dimen> <dimen name="normal_margin">8dp</dimen> <dimen name="bottom_sheet_top_padding">8dp</dimen> diff --git a/ui/src/main/res/values/strings.xml b/ui/src/main/res/values/strings.xml index 7710a879..e461dc31 100644 --- a/ui/src/main/res/values/strings.xml +++ b/ui/src/main/res/values/strings.xml @@ -70,6 +70,7 @@ <string name="bad_config_explanation_pka">: Must be positive and no more than 65535</string> <string name="bad_config_explanation_positive_number">: Must be positive</string> <string name="bad_config_explanation_udp_port">: Must be a valid UDP port number</string> + <string name="bad_config_explanation_http_proxy">: Must be valid proxy hostname and port</string> <string name="bad_config_reason_invalid_key">Invalid key</string> <string name="bad_config_reason_invalid_number">Invalid number</string> <string name="bad_config_reason_invalid_value">Invalid value</string> @@ -104,6 +105,7 @@ <string name="dark_theme_summary_on">Currently using dark (night) theme</string> <string name="dark_theme_title">Use dark theme</string> <string name="delete">Delete</string> + <string name="dynamic_addresses">Dynamic addresses</string> <string name="tv_delete">Select tunnel to delete</string> <string name="tv_select_a_storage_drive">Select a storage drive</string> <string name="tv_no_file_picker">Please install a file management utility to browse files</string> @@ -130,6 +132,10 @@ <string name="hint_optional">(optional)</string> <string name="hint_optional_discouraged">(optional, not recommended)</string> <string name="hint_random">(random)</string> + <string name="http_proxy">Proxy</string> + <string name="http_proxy_hostname">Proxy hostname</string> + <string name="http_proxy_pac">Proxy Auto-Config URL</string> + <string name="http_proxy_port">Proxy port</string> <string name="illegal_filename_error">Illegal file name “%s”</string> <string name="import_error">Unable to import tunnel: %s</string> <string name="import_from_qr_code">Import Tunnel from QR Code</string> @@ -140,6 +146,8 @@ <string name="key_length_explanation_base64">: WireGuard base64 keys must be 44 characters (32 bytes)</string> <string name="key_length_explanation_binary">: WireGuard keys must be 32 bytes</string> <string name="key_length_explanation_hex">: WireGuard hex keys must be 64 characters (32 bytes)</string> + <string name="latest_handshake">Latest handshake</string> + <string name="latest_handshake_ago">%s ago</string> <string name="listen_port">Listen port</string> <string name="log_export_error">Unable to export log: %s</string> <string name="log_export_subject">WireGuard Android Log File</string> |