aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-06-07 13:06:28 +0530
committerGitHub <noreply@github.com>2022-06-07 07:36:28 +0000
commitc319909582fe3e1d9741b7595073ac3e0b245c0d (patch)
tree26ebc29e1b5ff1cbd340092f7c0ad7e22037fc9f /app
parent9e717b6809a511c6cb6f944913702498cb96b7bf (diff)
Remove SourceCode Pro typeface (#1938)
Diffstat (limited to 'app')
-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!" />