aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-10-08 17:15:39 +0530
committerGitHub <noreply@github.com>2020-10-08 17:15:39 +0530
commitb4f6fc502acf69e7f6f63354d07a8c07939f36ba (patch)
tree8a4131c13b545a68bf2140c47d97fdd3aab57a9d /app/src/main/res
parent0d6b7f1842a90bfefbe6f47725871a7d70ba31fb (diff)
Introduce app-wide HTTPS proxy setting (#1134)
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/layout/activity_proxy_selector.xml106
-rw-r--r--app/src/main/res/values/strings.xml12
-rw-r--r--app/src/main/res/xml/preference.xml3
3 files changed, 118 insertions, 3 deletions
diff --git a/app/src/main/res/layout/activity_proxy_selector.xml b/app/src/main/res/layout/activity_proxy_selector.xml
new file mode 100644
index 00000000..e732dfe0
--- /dev/null
+++ b/app/src/main/res/layout/activity_proxy_selector.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
+ ~ SPDX-License-Identifier: GPL-3.0-only
+ -->
+
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/proxy_host_input_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/activity_horizontal_margin"
+ android:layout_marginTop="@dimen/activity_vertical_margin"
+ android:layout_marginEnd="@dimen/activity_horizontal_margin"
+ android:hint="@string/proxy_hostname"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ tools:layout_editor_absoluteY="64dp">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/proxy_host"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="textUri"
+ android:nextFocusForward="@id/proxy_user" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/proxy_user_input_layout"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/activity_horizontal_margin"
+ android:layout_marginTop="@dimen/normal_margin"
+ android:layout_marginEnd="@dimen/normal_margin"
+ android:hint="@string/username"
+ app:layout_constraintEnd_toStartOf="@id/proxy_port_input_layout"
+ app:layout_constraintHorizontal_weight="0.65"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/proxy_host_input_layout">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/proxy_user"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="textWebEmailAddress"
+ android:nextFocusForward="@id/proxy_port" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/proxy_port_input_layout"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/normal_margin"
+ android:layout_marginTop="@dimen/normal_margin"
+ android:layout_marginEnd="@dimen/activity_horizontal_margin"
+ android:hint="@string/port"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_weight="0.35"
+ app:layout_constraintStart_toEndOf="@id/proxy_user_input_layout"
+ app:layout_constraintTop_toBottomOf="@id/proxy_host_input_layout">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/proxy_port"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="number"
+ android:nextFocusForward="@id/proxy_password" />
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/proxy_password_input_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/activity_horizontal_margin"
+ android:layout_marginTop="@dimen/normal_margin"
+ android:layout_marginEnd="@dimen/activity_horizontal_margin"
+ android:hint="@string/password"
+ app:endIconMode="password_toggle"
+ app:layout_constraintStart_toStartOf="@id/proxy_user_input_layout"
+ app:layout_constraintTop_toBottomOf="@id/proxy_user_input_layout">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/proxy_password"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="textPassword" />
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/save"
+ style="@style/AppTheme.OutlinedButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/normal_margin"
+ android:layout_marginEnd="@dimen/activity_horizontal_margin"
+ android:text="@string/crypto_save"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/proxy_password_input_layout" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 4ed3ee52..cc9f1f24 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -100,10 +100,10 @@
<!-- DECRYPT Layout -->
<string name="action_search">Search</string>
- <string name="password">Password:</string>
- <string name="otp">OTP:</string>
+ <string name="password">Password</string>
+ <string name="otp">OTP</string>
<string name="extra_content">Extra content:</string>
- <string name="username">Username:</string>
+ <string name="username">Username</string>
<string name="edit_password">Edit password</string>
<string name="copy_password">Copy password</string>
<string name="share_as_plaintext">Share as plaintext</string>
@@ -408,4 +408,10 @@
<string name="ssh_scheme_needed_title">Potentially incorrect URL</string>
<string name="ssh_scheme_needed_message">It appears that your URL contains a custom port, but does not specify the ssh:// scheme.\nThis can cause the port to be considered a part of your path. Press OK here to fix the URL.</string>
+ <!-- Proxy configuration activity -->
+ <string name="proxy_hostname">Proxy hostname</string>
+ <string name="port">Port</string>
+ <string name="pref_proxy_settings">HTTP(S) proxy settings</string>
+ <string name="invalid_proxy_url">Invalid URL</string>
+
</resources>
diff --git a/app/src/main/res/xml/preference.xml b/app/src/main/res/xml/preference.xml
index 1d82df18..58a173c5 100644
--- a/app/src/main/res/xml/preference.xml
+++ b/app/src/main/res/xml/preference.xml
@@ -49,6 +49,9 @@
app:key="git_server_info"
app:title="@string/pref_edit_server_info" />
<Preference
+ app:key="proxy_settings"
+ app:title="@string/pref_proxy_settings" />
+ <Preference
app:key="git_config"
app:title="@string/pref_edit_git_config" />
<Preference