From 041cf00510a75042223d1857660fc7f1dff958ef Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 10 May 2020 19:21:39 +0530 Subject: Treewide codestyle cleanup (#765) - Updated gitignore and checked in the IDE's codestyle config - Removed spotless as the underlying ktlint backend has failed to resolve the super frustrating import order bug[1] in nearly a year - Reformat the entire codebase based on the previously committed code style configuration. 1: https://github.com/pinterest/ktlint/issues/527 --- .../com/zeapo/pwdstore/sshkeygen/ShowSshKeyFragment.kt | 5 +++-- .../com/zeapo/pwdstore/sshkeygen/SshKeyGenActivity.kt | 6 +++--- .../com/zeapo/pwdstore/sshkeygen/SshKeyGenFragment.kt | 16 ++++++++-------- 3 files changed, 14 insertions(+), 13 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/sshkeygen') diff --git a/app/src/main/java/com/zeapo/pwdstore/sshkeygen/ShowSshKeyFragment.kt b/app/src/main/java/com/zeapo/pwdstore/sshkeygen/ShowSshKeyFragment.kt index 81fc7d7c..0a70d74a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/sshkeygen/ShowSshKeyFragment.kt +++ b/app/src/main/java/com/zeapo/pwdstore/sshkeygen/ShowSshKeyFragment.kt @@ -16,9 +16,9 @@ import androidx.core.content.getSystemService import androidx.fragment.app.DialogFragment import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.zeapo.pwdstore.R +import org.apache.commons.io.FileUtils import java.io.File import java.nio.charset.StandardCharsets -import org.apache.commons.io.FileUtils class ShowSshKeyFragment : DialogFragment() { @@ -41,7 +41,8 @@ class ShowSshKeyFragment : DialogFragment() { ad.setOnShowListener { val b = ad.getButton(AlertDialog.BUTTON_NEUTRAL) b.setOnClickListener { - val clipboard = activity.getSystemService() ?: return@setOnClickListener + val clipboard = activity.getSystemService() + ?: return@setOnClickListener val clip = ClipData.newPlainText("public key", publicKey.text.toString()) clipboard.setPrimaryClip(clip) } diff --git a/app/src/main/java/com/zeapo/pwdstore/sshkeygen/SshKeyGenActivity.kt b/app/src/main/java/com/zeapo/pwdstore/sshkeygen/SshKeyGenActivity.kt index 8885b038..2bb04e20 100644 --- a/app/src/main/java/com/zeapo/pwdstore/sshkeygen/SshKeyGenActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/sshkeygen/SshKeyGenActivity.kt @@ -15,9 +15,9 @@ class SshKeyGenActivity : AppCompatActivity() { supportActionBar?.setDisplayHomeAsUpEnabled(true) if (savedInstanceState == null) { supportFragmentManager - .beginTransaction() - .replace(android.R.id.content, SshKeyGenFragment()) - .commit() + .beginTransaction() + .replace(android.R.id.content, SshKeyGenFragment()) + .commit() } } 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 e16af70a..923b53a4 100644 --- a/app/src/main/java/com/zeapo/pwdstore/sshkeygen/SshKeyGenFragment.kt +++ b/app/src/main/java/com/zeapo/pwdstore/sshkeygen/SshKeyGenFragment.kt @@ -19,11 +19,11 @@ import com.jcraft.jsch.JSch import com.jcraft.jsch.KeyPair import com.zeapo.pwdstore.R import com.zeapo.pwdstore.databinding.FragmentSshKeygenBinding -import java.io.File -import java.io.FileOutputStream import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import java.io.File +import java.io.FileOutputStream class SshKeyGenFragment : Fragment() { @@ -96,12 +96,12 @@ class SshKeyGenFragment : Fragment() { prefs.edit { putBoolean("use_generated_key", true) } } else { MaterialAlertDialogBuilder(activity) - .setTitle(activity.getString(R.string.error_generate_ssh_key)) - .setMessage(activity.getString(R.string.ssh_key_error_dialog_text) + e.message) - .setPositiveButton(activity.getString(R.string.dialog_ok)) { _, _ -> - requireActivity().finish() - } - .show() + .setTitle(activity.getString(R.string.error_generate_ssh_key)) + .setMessage(activity.getString(R.string.ssh_key_error_dialog_text) + e.message) + .setPositiveButton(activity.getString(R.string.dialog_ok)) { _, _ -> + requireActivity().finish() + } + .show() } hideKeyboard() } -- cgit v1.2.3