mirror of
https://github.com/android-password-store/Android-Password-Store.git
synced 2025-09-06 04:51:38 +02:00
Treewide: Reformat code
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
This commit is contained in:
parent
7d7e7c3a9a
commit
348ef00509
|
@ -45,7 +45,8 @@ class ClipboardService : Service() {
|
|||
}
|
||||
|
||||
ACTION_START -> {
|
||||
val time = settings.getString(PreferenceKeys.GENERAL_SHOW_TIME)?.toIntOrNull() ?: 45
|
||||
val time = settings.getString(PreferenceKeys.GENERAL_SHOW_TIME)?.toIntOrNull()
|
||||
?: 45
|
||||
|
||||
if (time == 0) {
|
||||
stopSelf()
|
||||
|
|
|
@ -23,8 +23,8 @@ import androidx.lifecycle.lifecycleScope
|
|||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.github.michaelbull.result.fold
|
||||
import com.github.michaelbull.result.runCatching
|
||||
import com.github.michaelbull.result.onFailure
|
||||
import com.github.michaelbull.result.runCatching
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.zeapo.pwdstore.databinding.PasswordRecyclerViewBinding
|
||||
import com.zeapo.pwdstore.git.BaseGitActivity
|
||||
|
|
|
@ -61,11 +61,11 @@ import com.zeapo.pwdstore.utils.PasswordRepository.Companion.initialize
|
|||
import com.zeapo.pwdstore.utils.PasswordRepository.Companion.isInitialized
|
||||
import com.zeapo.pwdstore.utils.PreferenceKeys
|
||||
import com.zeapo.pwdstore.utils.base64
|
||||
import com.zeapo.pwdstore.utils.isPermissionGranted
|
||||
import com.zeapo.pwdstore.utils.commitChange
|
||||
import com.zeapo.pwdstore.utils.contains
|
||||
import com.zeapo.pwdstore.utils.getString
|
||||
import com.zeapo.pwdstore.utils.isInsideRepository
|
||||
import com.zeapo.pwdstore.utils.isPermissionGranted
|
||||
import com.zeapo.pwdstore.utils.listFilesRecursively
|
||||
import com.zeapo.pwdstore.utils.requestInputFocusOnView
|
||||
import com.zeapo.pwdstore.utils.sharedPrefs
|
||||
|
|
|
@ -92,36 +92,36 @@ class GitConfigActivity : BaseGitActivity() {
|
|||
binding.gitAbortRebase.setOnClickListener {
|
||||
lifecycleScope.launch {
|
||||
launchGitOperation(BREAK_OUT_OF_DETACHED).fold(
|
||||
success = {
|
||||
MaterialAlertDialogBuilder(this@GitConfigActivity).run {
|
||||
setTitle(resources.getString(R.string.git_abort_and_push_title))
|
||||
setMessage(resources.getString(
|
||||
R.string.git_break_out_of_detached_success,
|
||||
GitSettings.branch,
|
||||
"conflicting-${GitSettings.branch}-...",
|
||||
))
|
||||
setOnDismissListener() { finish() }
|
||||
setPositiveButton(resources.getString(R.string.dialog_ok)) { _, _ -> }
|
||||
show()
|
||||
}
|
||||
},
|
||||
failure = { err ->
|
||||
promptOnErrorHandler(err) {
|
||||
finish()
|
||||
}
|
||||
},
|
||||
success = {
|
||||
MaterialAlertDialogBuilder(this@GitConfigActivity).run {
|
||||
setTitle(resources.getString(R.string.git_abort_and_push_title))
|
||||
setMessage(resources.getString(
|
||||
R.string.git_break_out_of_detached_success,
|
||||
GitSettings.branch,
|
||||
"conflicting-${GitSettings.branch}-...",
|
||||
))
|
||||
setOnDismissListener() { finish() }
|
||||
setPositiveButton(resources.getString(R.string.dialog_ok)) { _, _ -> }
|
||||
show()
|
||||
}
|
||||
},
|
||||
failure = { err ->
|
||||
promptOnErrorHandler(err) {
|
||||
finish()
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
binding.gitResetToRemote.setOnClickListener {
|
||||
lifecycleScope.launch {
|
||||
launchGitOperation(REQUEST_RESET).fold(
|
||||
success = ::finishOnSuccessHandler,
|
||||
failure = { err ->
|
||||
promptOnErrorHandler(err) {
|
||||
finish()
|
||||
}
|
||||
},
|
||||
success = ::finishOnSuccessHandler,
|
||||
failure = { err ->
|
||||
promptOnErrorHandler(err) {
|
||||
finish()
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,10 +71,11 @@ class SshjSessionFactory(private val authMethod: SshAuthMethod, private val host
|
|||
private var currentSession: SshjSession? = null
|
||||
|
||||
override fun getSession(uri: URIish, credentialsProvider: CredentialsProvider?, fs: FS?, tms: Int): RemoteSession {
|
||||
return currentSession ?: SshjSession(uri, uri.user, authMethod, hostKeyFile).connect().also {
|
||||
d { "New SSH connection created" }
|
||||
currentSession = it
|
||||
}
|
||||
return currentSession
|
||||
?: SshjSession(uri, uri.user, authMethod, hostKeyFile).connect().also {
|
||||
d { "New SSH connection created" }
|
||||
currentSession = it
|
||||
}
|
||||
}
|
||||
|
||||
fun close() {
|
||||
|
|
|
@ -57,7 +57,8 @@ open class PasswordItemRecyclerAdapter :
|
|||
name.text = spannable
|
||||
if (item.type == PasswordItem.TYPE_CATEGORY) {
|
||||
folderIndicator.visibility = View.VISIBLE
|
||||
val count = item.file.listFiles { path -> path.isDirectory || path.extension == "gpg" }?.size ?: 0
|
||||
val count = item.file.listFiles { path -> path.isDirectory || path.extension == "gpg" }?.size
|
||||
?: 0
|
||||
childCount.visibility = if (count > 0) View.VISIBLE else View.GONE
|
||||
childCount.text = "$count"
|
||||
} else {
|
||||
|
|
|
@ -9,9 +9,9 @@ import android.content.SharedPreferences
|
|||
import android.os.Build
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.core.content.edit
|
||||
import com.github.michaelbull.result.runCatching
|
||||
import com.github.michaelbull.result.getOrElse
|
||||
import com.github.michaelbull.result.onFailure
|
||||
import com.github.michaelbull.result.runCatching
|
||||
import com.zeapo.pwdstore.Application
|
||||
import java.io.File
|
||||
import java.io.FileFilter
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<objectAnimator
|
||||
android:duration="500"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<objectAnimator
|
||||
android:duration="500"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<objectAnimator
|
||||
android:duration="500"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorPrimary"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorPrimary"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorPrimary"
|
||||
|
|
Loading…
Reference in a new issue