diff options
author | Fabian Henneke <FabianHenneke@users.noreply.github.com> | 2020-08-11 18:11:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-11 18:11:39 +0200 |
commit | 15aa92980239d6d61c3b0febc0407b7f63e152b3 (patch) | |
tree | 92b25ea3bca41e37fe4727bab82665b04ee8206e /app/src/main/res | |
parent | 8f957ca99454efe1711e2424620d2632bed6cb63 (diff) |
Switch to URL-based Git config and refactor Git settings (#1008)
* Make Git config URL-based and refactor
* Use Kotlin style null handling for string prefs
* Also show an error if generated URL can't be parsed
* Add some testcases for migration strategy
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/activity_git_clone.xml | 68 | ||||
-rw-r--r-- | app/src/main/res/values-ar/strings.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values-cs/strings.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values-de/strings.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values-es/strings.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values-fr/strings.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values-ja/strings.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values-pt-rBR/strings.xml | 5 | ||||
-rw-r--r-- | app/src/main/res/values-ru/strings.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values-zh-rCN/strings.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values-zh-rTW/strings.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 8 |
12 files changed, 7 insertions, 110 deletions
diff --git a/app/src/main/res/layout/activity_git_clone.xml b/app/src/main/res/layout/activity_git_clone.xml index f9bec00a..7c59572c 100644 --- a/app/src/main/res/layout/activity_git_clone.xml +++ b/app/src/main/res/layout/activity_git_clone.xml @@ -66,77 +66,17 @@ </com.google.android.material.button.MaterialButtonToggleGroup> <com.google.android.material.textfield.TextInputLayout - android:id="@+id/server_user_layout" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_margin="8dp" - android:hint="@string/server_user" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/clone_protocol_group"> - - <com.google.android.material.textfield.TextInputEditText - android:id="@+id/server_user" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:imeOptions="actionNext" - android:inputType="textWebEmailAddress" - android:nextFocusForward="@id/server_url" /> - </com.google.android.material.textfield.TextInputLayout> - - <com.google.android.material.textfield.TextInputLayout android:id="@+id/label_server_url" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="8dp" android:hint="@string/server_url" - app:layout_constraintEnd_toStartOf="@id/label_server_port" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/server_user_layout"> - - <com.google.android.material.textfield.TextInputEditText - android:id="@+id/server_url" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:imeOptions="actionNext" - android:inputType="textWebEmailAddress" - android:nextFocusForward="@id/server_port" /> - - </com.google.android.material.textfield.TextInputLayout> - - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/label_server_port" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_margin="8dp" - android:hint="@string/server_port_hint" - app:layout_constraintDimensionRatio="1:0.8" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toEndOf="@id/label_server_url" - app:layout_constraintTop_toBottomOf="@id/server_user_layout"> - - <com.google.android.material.textfield.TextInputEditText - android:id="@+id/server_port" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:imeOptions="actionNext" - android:inputType="number" - android:nextFocusForward="@id/server_path" /> - - </com.google.android.material.textfield.TextInputLayout> - - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/label_server_path" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_margin="8dp" - android:hint="@string/server_path" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/label_server_url"> + app:layout_constraintTop_toBottomOf="@id/clone_protocol_group"> <com.google.android.material.textfield.TextInputEditText - android:id="@+id/server_path" + android:id="@+id/server_url" android:layout_width="match_parent" android:layout_height="wrap_content" android:imeOptions="actionNext" @@ -150,10 +90,10 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="8dp" - android:hint="Branch" + android:hint="@string/server_branch" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@id/label_server_path"> + app:layout_constraintTop_toBottomOf="@id/label_server_url"> <com.google.android.material.textfield.TextInputEditText android:id="@+id/server_branch" diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 643c1641..695a7499 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -29,10 +29,6 @@ <string name="initialize">إستخدام مجلد محلي</string> <string name="server_name">الخادوم</string> <string name="server_protocol">البروتوكول</string> - <string name="server_url">عنوان الخادوم</string> - <string name="server_port_hint">22</string> - <string name="server_path">مسار المستودع</string> - <string name="server_user">إسم المستخدم</string> <string name="connection_mode">نوع المصادقة</string> diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 0ed0bcea..3c4df560 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -57,10 +57,6 @@ <string name="external_repository_dialog_title">Vyberte kam ukládat hesla</string> <string name="server_name">Server</string> <string name="server_protocol">Protokol</string> - <string name="server_url">URL serveru</string> - <string name="server_port_hint">22</string> - <string name="server_path">Cesta k repozitáři</string> - <string name="server_user">Jméno</string> <string name="connection_mode">Mód ověření</string> diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index cdfb7dba..fd94c8a9 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -40,10 +40,6 @@ <string name="initialize">Nutze lokalen Ordner</string> <string name="server_name">Server</string> <string name="server_protocol">Protokoll</string> - <string name="server_url">Server URL</string> - <string name="server_port_hint">22</string> - <string name="server_path">Repo-Pfad</string> - <string name="server_user">Nutzername</string> <string name="connection_mode">Authentifizierungsmethode</string> diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 780e83ca..ff04cf3e 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -54,10 +54,6 @@ <string name="server_name">Servidor</string> <string name="server_protocol">Protocolo</string> - <string name="server_url">URL de servidor</string> - <string name="server_port_hint">22</string> - <string name="server_path">Ruta del repositorio</string> - <string name="server_user">Nombre de usuario</string> <string name="connection_mode">Modo de autenticación</string> diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 19fbdb33..9f9e1768 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -60,10 +60,6 @@ <string name="server_name">Serveur</string> <string name="server_protocol">Protocole</string> - <string name="server_url">URL du serveur</string> - <string name="server_port_hint">22</string> - <string name="server_path">Chemin du dépôt</string> - <string name="server_user">Nom d\'utilisateur</string> <string name="connection_mode">Méthode d\'authentification</string> diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index e0e84cda..132ecad4 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -41,10 +41,6 @@ <string name="initialize">ローカルディレクトリーを使用する</string> <string name="server_name">サーバー</string> <string name="server_protocol">プロトコル</string> - <string name="server_url">サーバー URL</string> - <string name="server_port_hint">22</string> - <string name="server_path">リポジトリのパス</string> - <string name="server_user">ユーザー名</string> <string name="connection_mode">認証モード</string> diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 8ed71353..79edf2d9 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -68,10 +68,6 @@ <string name="external_repository_dialog_text">Você deve selecionar um diretório onde armazenar suas senhas. Se você deseja armazenar suas senhas dentro do armazenamento oculto do aplicativo, cancele esta caixa de diálogo e desative a opção \"Repositório Externo\".</string> <string name="server_name">Servidor</string> <string name="server_protocol">Protocolo</string> - <string name="server_url">URL do servidor</string> - <string name="server_port_hint">Porta</string> - <string name="server_path">Caminho do repositório</string> - <string name="server_user">Usuário</string> <string name="connection_mode">Modo de autenticação</string> <!-- Git Config fragment --> <string name="git_user_name_hint">Usuário</string> @@ -295,7 +291,6 @@ <string name="connection_mode_ssh_key">Chave SSH</string> <string name="connection_mode_basic_authentication">Senha</string> <string name="git_server_config_save_success">Configuração salva com sucesso</string> - <string name="git_server_config_save_error_prefix">Erro de configuração: %s</string> <string name="git_config_error_hostname_empty">hostname vazio</string> <string name="git_config_error_generic">por favor, verifique suas configurações e tente novamente</string> <string name="git_config_error_nonnumeric_port">porta deve ser numérica</string> diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 7a46da75..596e1c14 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -62,10 +62,6 @@ <string name="server_name">Сервер</string> <string name="server_protocol">Протокол</string> - <string name="server_url">URL сервера</string> - <string name="server_port_hint">22</string> - <string name="server_path">Путь к репозиторию</string> - <string name="server_user">Имя пользователя</string> <string name="connection_mode">Тип авторизации</string> diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 343d5855..e7899c76 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -41,10 +41,6 @@ <string name="initialize">使用本地目录</string> <string name="server_name">服务器</string> <string name="server_protocol">接口</string> - <string name="server_url">服务器 URL</string> - <string name="server_port_hint">22</string> - <string name="server_path">Repo 路径</string> - <string name="server_user">用户名</string> <string name="connection_mode">认证模式</string> diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index bbc9672a..572d67da 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -38,10 +38,6 @@ <string name="initialize">使用本機目錄</string> <string name="server_name">伺服器</string> <string name="server_protocol">port</string> - <string name="server_url">伺服器 URL</string> - <string name="server_port_hint">22</string> - <string name="server_path">Repo 路徑</string> - <string name="server_user">使用者名稱</string> <string name="connection_mode">認證模式</string> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9251d91e..46dfa401 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -83,10 +83,8 @@ <string name="server_name">Server</string> <string name="server_protocol">Protocol</string> - <string name="server_url">Server URL</string> - <string name="server_port_hint">Port</string> - <string name="server_path">Repo path</string> - <string name="server_user">Username</string> + <string name="server_url">Repository URL</string> + <string name="server_branch">Branch</string> <string name="connection_mode">Authentication Mode</string> @@ -326,7 +324,7 @@ <string name="connection_mode_basic_authentication">Password</string> <string name="connection_mode_openkeychain" translatable="false">OpenKeychain</string> <string name="git_server_config_save_success">Successfully saved configuration</string> - <string name="git_server_config_save_error_prefix">Configuration error: %s</string> + <string name="git_server_config_save_error">The provided repository URL is not valid</string> <string name="git_config_error_hostname_empty">empty hostname</string> <string name="git_config_error_generic">please verify your settings and try again</string> <string name="git_config_error_nonnumeric_port">port must be numeric</string> |