From 5d170249cdd0050349f40d3a5852a8ba996663bc Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 7 Jul 2020 19:18:24 +0530 Subject: Major UI overhaul and the introduction of a new icon (#920) Co-authored-by: Fabian Henneke --- CHANGELOG.md | 8 + .../debug/res/drawable/ic_launcher_foreground.xml | 31 ---- .../autofill/oreo/ui/AutofillSmsActivity.kt | 1 - app/src/main/ic_launcher-playstore.png | Bin 0 -> 100415 bytes app/src/main/ic_launcher-web.png | Bin 16541 -> 0 bytes .../zeapo/pwdstore/autofill/AutofillActivity.kt | 1 + .../zeapo/pwdstore/autofill/AutofillFragment.kt | 1 + .../autofill/AutofillPreferenceActivity.kt | 1 + .../pwdstore/autofill/AutofillRecyclerAdapter.kt | 1 + .../com/zeapo/pwdstore/autofill/AutofillService.kt | 1 + .../pwdstore/crypto/PasswordCreationActivity.kt | 8 +- .../ui/adapters/PasswordItemRecyclerAdapter.kt | 6 +- .../dialogs/XkPasswordGeneratorDialogFragment.kt | 75 ++------- app/src/main/res/color/outlined_box_selector.xml | 6 + app/src/main/res/drawable-nodpi/autofill_ins_1.png | Bin 7324 -> 0 bytes .../main/res/drawable-nodpi/autofill_ins_1.webp | Bin 0 -> 3526 bytes app/src/main/res/drawable-nodpi/autofill_ins_2.png | Bin 4063 -> 0 bytes .../main/res/drawable-nodpi/autofill_ins_2.webp | Bin 0 -> 2258 bytes app/src/main/res/drawable-nodpi/autofill_ins_3.png | Bin 6631 -> 0 bytes .../main/res/drawable-nodpi/autofill_ins_3.webp | Bin 0 -> 3516 bytes .../res/drawable-v24/ic_launcher_background.xml | 152 +++++++++++++++++ app/src/main/res/drawable/ic_action_new_folder.xml | 2 +- .../main/res/drawable/ic_action_new_password.xml | 2 +- app/src/main/res/drawable/ic_add_48dp.xml | 14 ++ app/src/main/res/drawable/ic_add_white_48dp.xml | 14 -- app/src/main/res/drawable/ic_clear_white_24dp.xml | 14 -- app/src/main/res/drawable/ic_content_copy.xml | 2 +- .../res/drawable/ic_content_copy_white_24dp.xml | 14 -- app/src/main/res/drawable/ic_delete_24dp.xml | 14 ++ app/src/main/res/drawable/ic_delete_white_24dp.xml | 14 -- app/src/main/res/drawable/ic_done_24dp.xml | 14 ++ app/src/main/res/drawable/ic_done_white_24dp.xml | 14 -- app/src/main/res/drawable/ic_edit_24dp.xml | 14 ++ app/src/main/res/drawable/ic_edit_white_24dp.xml | 14 -- .../main/res/drawable/ic_launcher_foreground.xml | 31 ---- app/src/main/res/drawable/ic_move_folder_24dp.xml | 14 ++ .../res/drawable/ic_move_folder_white_24dp.xml | 14 -- app/src/main/res/drawable/ic_save_24dp.xml | 14 ++ app/src/main/res/drawable/ic_save_copy_24dp.xml | 14 ++ .../main/res/drawable/ic_save_copy_white_24dp.xml | 14 -- app/src/main/res/drawable/ic_save_white_24dp.xml | 14 -- app/src/main/res/drawable/ic_search_24dp.xml | 14 ++ app/src/main/res/drawable/ic_search_white_24dp.xml | 14 -- app/src/main/res/drawable/ic_share_24dp.xml | 14 ++ app/src/main/res/drawable/ic_share_white_24dp.xml | 14 -- .../res/layout/activity_oreo_autofill_filter.xml | 8 +- .../activity_oreo_autofill_publisher_changed.xml | 8 +- .../main/res/layout/activity_oreo_autofill_sms.xml | 8 +- app/src/main/res/layout/autofill_recycler_view.xml | 2 +- app/src/main/res/layout/folder_dialog_fragment.xml | 2 +- .../main/res/layout/fragment_to_clone_or_not.xml | 4 +- app/src/main/res/layout/fragment_xkpwgen.xml | 184 +++++++-------------- .../main/res/layout/password_creation_activity.xml | 6 +- app/src/main/res/layout/password_recycler_view.xml | 2 +- app/src/main/res/menu/autofill_preference.xml | 2 +- app/src/main/res/menu/context_pass.xml | 6 +- app/src/main/res/menu/main_menu_git.xml | 2 +- app/src/main/res/menu/main_menu_no_auth.xml | 2 +- app/src/main/res/menu/main_menu_non_git.xml | 2 +- app/src/main/res/menu/pgp_handler.xml | 6 +- app/src/main/res/menu/pgp_handler_new_password.xml | 9 +- .../main/res/menu/pgp_handler_select_folder.xml | 2 +- app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 10 +- .../res/mipmap-anydpi-v26/ic_launcher_round.xml | 10 +- app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 1894 -> 0 bytes app/src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 4432 bytes .../res/mipmap-hdpi/ic_launcher_foreground.webp | Bin 0 -> 5806 bytes app/src/main/res/mipmap-hdpi/ic_launcher_round.png | Bin 4048 -> 0 bytes .../main/res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 4432 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 1358 -> 0 bytes app/src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 2734 bytes .../res/mipmap-mdpi/ic_launcher_foreground.webp | Bin 0 -> 3118 bytes app/src/main/res/mipmap-mdpi/ic_launcher_round.png | Bin 2626 -> 0 bytes .../main/res/mipmap-mdpi/ic_launcher_round.webp | Bin 0 -> 2734 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 2501 -> 0 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 6396 bytes .../res/mipmap-xhdpi/ic_launcher_foreground.webp | Bin 0 -> 9154 bytes .../main/res/mipmap-xhdpi/ic_launcher_round.png | Bin 5649 -> 0 bytes .../main/res/mipmap-xhdpi/ic_launcher_round.webp | Bin 0 -> 6396 bytes app/src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 4045 -> 0 bytes app/src/main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 10310 bytes .../res/mipmap-xxhdpi/ic_launcher_foreground.webp | Bin 0 -> 18578 bytes .../main/res/mipmap-xxhdpi/ic_launcher_round.png | Bin 8679 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 0 -> 10310 bytes app/src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 5385 -> 0 bytes app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 15052 bytes .../res/mipmap-xxxhdpi/ic_launcher_foreground.webp | Bin 0 -> 32042 bytes .../main/res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 12286 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 0 -> 15052 bytes app/src/main/res/values-night/bools.xml | 4 + app/src/main/res/values-night/colors.xml | 3 +- app/src/main/res/values/bools.xml | 1 + app/src/main/res/values/colors.xml | 16 +- app/src/main/res/values/strings.xml | 4 +- app/src/main/res/values/styles.xml | 36 ++-- media/play_store_banner.png | Bin 34278 -> 373934 bytes 96 files changed, 455 insertions(+), 493 deletions(-) delete mode 100644 app/src/debug/res/drawable/ic_launcher_foreground.xml create mode 100644 app/src/main/ic_launcher-playstore.png delete mode 100644 app/src/main/ic_launcher-web.png create mode 100644 app/src/main/res/color/outlined_box_selector.xml delete mode 100644 app/src/main/res/drawable-nodpi/autofill_ins_1.png create mode 100644 app/src/main/res/drawable-nodpi/autofill_ins_1.webp delete mode 100644 app/src/main/res/drawable-nodpi/autofill_ins_2.png create mode 100644 app/src/main/res/drawable-nodpi/autofill_ins_2.webp delete mode 100644 app/src/main/res/drawable-nodpi/autofill_ins_3.png create mode 100644 app/src/main/res/drawable-nodpi/autofill_ins_3.webp create mode 100644 app/src/main/res/drawable-v24/ic_launcher_background.xml create mode 100644 app/src/main/res/drawable/ic_add_48dp.xml delete mode 100644 app/src/main/res/drawable/ic_add_white_48dp.xml delete mode 100644 app/src/main/res/drawable/ic_clear_white_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_content_copy_white_24dp.xml create mode 100644 app/src/main/res/drawable/ic_delete_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_delete_white_24dp.xml create mode 100644 app/src/main/res/drawable/ic_done_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_done_white_24dp.xml create mode 100644 app/src/main/res/drawable/ic_edit_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_edit_white_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable/ic_move_folder_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_move_folder_white_24dp.xml create mode 100644 app/src/main/res/drawable/ic_save_24dp.xml create mode 100644 app/src/main/res/drawable/ic_save_copy_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_save_copy_white_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_save_white_24dp.xml create mode 100644 app/src/main/res/drawable/ic_search_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_search_white_24dp.xml create mode 100644 app/src/main/res/drawable/ic_share_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_share_white_24dp.xml delete mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp delete mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.webp delete mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp delete mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.webp delete mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp delete mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp delete mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp delete mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp delete mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp delete mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/values-night/bools.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 06b60282..d83343e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,19 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Changed + +- A brand new icon to go with our biggest update ever! +- Light theme is now a consistent white across the board with ample contrast +- XkPassword generator is now easier to use with less configuration options + ### Fixed - Folder names that were very long did not look right - Error message for wrong SSH/HTTPS password now looks cleaner - Fix authentication failure with usernames that contain the `@` character +- Text input boxes were illegible on dark theme +- Top-level password names had inconsistent top margin making them look askew ### Added diff --git a/app/src/debug/res/drawable/ic_launcher_foreground.xml b/app/src/debug/res/drawable/ic_launcher_foreground.xml deleted file mode 100644 index 19459fbd..00000000 --- a/app/src/debug/res/drawable/ic_launcher_foreground.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - diff --git a/app/src/free/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillSmsActivity.kt b/app/src/free/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillSmsActivity.kt index f86e5d4c..0734af40 100644 --- a/app/src/free/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillSmsActivity.kt +++ b/app/src/free/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillSmsActivity.kt @@ -9,7 +9,6 @@ import android.content.IntentSender import android.os.Build import androidx.annotation.RequiresApi import androidx.appcompat.app.AppCompatActivity -import com.zeapo.pwdstore.autofill.oreo.FormOrigin @RequiresApi(Build.VERSION_CODES.O) @Suppress("UNUSED_PARAMETER") diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png new file mode 100644 index 00000000..e0e0edec Binary files /dev/null and b/app/src/main/ic_launcher-playstore.png differ diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png deleted file mode 100644 index 8c5539c4..00000000 Binary files a/app/src/main/ic_launcher-web.png and /dev/null differ diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt index a64cdced..30766021 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt @@ -3,6 +3,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ @file:Suppress("Deprecation") + package com.zeapo.pwdstore.autofill import android.app.PendingIntent diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.kt index 269e6624..5effb32f 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.kt +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.kt @@ -3,6 +3,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ @file:Suppress("Deprecation") + package com.zeapo.pwdstore.autofill import android.annotation.SuppressLint diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillPreferenceActivity.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillPreferenceActivity.kt index e8bf5537..1841aa06 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillPreferenceActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillPreferenceActivity.kt @@ -3,6 +3,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ @file:Suppress("Deprecation") + package com.zeapo.pwdstore.autofill import android.content.Context diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillRecyclerAdapter.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillRecyclerAdapter.kt index 5752b055..937c0e1a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillRecyclerAdapter.kt +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillRecyclerAdapter.kt @@ -3,6 +3,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ @file:Suppress("Deprecation") + package com.zeapo.pwdstore.autofill import android.content.Context diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt index bfb1c5d0..da774882 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt @@ -3,6 +3,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ @file:Suppress("Deprecation") + package com.zeapo.pwdstore.autofill import android.accessibilityservice.AccessibilityService diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt index 13f9add3..b98f20df 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt @@ -104,7 +104,11 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB oldCategory = path } } - suggestedName?.let { filename.setText(it) } + if (suggestedName != null) { + filename.setText(suggestedName) + } else { + filename.requestFocus() + } // Allow the user to quickly switch between storing the username as the filename or // in the encrypted extras. This only makes sense if the directory structure is // FileBased. @@ -164,7 +168,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { - android.R.id.home, R.id.cancel_password_add -> { + android.R.id.home -> { setResult(RESULT_CANCELED) finish() } diff --git a/app/src/main/java/com/zeapo/pwdstore/ui/adapters/PasswordItemRecyclerAdapter.kt b/app/src/main/java/com/zeapo/pwdstore/ui/adapters/PasswordItemRecyclerAdapter.kt index fd96b7a8..fc63aec4 100644 --- a/app/src/main/java/com/zeapo/pwdstore/ui/adapters/PasswordItemRecyclerAdapter.kt +++ b/app/src/main/java/com/zeapo/pwdstore/ui/adapters/PasswordItemRecyclerAdapter.kt @@ -65,7 +65,11 @@ open class PasswordItemRecyclerAdapter : } else { typeImage.setImageResource(R.drawable.ic_action_secure_24dp) val parentPath = item.fullPathToParent.replace("(^/)|(/$)".toRegex(), "") - val source = "$parentPath\n$item" + val source = if (parentPath.isNotEmpty()) { + "$parentPath\n$item" + } else { + "$item" + } val spannable = SpannableString(source) spannable.setSpan(RelativeSizeSpan(0.7f), 0, parentPath.length, 0) name.text = spannable diff --git a/app/src/main/java/com/zeapo/pwdstore/ui/dialogs/XkPasswordGeneratorDialogFragment.kt b/app/src/main/java/com/zeapo/pwdstore/ui/dialogs/XkPasswordGeneratorDialogFragment.kt index 206b0533..d9a4ba75 100644 --- a/app/src/main/java/com/zeapo/pwdstore/ui/dialogs/XkPasswordGeneratorDialogFragment.kt +++ b/app/src/main/java/com/zeapo/pwdstore/ui/dialogs/XkPasswordGeneratorDialogFragment.kt @@ -9,18 +9,16 @@ import android.content.Context import android.content.SharedPreferences import android.graphics.Typeface import android.os.Bundle -import android.widget.CheckBox import android.widget.EditText -import android.widget.Spinner import android.widget.Toast import androidx.appcompat.app.AlertDialog -import androidx.appcompat.widget.AppCompatEditText import androidx.appcompat.widget.AppCompatTextView import androidx.core.content.edit import androidx.fragment.app.DialogFragment import com.github.ajalt.timberkt.Timber.tag import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.zeapo.pwdstore.R +import com.zeapo.pwdstore.databinding.FragmentXkpwgenBinding import com.zeapo.pwdstore.pwgen.PasswordGenerator import com.zeapo.pwdstore.pwgenxkpwd.CapsType import com.zeapo.pwdstore.pwgenxkpwd.PasswordBuilder @@ -28,72 +26,45 @@ import com.zeapo.pwdstore.pwgenxkpwd.PasswordBuilder /** A placeholder fragment containing a simple view. */ class XkPasswordGeneratorDialogFragment : DialogFragment() { - private lateinit var editSeparator: AppCompatEditText - private lateinit var editNumWords: AppCompatEditText - private lateinit var cbSymbols: CheckBox - private lateinit var spinnerCapsType: Spinner - private lateinit var cbNumbers: CheckBox private lateinit var prefs: SharedPreferences - private lateinit var spinnerNumbersCount: Spinner - private lateinit var spinnerSymbolsCount: Spinner + private lateinit var binding: FragmentXkpwgenBinding override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { val builder = MaterialAlertDialogBuilder(requireContext()) val callingActivity = requireActivity() val inflater = callingActivity.layoutInflater - val view = inflater.inflate(R.layout.fragment_xkpwgen, null) + binding = FragmentXkpwgenBinding.inflate(inflater) val monoTypeface = Typeface.createFromAsset(callingActivity.assets, "fonts/sourcecodepro.ttf") - builder.setView(view) + builder.setView(binding.root) prefs = callingActivity.getSharedPreferences("PasswordGenerator", Context.MODE_PRIVATE) - cbNumbers = view.findViewById(R.id.xknumerals) - cbNumbers.isChecked = prefs.getBoolean(PREF_KEY_USE_NUMERALS, false) - - spinnerNumbersCount = view.findViewById(R.id.xk_numbers_count) - - val storedNumbersCount = prefs.getInt(PREF_KEY_NUMBERS_COUNT, 0) - spinnerNumbersCount.setSelection(storedNumbersCount) - - cbSymbols = view.findViewById(R.id.xksymbols) - cbSymbols.isChecked = prefs.getBoolean(PREF_KEY_USE_SYMBOLS, false) != false - spinnerSymbolsCount = view.findViewById(R.id.xk_symbols_count) - val symbolsCount = prefs.getInt(PREF_KEY_SYMBOLS_COUNT, 0) - spinnerSymbolsCount.setSelection(symbolsCount) - val previousStoredCapStyle: String = try { prefs.getString(PREF_KEY_CAPITALS_STYLE, DEFAULT_CAPS_STYLE)!! } catch (e: Exception) { tag("xkpw").e(e) DEFAULT_CAPS_STYLE } - spinnerCapsType = view.findViewById(R.id.xkCapType) - - val lastCapitalsStyleIndex: Int - lastCapitalsStyleIndex = try { + val lastCapitalsStyleIndex: Int = try { CapsType.valueOf(previousStoredCapStyle).ordinal } catch (e: Exception) { tag("xkpw").e(e) DEFAULT_CAPS_INDEX } - spinnerCapsType.setSelection(lastCapitalsStyleIndex) - - editNumWords = view.findViewById(R.id.xk_num_words) - editNumWords.setText(prefs.getString(PREF_KEY_NUM_WORDS, DEFAULT_NUMBER_OF_WORDS)) + binding.xkCapType.setSelection(lastCapitalsStyleIndex) + binding.xkNumWords.setText(prefs.getString(PREF_KEY_NUM_WORDS, DEFAULT_NUMBER_OF_WORDS)) - editSeparator = view.findViewById(R.id.xk_separator) - editSeparator.setText(prefs.getString(PREF_KEY_SEPARATOR, DEFAULT_WORD_SEPARATOR)) + binding.xkSeparator.setText(prefs.getString(PREF_KEY_SEPARATOR, DEFAULT_WORD_SEPARATOR)) - val passwordText: AppCompatTextView = view.findViewById(R.id.xkPasswordText) - passwordText.typeface = monoTypeface + binding.xkPasswordText.typeface = monoTypeface builder.setPositiveButton(resources.getString(R.string.dialog_ok)) { _, _ -> setPreferences() val edit = callingActivity.findViewById(R.id.password) - edit.setText(passwordText.text) + edit.setText(binding.xkPasswordText.text) } // flip neutral and negative buttons @@ -104,11 +75,11 @@ class XkPasswordGeneratorDialogFragment : DialogFragment() { dialog.setOnShowListener { setPreferences() - makeAndSetPassword(passwordText) + makeAndSetPassword(binding.xkPasswordText) dialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener { setPreferences() - makeAndSetPassword(passwordText) + makeAndSetPassword(binding.xkPasswordText) } } return dialog @@ -117,13 +88,11 @@ class XkPasswordGeneratorDialogFragment : DialogFragment() { private fun makeAndSetPassword(passwordText: AppCompatTextView) { try { passwordText.text = PasswordBuilder(requireContext()) - .setNumberOfWords(Integer.valueOf(editNumWords.text.toString())) + .setNumberOfWords(Integer.valueOf(binding.xkNumWords.text.toString())) .setMinimumWordLength(DEFAULT_MIN_WORD_LENGTH) .setMaximumWordLength(DEFAULT_MAX_WORD_LENGTH) - .setSeparator(editSeparator.text.toString()) - .appendNumbers(if (cbNumbers.isChecked) Integer.parseInt(spinnerNumbersCount.selectedItem as String) else 0) - .appendSymbols(if (cbSymbols.isChecked) Integer.parseInt(spinnerSymbolsCount.selectedItem as String) else 0) - .setCapitalization(CapsType.valueOf(spinnerCapsType.selectedItem.toString())).create() + .setSeparator(binding.xkSeparator.text.toString()) + .setCapitalization(CapsType.valueOf(binding.xkCapType.selectedItem.toString())).create() } catch (e: PasswordGenerator.PasswordGeneratorException) { Toast.makeText(requireActivity(), e.message, Toast.LENGTH_SHORT).show() tag("xkpw").e(e, "failure generating xkpasswd") @@ -133,24 +102,16 @@ class XkPasswordGeneratorDialogFragment : DialogFragment() { private fun setPreferences() { prefs.edit { - putBoolean(PREF_KEY_USE_NUMERALS, cbNumbers.isChecked) - putBoolean(PREF_KEY_USE_SYMBOLS, cbSymbols.isChecked) - putString(PREF_KEY_CAPITALS_STYLE, spinnerCapsType.selectedItem.toString()) - putString(PREF_KEY_NUM_WORDS, editNumWords.text.toString()) - putString(PREF_KEY_SEPARATOR, editSeparator.text.toString()) - putInt(PREF_KEY_NUMBERS_COUNT, Integer.parseInt(spinnerNumbersCount.selectedItem as String) - 1) - putInt(PREF_KEY_SYMBOLS_COUNT, Integer.parseInt(spinnerSymbolsCount.selectedItem as String) - 1) + putString(PREF_KEY_CAPITALS_STYLE, binding.xkCapType.selectedItem.toString()) + putString(PREF_KEY_NUM_WORDS, binding.xkNumWords.text.toString()) + putString(PREF_KEY_SEPARATOR, binding.xkSeparator.text.toString()) } } companion object { - const val PREF_KEY_USE_NUMERALS = "pref_key_use_numerals" - const val PREF_KEY_USE_SYMBOLS = "pref_key_use_symbols" const val PREF_KEY_CAPITALS_STYLE = "pref_key_capitals_style" const val PREF_KEY_NUM_WORDS = "pref_key_num_words" const val PREF_KEY_SEPARATOR = "pref_key_separator" - const val PREF_KEY_NUMBERS_COUNT = "pref_key_xkpwgen_numbers_count" - const val PREF_KEY_SYMBOLS_COUNT = "pref_key_symbols_count" val DEFAULT_CAPS_STYLE = CapsType.Sentencecase.name val DEFAULT_CAPS_INDEX = CapsType.Sentencecase.ordinal const val DEFAULT_NUMBER_OF_WORDS = "3" diff --git a/app/src/main/res/color/outlined_box_selector.xml b/app/src/main/res/color/outlined_box_selector.xml new file mode 100644 index 00000000..f66b8669 --- /dev/null +++ b/app/src/main/res/color/outlined_box_selector.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/src/main/res/drawable-nodpi/autofill_ins_1.png b/app/src/main/res/drawable-nodpi/autofill_ins_1.png deleted file mode 100644 index 35995426..00000000 Binary files a/app/src/main/res/drawable-nodpi/autofill_ins_1.png and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/autofill_ins_1.webp b/app/src/main/res/drawable-nodpi/autofill_ins_1.webp new file mode 100644 index 00000000..accd87f7 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/autofill_ins_1.webp differ diff --git a/app/src/main/res/drawable-nodpi/autofill_ins_2.png b/app/src/main/res/drawable-nodpi/autofill_ins_2.png deleted file mode 100644 index bd54ea68..00000000 Binary files a/app/src/main/res/drawable-nodpi/autofill_ins_2.png and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/autofill_ins_2.webp b/app/src/main/res/drawable-nodpi/autofill_ins_2.webp new file mode 100644 index 00000000..f84b2025 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/autofill_ins_2.webp differ diff --git a/app/src/main/res/drawable-nodpi/autofill_ins_3.png b/app/src/main/res/drawable-nodpi/autofill_ins_3.png deleted file mode 100644 index 81fa8ece..00000000 Binary files a/app/src/main/res/drawable-nodpi/autofill_ins_3.png and /dev/null differ diff --git a/app/src/main/res/drawable-nodpi/autofill_ins_3.webp b/app/src/main/res/drawable-nodpi/autofill_ins_3.webp new file mode 100644 index 00000000..23a63151 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/autofill_ins_3.webp differ diff --git a/app/src/main/res/drawable-v24/ic_launcher_background.xml b/app/src/main/res/drawable-v24/ic_launcher_background.xml new file mode 100644 index 00000000..8c1c8731 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_background.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_action_new_folder.xml b/app/src/main/res/drawable/ic_action_new_folder.xml index 34d56be8..f977a24c 100644 --- a/app/src/main/res/drawable/ic_action_new_folder.xml +++ b/app/src/main/res/drawable/ic_action_new_folder.xml @@ -9,6 +9,6 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_action_new_password.xml b/app/src/main/res/drawable/ic_action_new_password.xml index 3d455302..050bf700 100644 --- a/app/src/main/res/drawable/ic_action_new_password.xml +++ b/app/src/main/res/drawable/ic_action_new_password.xml @@ -9,6 +9,6 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_add_48dp.xml b/app/src/main/res/drawable/ic_add_48dp.xml new file mode 100644 index 00000000..704f2e36 --- /dev/null +++ b/app/src/main/res/drawable/ic_add_48dp.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_add_white_48dp.xml b/app/src/main/res/drawable/ic_add_white_48dp.xml deleted file mode 100644 index bb286674..00000000 --- a/app/src/main/res/drawable/ic_add_white_48dp.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_clear_white_24dp.xml b/app/src/main/res/drawable/ic_clear_white_24dp.xml deleted file mode 100644 index 22e773a6..00000000 --- a/app/src/main/res/drawable/ic_clear_white_24dp.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_content_copy.xml b/app/src/main/res/drawable/ic_content_copy.xml index efa36fca..8b48b94d 100644 --- a/app/src/main/res/drawable/ic_content_copy.xml +++ b/app/src/main/res/drawable/ic_content_copy.xml @@ -9,6 +9,6 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_content_copy_white_24dp.xml b/app/src/main/res/drawable/ic_content_copy_white_24dp.xml deleted file mode 100644 index f658feb6..00000000 --- a/app/src/main/res/drawable/ic_content_copy_white_24dp.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_delete_24dp.xml b/app/src/main/res/drawable/ic_delete_24dp.xml new file mode 100644 index 00000000..330ab20d --- /dev/null +++ b/app/src/main/res/drawable/ic_delete_24dp.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_delete_white_24dp.xml b/app/src/main/res/drawable/ic_delete_white_24dp.xml deleted file mode 100644 index 8a8383b0..00000000 --- a/app/src/main/res/drawable/ic_delete_white_24dp.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_done_24dp.xml b/app/src/main/res/drawable/ic_done_24dp.xml new file mode 100644 index 00000000..dcfd1d24 --- /dev/null +++ b/app/src/main/res/drawable/ic_done_24dp.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_done_white_24dp.xml b/app/src/main/res/drawable/ic_done_white_24dp.xml deleted file mode 100644 index f8b24986..00000000 --- a/app/src/main/res/drawable/ic_done_white_24dp.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_edit_24dp.xml b/app/src/main/res/drawable/ic_edit_24dp.xml new file mode 100644 index 00000000..2506262b --- /dev/null +++ b/app/src/main/res/drawable/ic_edit_24dp.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_edit_white_24dp.xml b/app/src/main/res/drawable/ic_edit_white_24dp.xml deleted file mode 100644 index 3ddd4e97..00000000 --- a/app/src/main/res/drawable/ic_edit_white_24dp.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml deleted file mode 100644 index f299dbc2..00000000 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_move_folder_24dp.xml b/app/src/main/res/drawable/ic_move_folder_24dp.xml new file mode 100644 index 00000000..0f068028 --- /dev/null +++ b/app/src/main/res/drawable/ic_move_folder_24dp.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_move_folder_white_24dp.xml b/app/src/main/res/drawable/ic_move_folder_white_24dp.xml deleted file mode 100644 index 4bd7c896..00000000 --- a/app/src/main/res/drawable/ic_move_folder_white_24dp.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_save_24dp.xml b/app/src/main/res/drawable/ic_save_24dp.xml new file mode 100644 index 00000000..65e9ddcc --- /dev/null +++ b/app/src/main/res/drawable/ic_save_24dp.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_save_copy_24dp.xml b/app/src/main/res/drawable/ic_save_copy_24dp.xml new file mode 100644 index 00000000..f491a461 --- /dev/null +++ b/app/src/main/res/drawable/ic_save_copy_24dp.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_save_copy_white_24dp.xml b/app/src/main/res/drawable/ic_save_copy_white_24dp.xml deleted file mode 100644 index f93daf79..00000000 --- a/app/src/main/res/drawable/ic_save_copy_white_24dp.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_save_white_24dp.xml b/app/src/main/res/drawable/ic_save_white_24dp.xml deleted file mode 100644 index 0f1211d1..00000000 --- a/app/src/main/res/drawable/ic_save_white_24dp.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_search_24dp.xml b/app/src/main/res/drawable/ic_search_24dp.xml new file mode 100644 index 00000000..7e871e46 --- /dev/null +++ b/app/src/main/res/drawable/ic_search_24dp.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_search_white_24dp.xml b/app/src/main/res/drawable/ic_search_white_24dp.xml deleted file mode 100644 index f7f738e0..00000000 --- a/app/src/main/res/drawable/ic_search_white_24dp.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_share_24dp.xml b/app/src/main/res/drawable/ic_share_24dp.xml new file mode 100644 index 00000000..5ec00d5f --- /dev/null +++ b/app/src/main/res/drawable/ic_share_24dp.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_share_white_24dp.xml b/app/src/main/res/drawable/ic_share_white_24dp.xml deleted file mode 100644 index 2090328d..00000000 --- a/app/src/main/res/drawable/ic_share_white_24dp.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/app/src/main/res/layout/activity_oreo_autofill_filter.xml b/app/src/main/res/layout/activity_oreo_autofill_filter.xml index 607a5568..10e24bd4 100644 --- a/app/src/main/res/layout/activity_oreo_autofill_filter.xml +++ b/app/src/main/res/layout/activity_oreo_autofill_filter.xml @@ -17,7 +17,7 @@ android:layout_height="50dp" android:background="@color/primary_color" android:contentDescription="@string/app_name" - android:src="@drawable/ic_launcher_foreground" + android:src="@mipmap/ic_launcher_foreground" app:layout_constraintBottom_toTopOf="@id/searchLayout" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -76,7 +76,7 @@ - - - @@ -48,9 +48,9 @@