summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-05-10 14:25:59 +0530
committerGitHub <noreply@github.com>2020-05-10 14:25:59 +0530
commit94dc92f8d70870b57a7f8c4fe8adef152c1211ce (patch)
tree4139557d2cc1311daf807124cde16a17058143fb /app/src/main/java
parent9a77f6bbea95034f6dd6cdb2e0351a90dc3906f4 (diff)
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 <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/sshkeygen/SshKeyGenFragment.kt17
1 files changed, 1 insertions, 16 deletions
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()) {