Skip to content

Commit

Permalink
Treewide: Reformat code
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
  • Loading branch information
Skrilltrax committed Sep 14, 2020
1 parent 7d7e7c3 commit 348ef00
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 40 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/com/zeapo/pwdstore/ClipboardService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 24 additions & 24 deletions app/src/main/java/com/zeapo/pwdstore/git/GitConfigActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
},
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/animator/slide_in_right.xml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/animator/slide_out_left.xml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/animator/slide_out_right.xml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_onboarding.xml
Original file line number Diff line number Diff line change
@@ -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">

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_clone.xml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_repo_location.xml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_welcome.xml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 348ef00

Please sign in to comment.