aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/assets/fonts/sourcecodepro.ttfbin52660 -> 0 bytes
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/ui/dialogs/DicewarePasswordGeneratorDialogFragment.kt8
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/ui/dialogs/PasswordGeneratorDialogFragment.kt12
-rw-r--r--app/src/main/res/font/sourcecodepro.ttfbin52660 -> 0 bytes
-rw-r--r--app/src/main/res/layout/item_field.xml1
5 files changed, 8 insertions, 13 deletions
diff --git a/app/src/main/assets/fonts/sourcecodepro.ttf b/app/src/main/assets/fonts/sourcecodepro.ttf
deleted file mode 100644
index 6eb48e7d..00000000
--- a/app/src/main/assets/fonts/sourcecodepro.ttf
+++ /dev/null
Binary files differ
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/DicewarePasswordGeneratorDialogFragment.kt b/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/DicewarePasswordGeneratorDialogFragment.kt
index cac60de3..22f991c5 100644
--- a/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/DicewarePasswordGeneratorDialogFragment.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/DicewarePasswordGeneratorDialogFragment.kt
@@ -39,12 +39,14 @@ class DicewarePasswordGeneratorDialogFragment : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val builder = MaterialAlertDialogBuilder(requireContext())
+
val binding = FragmentPwgenDicewareBinding.inflate(layoutInflater)
- val monoTypeface = Typeface.createFromAsset(requireContext().assets, "fonts/sourcecodepro.ttf")
+ builder.setView(binding.root)
+
binding.passwordSeparatorText.setText(prefs.getString(DICEWARE_SEPARATOR) ?: "-")
binding.passwordLengthText.setText(prefs.getInt(DICEWARE_LENGTH, 5).toString())
- binding.passwordText.typeface = monoTypeface
- builder.setView(binding.root)
+ binding.passwordText.typeface = Typeface.MONOSPACE
+
merge(
binding.passwordLengthText.afterTextChanges(),
binding.passwordSeparatorText.afterTextChanges(),
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/PasswordGeneratorDialogFragment.kt b/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/PasswordGeneratorDialogFragment.kt
index b0ddc8a7..e14076b1 100644
--- a/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/PasswordGeneratorDialogFragment.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/PasswordGeneratorDialogFragment.kt
@@ -31,25 +31,19 @@ import dev.msfjarvis.aps.passgen.random.PasswordLengthTooShortException
import dev.msfjarvis.aps.passgen.random.PasswordOption
import dev.msfjarvis.aps.ui.crypto.PasswordCreationActivity
import dev.msfjarvis.aps.util.settings.PreferenceKeys
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.merge
import kotlinx.coroutines.flow.onEach
import reactivecircus.flowbinding.android.widget.afterTextChanges
import reactivecircus.flowbinding.android.widget.checkedChanges
-@OptIn(ExperimentalCoroutinesApi::class)
class PasswordGeneratorDialogFragment : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
+ val prefs = requireContext().getSharedPreferences("PasswordGenerator", Context.MODE_PRIVATE)
val builder = MaterialAlertDialogBuilder(requireContext())
- val callingActivity = requireActivity()
- val binding = FragmentPwgenBinding.inflate(layoutInflater)
- val monoTypeface = Typeface.createFromAsset(callingActivity.assets, "fonts/sourcecodepro.ttf")
- val prefs =
- requireActivity()
- .applicationContext.getSharedPreferences("PasswordGenerator", Context.MODE_PRIVATE)
+ val binding = FragmentPwgenBinding.inflate(layoutInflater)
builder.setView(binding.root)
binding.numerals.isChecked = !prefs.getBoolean(PasswordOption.NoDigits.key, false)
@@ -59,7 +53,7 @@ class PasswordGeneratorDialogFragment : DialogFragment() {
binding.ambiguous.isChecked = !prefs.getBoolean(PasswordOption.NoAmbiguousCharacters.key, false)
binding.pronounceable.isChecked = !prefs.getBoolean(PasswordOption.FullyRandom.key, true)
binding.lengthNumber.setText(prefs.getInt(PreferenceKeys.LENGTH, 20).toString())
- binding.passwordText.typeface = monoTypeface
+ binding.passwordText.typeface = Typeface.MONOSPACE
merge(
binding.numerals.checkedChanges().skipInitialValue(),
diff --git a/app/src/main/res/font/sourcecodepro.ttf b/app/src/main/res/font/sourcecodepro.ttf
deleted file mode 100644
index 6eb48e7d..00000000
--- a/app/src/main/res/font/sourcecodepro.ttf
+++ /dev/null
Binary files differ
diff --git a/app/src/main/res/layout/item_field.xml b/app/src/main/res/layout/item_field.xml
index 1bdf2a91..9e8dec3c 100644
--- a/app/src/main/res/layout/item_field.xml
+++ b/app/src/main/res/layout/item_field.xml
@@ -21,7 +21,6 @@
android:id="@+id/item_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:fontFamily="@font/sourcecodepro"
android:inputType="none"
android:textIsSelectable="true"
tools:text="p@55w0rd!" />