diff options
author | Harsh Shandilya <msfjarvis@gmail.com> | 2020-04-17 18:36:07 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 18:36:07 +0530 |
commit | b94b52a42ddc2325b539d0956fd0adcf35308b52 (patch) | |
tree | 21f35526cfc444db82e1b4b08d083e49a3c1843b /app/src/main/res | |
parent | 4ffd7ed9bffa5139277ffb91de5a69f2b714222c (diff) |
Refactor Git related activities (#685)
* Refactor git logic into separate parts
* Extract hardcoded strings
* Add KDoc to updateHostname, remove unused field
* Cleanups
* Fix dialog message
* Wire in repository clone flow
* spotless
* Remove unused method
* Cleanup GitActivity
- Rename to GitOperationActivity.
- Ensure identityBuilder is always closed regardless of what fragment uses it.
- Remove hardcoded "Operation" strings and replace with REQUEST_ARG_OP.
- Apply a transparent theme to GitOperationActivity make the UI less jarring.
* Tweak some stupidly worded dialog messages
As pointed out in #629, these strings are shoddily worded and do not express any clear intent to the
user, leaving them confused and angry.
* GitOperationActivity: wrap Context to ensure right theme is used
* spotless
* undo build.gradle change
* Use correct parent theme, remove now useless wrapping
* GitServerConfigActivity: fix repository clone flow
* temp: disable leakcanary
framework leaks on Samsung are pissing me off
* Make system bars transparent in git activity
* Tweak HTTPS password layout
* Unhardcode wrong passphrase string
* Store SSH passphrase in EncryptedSharedPreferences
Also revamp the dialog to look a bit better
* Implement support for remembering HTTPS password
Fixes #521
* Try to patch HTTPS remote creation logic
* Update security-crypto
* Clear saved passphrase/password on auth failure
* Revert "Update security-crypto"
Broken on R DP2.1
This reverts commit 4b20371dd42c512a3dd3b759859abb6c1ffd2961.
* Revert "temp: disable leakcanary"
This reverts commit 2db7d41bd67b79c6dc8c5b359a7b27100379f45f.
* Update CHANGELOG
* Remove spacer
* Remove useless override
* Wrap git server activity in a ScrollView
* GitOperation: always finish calling activity when dialogs are dismissed
* Wipe saved password/passphrase when hostname changes
* Don't commit prefs updates
* Don't call listFiles excessively
* Finish activity after saving configuration
* Make ConnectionMode and Protocol enum classes
* Change SSH key passphrase key, don't wipe on host change
* Reimplement BaseGitActivity.updateUrl (was updateHostname)
* Use SharedPreferences.edit KTX extension
* Disable inapplicable connection modes depending on scheme
* BaseGitActivity: annotate onDestroy with CallSuper
We'll leak the identityBuilder connection otherwise
* Move input hack for AlertDialog into an extension function
We re-use this in many places
* Fix protocol/mode toggle issue and consistenly name options
* Fix a crash when opening GitServerConfigActivity without a repo
* Fix OpenKeychain callbacks by moving onActivityResult to BaseGitActivity
* Run spotlessApply
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Fabian Henneke <fabian@henneke.me>
Diffstat (limited to 'app/src/main/res')
22 files changed, 260 insertions, 263 deletions
diff --git a/app/src/main/res/color/toggle_button_selector.xml b/app/src/main/res/color/toggle_button_selector.xml new file mode 100644 index 00000000..cb4de6a7 --- /dev/null +++ b/app/src/main/res/color/toggle_button_selector.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_checked="false" + android:color="#00FFFFFF" /> + <item android:color="@color/button_color" /> +</selector> diff --git a/app/src/main/res/drawable/bottom_line.xml b/app/src/main/res/drawable/bottom_line.xml deleted file mode 100644 index e67c96fa..00000000 --- a/app/src/main/res/drawable/bottom_line.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> - <item> - <shape android:shape="rectangle"> - <solid android:color="?android:attr/textColor"/> - </shape> - </item> - - <item android:bottom="2dp"> - <shape android:shape="rectangle"> - <solid android:color="?android:attr/windowBackground" /> - </shape> - </item> -</layer-list> diff --git a/app/src/main/res/drawable/red_rectangle.xml b/app/src/main/res/drawable/red_rectangle.xml deleted file mode 100644 index bec893f2..00000000 --- a/app/src/main/res/drawable/red_rectangle.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> - <item> - <shape android:shape="rectangle" - android:dither="true"> - <corners android:radius="2dp"/> - <solid android:color="#ccc" /> - - </shape> - </item> - - <item> - <shape android:shape="rectangle" android:dither="true"> - <corners android:radius="2dp" /> - <solid android:color="#FF0000" /> - - <padding android:bottom="8dp" - android:left="8dp" - android:right="8dp" - android:top="8dp" /> - </shape> - </item> -</layer-list> diff --git a/app/src/main/res/layout/activity_git_clone.xml b/app/src/main/res/layout/activity_git_clone.xml index 05d9a557..de9a240e 100644 --- a/app/src/main/res/layout/activity_git_clone.xml +++ b/app/src/main/res/layout/activity_git_clone.xml @@ -1,178 +1,216 @@ -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" +<ScrollView 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" - xmlns:app="http://schemas.android.com/apk/res-auto" android:padding="@dimen/activity_horizontal_margin" - tools:context="com.zeapo.pwdstore.git.GitActivity" + tools:context="com.zeapo.pwdstore.git.GitOperationActivity" android:background="?android:attr/windowBackground"> - <androidx.appcompat.widget.AppCompatTextView - style="@style/TextAppearance.MaterialComponents.Headline5" - android:id="@+id/server_label" - android:textStyle="bold" - android:textSize="24sp" - android:text="@string/server_name" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="8dp" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - - <androidx.appcompat.widget.AppCompatTextView - android:id="@+id/label_server_protocol" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/server_protocol" - android:layout_margin="8dp" - app:layout_constraintTop_toBottomOf="@id/server_label" - app:layout_constraintStart_toStartOf="parent" /> - - <Spinner - android:id="@+id/clone_protocol" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="8dp" - app:layout_constraintTop_toBottomOf="@id/server_label" - app:layout_constraintStart_toEndOf="@id/label_server_protocol" /> - - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/server_user_layout" - android:hint="@string/server_user" + <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="8dp" - app:layout_constraintTop_toBottomOf="@id/label_server_protocol"> - <com.google.android.material.textfield.TextInputEditText - android:id="@+id/server_user" + android:layout_height="wrap_content"> + + <androidx.appcompat.widget.AppCompatTextView + style="@style/TextAppearance.MaterialComponents.Headline5" + android:id="@+id/server_label" + android:textStyle="bold" + android:textSize="24sp" + android:text="@string/server_name" android:layout_width="match_parent" android:layout_height="wrap_content" - android:inputType="textWebEmailAddress" /> - </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_constraintTop_toBottomOf="@id/server_user_layout" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toStartOf="@id/label_server_port"> - - <com.google.android.material.textfield.TextInputEditText - android:layout_width="match_parent" + android:layout_margin="8dp" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <androidx.appcompat.widget.AppCompatTextView + style="@style/TextAppearance.MaterialComponents.Headline6" + android:id="@+id/label_server_protocol" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/server_protocol" + android:layout_margin="8dp" + app:layout_constraintTop_toBottomOf="@id/server_label" + app:layout_constraintStart_toStartOf="parent" /> + + <Spinner + android:id="@+id/clone_protocol" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="8dp" + android:visibility="gone" + app:layout_constraintTop_toBottomOf="@id/server_label" + app:layout_constraintStart_toEndOf="@id/label_server_protocol" /> + + <com.google.android.material.button.MaterialButtonToggleGroup + style="@style/TextAppearance.MaterialComponents.Headline1" + android:id="@+id/clone_protocol_group" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:id="@+id/server_url" - android:inputType="textWebEmailAddress" /> - - </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_constraintStart_toEndOf="@id/label_server_url" - app:layout_constraintTop_toBottomOf="@id/server_user_layout" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintDimensionRatio="1:0.8"> - - <com.google.android.material.textfield.TextInputEditText - android:id="@+id/server_port" + android:layout_margin="8dp" + app:layout_constraintTop_toBottomOf="@id/label_server_protocol" + app:layout_constraintStart_toStartOf="parent" + app:selectionRequired="true" + app:singleSelection="true"> + + <com.google.android.material.button.MaterialButton + style="?attr/materialButtonOutlinedStyle" + android:id="@+id/clone_protocol_ssh" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/clone_protocol_ssh" + android:textColor="?android:attr/textColorPrimary" + app:rippleColor="@color/ripple_color" + app:strokeColor="?attr/colorSecondary" + app:backgroundTint="@color/toggle_button_selector" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialButtonOutlinedStyle" + android:id="@+id/clone_protocol_https" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/clone_protocol_https" + android:textColor="?android:attr/textColorPrimary" + app:rippleColor="@color/ripple_color" + app:strokeColor="?attr/colorSecondary" + app:backgroundTint="@color/toggle_button_selector" /> + </com.google.android.material.button.MaterialButtonToggleGroup> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/server_user_layout" + android:hint="@string/server_user" android:layout_width="match_parent" android:layout_height="wrap_content" - android:inputType="number" /> - - </com.google.android.material.textfield.TextInputLayout> - - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/label_server_path" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="8dp" - android:hint="@string/server_path" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/label_server_url"> - - <com.google.android.material.textfield.TextInputEditText - android:id="@+id/server_path" + android:layout_margin="8dp" + 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:inputType="textWebEmailAddress" /> + </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_constraintTop_toBottomOf="@id/server_user_layout" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toStartOf="@id/label_server_port"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/server_url" + android:inputType="textWebEmailAddress" /> + + </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_constraintStart_toEndOf="@id/label_server_url" + app:layout_constraintTop_toBottomOf="@id/server_user_layout" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintDimensionRatio="1:0.8"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/server_port" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="number" /> + + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/label_server_path" android:layout_width="match_parent" android:layout_height="wrap_content" - android:inputType="textWebEmailAddress"/> - - </com.google.android.material.textfield.TextInputLayout> - - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/label_clone_uri" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:hint="@string/repository_uri" - android:editable="false" - android:layout_margin="8dp" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/label_server_path"> - - <com.google.android.material.textfield.TextInputEditText - android:id="@+id/clone_uri" + android:layout_margin="8dp" + android:hint="@string/server_path" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/label_server_url"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/server_path" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="textWebEmailAddress"/> + + </com.google.android.material.textfield.TextInputLayout> + + <androidx.appcompat.widget.AppCompatTextView + style="@style/TextAppearance.MaterialComponents.Headline6" + android:id="@+id/label_connection_mode" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/connection_mode" + android:layout_margin="8dp" + android:layout_marginTop="16dp" + android:layout_marginBottom="16dp" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/label_server_path" /> + + <com.google.android.material.button.MaterialButtonToggleGroup + android:id="@+id/connection_mode_group" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="8dp" + app:layout_constraintTop_toBottomOf="@id/label_connection_mode" + app:layout_constraintStart_toStartOf="parent" + app:selectionRequired="true" + app:singleSelection="true" > + + <com.google.android.material.button.MaterialButton + style="?attr/materialButtonOutlinedStyle" + android:id="@+id/connection_mode_ssh_key" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/connection_mode_ssh_key" + android:textColor="?android:attr/textColorPrimary" + app:rippleColor="@color/ripple_color" + app:strokeColor="?attr/colorSecondary" + app:backgroundTint="@color/toggle_button_selector" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialButtonOutlinedStyle" + android:id="@+id/connection_mode_password" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/connection_mode_basic_authentication" + android:textColor="?android:attr/textColorPrimary" + app:rippleColor="@color/ripple_color" + app:strokeColor="?attr/colorSecondary" + app:backgroundTint="@color/toggle_button_selector" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialButtonOutlinedStyle" + android:id="@+id/connection_mode_open_keychain" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/connection_mode_openkeychain" + android:textColor="?android:attr/textColorPrimary" + app:rippleColor="@color/ripple_color" + app:strokeColor="?attr/colorSecondary" + app:backgroundTint="@color/toggle_button_selector" /> + + </com.google.android.material.button.MaterialButtonToggleGroup> + + <com.google.android.material.button.MaterialButton + style="@style/Widget.MaterialComponents.Button" + android:id="@+id/save_button" + android:text="@string/crypto_save" android:layout_width="match_parent" android:layout_height="wrap_content" - android:inputType="textWebEmailAddress"/> - - </com.google.android.material.textfield.TextInputLayout> - - <androidx.appcompat.widget.AppCompatTextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@drawable/red_rectangle" - android:textColor="@android:color/white" - android:visibility="gone" - android:id="@+id/warn_url" - android:layout_margin="8dp" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/label_clone_uri"/> - - <androidx.appcompat.widget.AppCompatTextView - android:id="@+id/label_connection_mode" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/connection_mode" - android:layout_margin="16dp" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/warn_url" /> - - <Spinner - android:id="@+id/connection_mode" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="16dp" - app:layout_constraintTop_toBottomOf="@id/warn_url" - app:layout_constraintStart_toEndOf="@id/label_connection_mode" /> - - <com.google.android.material.button.MaterialButton - style="@style/Widget.MaterialComponents.Button" - android:id="@+id/clone_button" - android:text="@string/clone_button" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:onClick="cloneRepository" - android:textColor="?android:attr/windowBackground" - android:layout_marginTop="8dp" - app:backgroundTint="?attr/colorSecondary" - app:layout_constraintTop_toBottomOf="@id/label_connection_mode" - app:layout_constraintStart_toStartOf="parent" /> - - <com.google.android.material.button.MaterialButton - style="@style/Widget.MaterialComponents.Button" - android:id="@+id/save_button" - android:text="@string/crypto_save" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:onClick="saveConfiguration" - android:textColor="?android:attr/windowBackground" - android:layout_marginTop="8dp" - app:backgroundTint="?attr/colorSecondary" - app:layout_constraintTop_toBottomOf="@id/label_connection_mode" - app:layout_constraintStart_toStartOf="parent" /> -</androidx.constraintlayout.widget.ConstraintLayout> + android:textColor="?android:attr/windowBackground" + android:layout_marginTop="8dp" + app:backgroundTint="?attr/colorSecondary" + app:layout_constraintTop_toBottomOf="@id/connection_mode_group" + app:layout_constraintStart_toStartOf="parent" /> + </androidx.constraintlayout.widget.ConstraintLayout> +</ScrollView> diff --git a/app/src/main/res/layout/activity_git_config.xml b/app/src/main/res/layout/activity_git_config.xml index a576ec46..94c09e27 100644 --- a/app/src/main/res/layout/activity_git_config.xml +++ b/app/src/main/res/layout/activity_git_config.xml @@ -5,7 +5,7 @@ android:layout_height="match_parent" android:padding="@dimen/activity_horizontal_margin" android:background="?android:attr/windowBackground" - tools:context="com.zeapo.pwdstore.git.GitActivity" + tools:context="com.zeapo.pwdstore.git.GitConfigActivity" tools:layout_editor_absoluteX="0dp" tools:layout_editor_absoluteY="81dp"> @@ -51,7 +51,6 @@ android:layout_height="wrap_content" android:layout_margin="8dp" android:text="@string/crypto_save" - android:onClick="applyGitConfigs" android:textColor="?android:attr/windowBackground" app:backgroundTint="?attr/colorSecondary" app:layout_constraintTop_toBottomOf="@id/email_input_layout" @@ -95,7 +94,6 @@ android:layout_height="wrap_content" android:layout_margin="8dp" android:text="@string/abort_rebase" - android:onClick="abortRebase" android:textColor="?android:attr/windowBackground" app:backgroundTint="?attr/colorSecondary" app:layout_constraintTop_toBottomOf="@id/commit_hash_label" /> @@ -107,7 +105,6 @@ android:layout_height="wrap_content" android:layout_margin="8dp" android:text="@string/reset_to_remote" - android:onClick="resetToRemote" android:textColor="?android:attr/windowBackground" app:backgroundTint="?attr/colorSecondary" app:layout_constraintTop_toBottomOf="@id/git_abort_rebase" /> diff --git a/app/src/main/res/layout/autofill_instructions.xml b/app/src/main/res/layout/autofill_instructions.xml index 8ce0a793..e7cf3dd1 100644 --- a/app/src/main/res/layout/autofill_instructions.xml +++ b/app/src/main/res/layout/autofill_instructions.xml @@ -19,7 +19,6 @@ android:textSize="16sp" /> <androidx.appcompat.widget.AppCompatImageView - android:id="@+id/imageView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="8dp" diff --git a/app/src/main/res/layout/git_passphrase_layout.xml b/app/src/main/res/layout/git_passphrase_layout.xml index 814f4e40..c0922471 100644 --- a/app/src/main/res/layout/git_passphrase_layout.xml +++ b/app/src/main/res/layout/git_passphrase_layout.xml @@ -2,31 +2,31 @@ <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:padding="16dp"> - <EditText - android:id="@+id/sshkey_passphrase" - android:layout_width="0dp" + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/git_auth_passphrase_layout" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginEnd="16dp" - android:layout_marginStart="16dp" - android:layout_marginTop="8dp" - android:ems="10" - android:inputType="textPassword" - android:importantForAccessibility="no" + app:hintEnabled="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent"> + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/git_auth_passphrase" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/ssh_keygen_passphrase" + android:inputType="textPassword" /> + </com.google.android.material.textfield.TextInputLayout> - <CheckBox - android:id="@+id/sshkey_remember_passphrase" - android:layout_width="0dp" + <com.google.android.material.checkbox.MaterialCheckBox + android:id="@+id/git_auth_remember_passphrase" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="16dp" - android:layout_marginStart="16dp" - android:layout_marginTop="8dp" android:text="@string/remember_the_passphrase" app:layout_constraintRight_toRightOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/sshkey_passphrase" /> + app:layout_constraintTop_toBottomOf="@+id/git_auth_passphrase_layout" /> </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/layout/password_recycler_view.xml b/app/src/main/res/layout/password_recycler_view.xml index dd6b00c1..5368d593 100644 --- a/app/src/main/res/layout/password_recycler_view.xml +++ b/app/src/main/res/layout/password_recycler_view.xml @@ -25,7 +25,6 @@ </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> <LinearLayout - android:id="@+id/create_options" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top|center_horizontal" diff --git a/app/src/main/res/menu/git_clone.xml b/app/src/main/res/menu/git_clone.xml index 092a8b2b..d170cca8 100644 --- a/app/src/main/res/menu/git_clone.xml +++ b/app/src/main/res/menu/git_clone.xml @@ -1,7 +1,7 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:pwstore="http://schemas.android.com/apk/res-auto" - tools:context="com.zeapo.pwdstore.git.GitActivity" > + tools:context="com.zeapo.pwdstore.git.GitServerConfigActivity" > <item android:id="@+id/user_pref" android:title="@string/action_settings" android:orderInCategory="100" diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 7720784b..15ec0a8e 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -112,7 +112,6 @@ <string name="dialog_ok">حسناً</string> <string name="dialog_yes">نعم</string> <string name="dialog_no">لا</string> - <string name="dialog_negative">لا … لاحقاً</string> <string name="dialog_cancel">إلغاء</string> <string name="git_sync">زامن المستودع</string> <string name="show_password_pref_title">إظهار كلمة السر</string> diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 86985f8f..5917ff6b 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -9,7 +9,6 @@ <string name="title_activity_git_clone">Informace repozitáře</string> <!-- Password Store --> <string name="creation_dialog_text">Naklonujte nebo vytvořte nový repozitář před pokusem přidat heslo nebo spustit synchronizaci.</string> - <string name="key_dialog_text">Před inicializací repozitáře je třeba vybrat "ID PGP klíče"</string> <string name="delete_dialog_text">Opravdu chcete smazat heslo %1$s?</string> <string name="move">Přesunout</string> <string name="edit">Editovat</string> @@ -43,7 +42,6 @@ <!-- Git Handler --> <string name="forget_username_dialog_text">Zapomněli jste uvést přihlašovací jméno?</string> - <string name="set_information_dialog_text">Je třeba zadat informaci o serveru před vlastní synchronizací</string> <string name="ssh_preferences_dialog_text">Importujte nebo si prosím vygenerujte svůj SSH klíč v nastavení aplikace</string> <string name="ssh_preferences_dialog_title">Žádný SSH klíč</string> <string name="ssh_preferences_dialog_import">Import</string> @@ -163,8 +161,6 @@ <string name="dialog_ok">OK</string> <string name="dialog_yes">Ano</string> <string name="dialog_no">Ne</string> - <string name="dialog_positive">Je na cestě…</string> - <string name="dialog_negative">Ne… později</string> <string name="dialog_oops">Ajaj…</string> <string name="dialog_cancel">Zrušit</string> <string name="git_sync">Synchronizovat repozitář</string> diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 4960387f..aec047f9 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -9,7 +9,6 @@ <string name="title_activity_git_clone">Repository Informationen</string> <!-- Password Store --> <string name="creation_dialog_text">Bitte klone oder erstelle ein neues Repository, bevor du versuchst ein Passwort hinzuzufügen oder jegliche Synchronisation-Operation durchführst.</string> - <string name="key_dialog_text">Du musst deine PGP-Key ID auwählen, bevor das Repository intialisiert wird.</string> <string name="delete_dialog_text">Bist du dir sicher, dass du das Passwort löschen möchtest %1$s?</string> <string name="move">Verschieben</string> <string name="edit">Bearbeiten</string> @@ -28,7 +27,6 @@ <!-- Git Handler --> <string name="forget_username_dialog_text">Hast du vergessen einen Nutzernamen zu vergeben?</string> - <string name="set_information_dialog_text">You have to set the information about the server before synchronizing with the server</string> <string name="ssh_preferences_dialog_text">Please import or generate your SSH key file in the preferences</string> <string name="ssh_preferences_dialog_title">Kein SSH-Key angegeben</string> <string name="ssh_preferences_dialog_import">Import</string> @@ -141,8 +139,6 @@ <string name="dialog_ok">OK</string> <string name="dialog_yes">Ja</string> <string name="dialog_no">Nein</string> - <string name="dialog_positive">Auf dem Weg…</string> - <string name="dialog_negative">Nah… später</string> <string name="dialog_oops">Oops…</string> <string name="dialog_cancel">Abbruch</string> <string name="git_sync">Synchronisiere Repository</string> diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 47ec808d..aeb0a133 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -9,7 +9,6 @@ <string name="title_activity_git_clone">Información de repositorio</string> <!-- Password Store --> <string name="creation_dialog_text">Por favor clona o crea un nuevo repositorio antes de añadir una contraseña o ejecutar una operación de sincronización.</string> - <string name="key_dialog_text">Tienes que seleccionar una llave PGP antes de inicializar el repositorio</string> <string name="delete_dialog_text">Confirma que deseas eliminar la contraseña %1$s</string> <string name="move">Mover</string> <string name="edit">Editar</string> @@ -39,7 +38,6 @@ <!-- Git Handler --> <string name="forget_username_dialog_text">Olvidaste especificar un nombre de usuario?</string> - <string name="set_information_dialog_text">Necesitas configurar la información del servidor antes de sincronizar</string> <string name="ssh_preferences_dialog_text">Por favor importa o genera tu llave SSH en los ajustes</string> <string name="ssh_preferences_dialog_title">No hay llave SSH</string> <string name="ssh_preferences_dialog_import">Importar</string> @@ -177,8 +175,6 @@ <string name="dialog_ok">OK</string> <string name="dialog_yes">Sí</string> <string name="dialog_no">No</string> - <string name="dialog_positive">Ok, Vamos…</string> - <string name="dialog_negative">Nah… después</string> <string name="dialog_oops">Ups…</string> <string name="dialog_cancel">Cancelar</string> <string name="git_sync">Sincronizar con servidor</string> diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 0f4c2025..8461d96d 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -9,7 +9,6 @@ <string name="title_activity_git_clone">Information sur le dépôt Git</string> <!-- Password Store --> <string name="creation_dialog_text">Clonez ou créez un dépôt suivant avant d\'essayer d\'ajouter un mot de pass ou d\'effectuer une opération de synchornisation.</string> - <string name="key_dialog_text">Vous devez sélectionner votre "PGP-Key ID" avant d\'initialiser le dépôt</string> <string name="delete_dialog_text">Êtes-vous sûr de vouloir supprimer le mot de passe %1$s?</string> <string name="move">Déplacer</string> <string name="edit">Éditer</string> @@ -45,7 +44,6 @@ <!-- Git Handler --> <string name="forget_username_dialog_text">Avez-vous oublié to renseigner votre nom d\'utilisateur ?</string> - <string name="set_information_dialog_text">Vous devez renseignez les informations à propos du serveur avant d\'effectuer une synchronisation avec celui-ci</string> <string name="ssh_preferences_dialog_text">Vous devez importer ou générer votre fichier de clef SSH dans les préférences</string> <string name="ssh_preferences_dialog_title">Absence de cled SSH</string> <string name="ssh_preferences_dialog_import">Importer</string> @@ -178,8 +176,6 @@ <string name="dialog_ok">OK</string> <string name="dialog_yes">Oui</string> <string name="dialog_no">Non</string> - <string name="dialog_positive">En chemin…</string> - <string name="dialog_negative">Non… plus tard</string> <string name="dialog_oops">Oups…</string> <string name="dialog_cancel">Annuler</string> <string name="git_sync">Synchronisation du dépôt</string> diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index c798f6c2..a70c5670 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -9,7 +9,6 @@ <string name="title_activity_git_clone">リポジトリ情報</string> <!-- Password Store --> <string name="creation_dialog_text">パスワードや同期操作を追加する前に、以下の新しいリポジトリをクローンまたは作成してください。</string> - <string name="key_dialog_text">リポジトリを初期化する前に "PGP 鍵 ID"を選択する必要があります</string> <string name="delete_dialog_text">パスワードを削除してもよろしいですか %1$s</string> <string name="delete">削除</string> <!-- git commits --> @@ -28,7 +27,6 @@ <!-- Git Handler --> <string name="forget_username_dialog_text">ユーザー名の指定を忘れましたか?</string> - <string name="set_information_dialog_text">サーバーと同期する前に、サーバーに関する情報を設定する必要があります</string> <string name="ssh_preferences_dialog_text">プリファレンスで SSH 鍵ファイルをインポートまたは生成してください</string> <string name="ssh_preferences_dialog_title">SSH 鍵がありませんkey</string> <string name="ssh_preferences_dialog_import">インポート</string> @@ -120,8 +118,6 @@ <string name="dialog_ok">OK</string> <string name="dialog_yes">はい</string> <string name="dialog_no">いいえ</string> - <string name="dialog_positive">途中…</string> - <string name="dialog_negative">いや…あとで</string> <string name="dialog_oops">おっと…</string> <string name="dialog_cancel">キャンセル</string> <string name="git_sync">リポジトリを同期</string> diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 9dfc9d73..0b858c75 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -16,4 +16,6 @@ <color name="navigation_bar_color">@color/primary_color</color> <color name="list_multiselect_background">#66EEEEEE</color> <color name="status_bar_color">@color/window_background</color> + <color name="ripple_color">#aaff7539</color> + <color name="button_color">#44ff7539</color> </resources> diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index bc73c5c2..04d7b837 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -9,7 +9,6 @@ <string name="title_activity_git_clone">Информация о репозитории</string> <!-- Password Store --> <string name="creation_dialog_text">Пожалуйста, клонируйте или создайте новый репозиторий перед тем, как добавлять пароль или выполнять синхронизацию.</string> - <string name="key_dialog_text">Вы должны выбрать PGP ключ перед инициализацией хранилища</string> <string name="delete_dialog_text">Вы уверены что хотите удалить пароль %1$s</string> <string name="move">Переместить</string> <string name="edit">Редактировать</string> @@ -47,7 +46,6 @@ <!-- Git Handler --> <string name="forget_username_dialog_text">Вы забыли указать имя пользователя?</string> - <string name="set_information_dialog_text">Вы должны указать информацию о сервере до выполнения синхронизации</string> <string name="ssh_preferences_dialog_text">Пожалуйста, импортируйте или сгенерируйте новый SSH ключ в настройках</string> <string name="ssh_preferences_dialog_title">Нет SSH ключа</string> <string name="ssh_preferences_dialog_import">Импортировать</string> @@ -211,8 +209,6 @@ <string name="dialog_ok">OK</string> <string name="dialog_yes">Да</string> <string name="dialog_no">Нет</string> - <string name="dialog_positive">On my way…</string> - <string name="dialog_negative">Не … позже</string> <string name="dialog_oops">Упс…</string> <string name="dialog_cancel">Отмена</string> <string name="git_sync">Синхронизировать репозиторий</string> diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 019f703c..76926ce9 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -9,7 +9,6 @@ <string name="title_activity_git_clone">Repo 信息</string> <!-- Password Store --> <string name="creation_dialog_text">在尝试添加密码或任何同步操作前请在下方克隆或添加一个新的 Repo</string> - <string name="key_dialog_text">在初始化 Repo 之前你必须选择你的\"PGP-Key ID\"</string> <string name="delete_dialog_text">你确定要删除密码 %1$s</string> <string name="delete">删除</string> <!-- git commits --> @@ -28,7 +27,6 @@ <!-- Git Handler --> <string name="forget_username_dialog_text">你忘了提供用户名了吗?</string> - <string name="set_information_dialog_text">你必须在与服务器同步前设置服务器信息</string> <string name="ssh_preferences_dialog_text">请在设置中导入或生成你的SSH密钥文件</string> <string name="ssh_preferences_dialog_title">无SSH密钥</string> <string name="ssh_preferences_dialog_import">导入</string> @@ -117,8 +115,6 @@ <string name="dialog_ok">确定</string> <string name="dialog_yes">确定</string> <string name="dialog_no">否</string> - <string name="dialog_positive">现在就去</string> - <string name="dialog_negative">呃… 算了吧</string> <string name="dialog_oops">糟糕…</string> <string name="dialog_cancel">取消</string> <string name="git_sync">同步 Repo</string> diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index bdc6f1fb..7a4b4f1f 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -9,7 +9,6 @@ <string name="title_activity_git_clone">Repo 訊息</string> <!-- Password Store --> <string name="creation_dialog_text">在嘗試新增密碼或任何同步操作之前請在下方 clone 或新增一個新的 Repo</string> - <string name="key_dialog_text">在初始化 Repo 之前你必須選擇你的\"PGP-Key ID\"</string> <string name="delete_dialog_text">你確定要刪除密碼 %1$s</string> <string name="delete">刪除</string> <!-- PGPHandler --> @@ -25,7 +24,6 @@ <!-- Git Handler --> <string name="forget_username_dialog_text">你忘記輸入使用者名稱了嗎?</string> - <string name="set_information_dialog_text">你必須在與伺服器同步前設定伺服器資訊</string> <string name="ssh_preferences_dialog_text">請在設定中匯入或產生你的 SSH 金鑰</string> <string name="ssh_preferences_dialog_title">無 SSH 金鑰</string> <string name="ssh_preferences_dialog_import">匯入</string> @@ -114,8 +112,6 @@ <string name="dialog_ok">確定</string> <string name="dialog_yes">確定</string> <string name="dialog_no">否</string> - <string name="dialog_positive">確定</string> - <string name="dialog_negative">呃… 算了吧</string> <string name="dialog_oops">糟糕…</string> <string name="dialog_cancel">取消</string> <string name="git_sync">同步 Repo</string> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 13bc049d..54a3af70 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -19,6 +19,8 @@ <color name="list_multiselect_background">#668eacbb</color> <color name="navigation_bar_color">#000000</color> <color name="status_bar_color">@color/primary_dark_color</color> + <color name="ripple_color">#aaff7043</color> + <color name="button_color">#44ff7043</color> <!-- Override TextInputEditText stroke color like a boss --> <color name="mtrl_textinput_default_box_stroke_color" tools:override="true"> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bd2aa75e..dafad85a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -19,7 +19,7 @@ <!-- Password Store --> <string name="creation_dialog_text">Please clone or create a new repository below before trying to add a password or running any synchronization operation.</string> - <string name="key_dialog_text">You have to select your PGP key ID before initializing the repository</string> + <string name="key_dialog_text">A valid PGP key must be selected in Settings before initializing the repository</string> <string name="delete_dialog_text">Are you sure you want to delete the password %1$s?</string> <string name="move">Move</string> <string name="edit">Edit</string> @@ -57,7 +57,7 @@ <!-- Git Handler --> <string name="forget_username_dialog_text">Did you forget to specify a username?</string> - <string name="set_information_dialog_text">You have to set the information about the server before synchronizing with the server</string> + <string name="set_information_dialog_text">Please fix the remote server configuration in settings before proceeding</string> <string name="ssh_preferences_dialog_text">Please import or generate your SSH key file in the preferences</string> <string name="ssh_preferences_dialog_title">No SSH key</string> <string name="ssh_preferences_dialog_import">Import</string> @@ -228,8 +228,8 @@ <string name="dialog_ok">OK</string> <string name="dialog_yes">Yes</string> <string name="dialog_no">No</string> - <string name="dialog_positive">On my way…</string> - <string name="dialog_negative">Nah… later</string> + <string name="dialog_positive">Go to Settings</string> + <string name="dialog_negative">Go back</string> <string name="dialog_oops">Oops…</string> <string name="dialog_cancel">Cancel</string> <string name="git_sync">Synchronize repository</string> @@ -309,7 +309,7 @@ <string name="jgit_error_push_dialog_text">Error occurred during the push operation:</string> <string name="ssh_key_clear_passphrase">Clear ssh-key saved passphrase</string> <string name="hotp_remember_clear_choice">Clear saved preference for HOTP incrementing</string> - <string name="remember_the_passphrase">Remember the passphrase in the app configuration (insecure)</string> + <string name="remember_the_passphrase">Remember key passphrase</string> <string name="hackish_tools">Hackish tools</string> <string name="abort_rebase">Abort rebase and push new branch</string> <string name="reset_to_remote">Hard reset to remote branch</string> @@ -349,4 +349,14 @@ <string name="theme_dark">Dark</string> <string name="theme_battery_saver">Set by Battery Saver</string> <string name="theme_follow_system">System default</string> + <string name="clone_protocol_ssh" translatable="false">SSH</string> + <string name="clone_protocol_https" translatable="false">HTTPS</string> + <string name="connection_mode_ssh_key" translatable="false">SSH key</string> + <string name="connection_mode_basic_authentication" translatable="false">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_failure">Configuration error: please verify your settings and try again</string> + <string name="git_operation_unable_to_open_ssh_key_title">Unable to open the ssh-key</string> + <string name="git_operation_unable_to_open_ssh_key_message">Please check that it was imported.</string> + <string name="git_operation_wrong_passphrase">Wrong passphrase</string> </resources> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 090b56b9..b5a03bb4 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -33,6 +33,21 @@ <item name="background">@color/primary_color</item> </style> + <style name="NoBackgroundTheme" parent="@style/AppTheme"> + <item name="android:background">@android:color/transparent</item> + <item name="android:backgroundDimEnabled">true</item> + <item name="android:navigationBarColor">@android:color/transparent</item> + <item name="android:statusBarColor">@android:color/transparent</item> + <item name="android:windowIsTranslucent">true</item> + <item name="android:windowContentOverlay">@null</item> + <item name="android:windowActionBar">false</item> + <item name="android:windowBackground">@android:color/transparent</item> + <item name="android:windowEnterAnimation">@android:anim/fade_in</item> + <item name="android:windowExitAnimation">@android:anim/fade_out</item> + <item name="colorPrimaryDark">@android:color/transparent</item> + <item name="windowNoTitle">true</item> + </style> + <style name="ThemeOverlay.AppTheme.TextInputEditText.OutlinedBox" parent="ThemeOverlay.MaterialComponents.TextInputEditText.OutlinedBox"> <item name="colorControlActivated">@color/color_control_normal</item> </style> |