From 94dc92f8d70870b57a7f8c4fe8adef152c1211ce Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 10 May 2020 14:25:59 +0530 Subject: Miscellaneous UI tweaking (#771) * Remove dangling UI element and relayout authentication modes * Drop unnecessary actionBarPopupTheme declaration * Improve ssh keygen UI * Commonize button styling * Tweak save button in server config * Tweak generate button in ssh keygen * Commonize OutlinedButton style Signed-off-by: Harsh Shandilya --- .../com/zeapo/pwdstore/sshkeygen/SshKeyGenFragment.kt | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'app/src/main/java/com') diff --git a/app/src/main/java/com/zeapo/pwdstore/sshkeygen/SshKeyGenFragment.kt b/app/src/main/java/com/zeapo/pwdstore/sshkeygen/SshKeyGenFragment.kt index da7099ad..e16af70a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/sshkeygen/SshKeyGenFragment.kt +++ b/app/src/main/java/com/zeapo/pwdstore/sshkeygen/SshKeyGenFragment.kt @@ -5,7 +5,6 @@ package com.zeapo.pwdstore.sshkeygen import android.os.Bundle -import android.text.InputType import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -47,19 +46,6 @@ class SshKeyGenFragment : Fragment() { generate.setOnClickListener { lifecycleScope.launch { generate(passphrase.text.toString(), comment.text.toString()) } } - showPassphrase.setOnCheckedChangeListener { _, isChecked: Boolean -> - val selection = passphrase.selectionEnd - if (isChecked) { - passphrase.inputType = ( - InputType.TYPE_CLASS_TEXT - or InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) - } else { - passphrase.inputType = ( - InputType.TYPE_CLASS_TEXT - or InputType.TYPE_TEXT_VARIATION_PASSWORD) - } - passphrase.setSelection(selection) - } keyLengthGroup.check(R.id.key_length_4096) keyLengthGroup.addOnButtonCheckedListener { _, checkedId, isChecked -> if (isChecked) { @@ -82,10 +68,9 @@ class SshKeyGenFragment : Fragment() { // ShowSshKeyFragment which displays the public key. private suspend fun generate(passphrase: String, comment: String) { binding.generate.text = getString(R.string.ssh_key_gen_generating_progress) - val jsch = JSch() val e = try { withContext(Dispatchers.IO) { - val kp = KeyPair.genKeyPair(jsch, KeyPair.RSA, keyLength) + val kp = KeyPair.genKeyPair(JSch(), KeyPair.RSA, keyLength) var file = File(requireActivity().filesDir, ".ssh_key") var out = FileOutputStream(file, false) if (passphrase.isNotEmpty()) { -- cgit v1.2.3