Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ All notable changes to this project will be documented in this file.
- Reduced app size
- Improve IME experience with server config screen
- Removed edit password option from long-press menu.
- Batch deletion now does not require manually confirming for each password
- Better commit messages on password deletion

## [1.8.1] - 2020-05-24

Expand Down
18 changes: 7 additions & 11 deletions app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import com.zeapo.pwdstore.utils.PasswordRepository
import com.zeapo.pwdstore.utils.viewBinding
import me.zhanghai.android.fastscroll.FastScrollerBuilder
import java.io.File
import java.util.Stack

class PasswordFragment : Fragment(R.layout.password_recycler_view) {
private lateinit var recyclerAdapter: PasswordItemRecyclerAdapter
Expand Down Expand Up @@ -160,21 +159,18 @@ class PasswordFragment : Fragment(R.layout.password_recycler_view) {

// Called when the user selects a contextual menu item
override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean {
when (item.itemId) {
return when (item.itemId) {
R.id.menu_delete_password -> {
requireStore().deletePasswords(
Stack<PasswordItem>().apply {
recyclerAdapter.getSelectedItems(requireContext()).forEach { push(it) }
}
)
mode.finish() // Action picked, so close the CAB
return true
requireStore().deletePasswords(recyclerAdapter.getSelectedItems(requireContext()))
// Action picked, so close the CAB
mode.finish()
true
}
R.id.menu_move_password -> {
requireStore().movePasswords(recyclerAdapter.getSelectedItems(requireContext()))
return false
false
}
else -> return false
else -> false
}
}

Expand Down
205 changes: 114 additions & 91 deletions app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions app/src/main/java/com/zeapo/pwdstore/utils/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import android.view.View
import android.view.autofill.AutofillManager
import android.view.inputmethod.InputMethodManager
import androidx.annotation.IdRes
import androidx.annotation.MainThread
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AlertDialog
import androidx.core.content.getSystemService
Expand Down Expand Up @@ -73,6 +74,7 @@ fun Context.getEncryptedPrefs(fileName: String): SharedPreferences {
)
}

@MainThread
fun Activity.commitChange(message: String, finishWithResultOnEnd: Intent? = null) {
if (!PasswordRepository.isGitRepo()) {
if (finishWithResultOnEnd != null) {
Expand All @@ -99,6 +101,7 @@ fun Activity.commitChange(message: String, finishWithResultOnEnd: Intent? = null
* view whose id is [id]. Solution based on a StackOverflow
* answer: https://stackoverflow.com/a/13056259/297261
*/
@MainThread
fun <T : View> AlertDialog.requestInputFocusOnView(@IdRes id: Int) {
setOnShowListener {
findViewById<T>(id)?.apply {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<string name="dialog_delete">حذف المجلد</string>
<string name="dialog_do_not_delete">إلغاء</string>
<string name="title_activity_git_clone">معلومات حول المستودع</string>
<string name="delete_dialog_text">هل تود حقًا حذف كلمة السر %1$s ؟</string>
<string name="move">نقل</string>
<string name="edit">تعديل</string>
<string name="delete">حذف</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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="delete_dialog_text">Opravdu chcete smazat heslo %1$s?</string>
<string name="move">Přesunout</string>
<string name="edit">Editovat</string>
<string name="delete">Smazat</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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="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>
<string name="delete">Löschen</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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="delete_dialog_text">Confirma que deseas eliminar la contraseña %1$s</string>
<string name="move">Mover</string>
<string name="edit">Editar</string>
<string name="delete">Eliminar</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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="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>
<string name="delete">Supprimer</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<string name="title_activity_git_clone">リポジトリ情報</string>
<!-- Password Store -->
<string name="creation_dialog_text">パスワードや同期操作を追加する前に、以下の新しいリポジトリをクローンまたは作成してください。</string>
<string name="delete_dialog_text">パスワードを削除してもよろしいですか %1$s</string>
<string name="delete">削除</string>
<!-- git commits -->
<string name="git_commit_add_text">追加 %1$s ストアから。</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<string name="title_activity_git_clone">Информация о репозитории</string>
<!-- Password Store -->
<string name="creation_dialog_text">Пожалуйста, клонируйте или создайте новый репозиторий перед тем, как добавлять пароль или выполнять синхронизацию.</string>
<string name="delete_dialog_text">Вы уверены что хотите удалить пароль %1$s</string>
<string name="move">Переместить</string>
<string name="edit">Редактировать</string>
<string name="delete">Удалить</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<string name="title_activity_git_clone">Repo 信息</string>
<!-- Password Store -->
<string name="creation_dialog_text">在尝试添加密码或任何同步操作前请在下方克隆或添加一个新的 Repo</string>
<string name="delete_dialog_text">你确定要删除密码 %1$s</string>
<string name="delete">删除</string>
<!-- git commits -->
<string name="git_commit_add_text">使用Android Password Store来添加 %1$s</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<string name="title_activity_git_clone">Repo 訊息</string>
<!-- Password Store -->
<string name="creation_dialog_text">在嘗試新增密碼或任何同步操作之前請在下方 clone 或新增一個新的 Repo</string>
<string name="delete_dialog_text">你確定要刪除密碼 %1$s</string>
<string name="delete">刪除</string>
<!-- PGPHandler -->
<string name="provider_toast_text">未選擇提供 OpenPGP 的 app</string>
Expand Down
8 changes: 7 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
<!-- 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">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>
<plurals name="delete_dialog_text">
<item quantity="one">Are you sure you want to delete the password?</item>
<item quantity="other">Are you sure you want to delete %d passwords?</item>
</plurals>
<string name="move">Move</string>
<string name="edit">Edit</string>
<string name="delete">Delete</string>
Expand All @@ -36,12 +39,15 @@
<string name="no_key_selected_dialog_text">We will redirect you to settings. Please select your OpenPGP Key.</string>
<string name="password_exists_title">Password already exists!</string>
<string name="password_exists_message">This will overwrite %1$s with %2$s.</string>
<string name="password_move_error_title">Error while moving passwords</string>
<string name="password_move_error_message">Failed to move %1$s to %2$s</string>

<!-- git commits -->
<string name="git_commit_add_text">Add generated password for %1$s using Android Password Store.</string>
<string name="git_commit_edit_text">Edit password for %1$s using Android Password Store.</string>
<string name="git_commit_remove_text">Remove %1$s from store.</string>
<string name="git_commit_move_text">Rename %1$s to %2$s.</string>
<string name="git_commit_move_multiple_text">Move multiple passwords to %1$s.</string>

<!-- PGPHandler -->
<string name="provider_toast_text">No OpenPGP provider selected!</string>
Expand Down