mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-20 17:11:32 -08:00
Rename lock or reset timeout method
This commit is contained in:
1 parent
7ebf64939b
commit
4fcb2de2bb
3 files changed
+4
-4
No files matched your search
@@ -345,7 +345,7 @@ public class GroupActivity extends LockingActivity
|
||||
|
||||
private void openGroup(PwGroup group, boolean isASearch) {
|
||||
// Check TimeoutHelper
|
||||
TimeoutHelper.INSTANCE.resetTime(this, () -> {
|
||||
TimeoutHelper.INSTANCE.lockOrResetTimeout(this, () -> {
|
||||
// Open a group in a new fragment
|
||||
ListNodesFragment newListNodeFragment = ListNodesFragment.newInstance(group, getReadOnly(), isASearch);
|
||||
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
|
||||
|
||||
@@ -134,14 +134,14 @@ abstract class LockingActivity : StylishActivity() {
|
||||
views.forEach {
|
||||
it.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (hasFocus) {
|
||||
TimeoutHelper.resetTime(this)
|
||||
TimeoutHelper.lockOrResetTimeout(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
TimeoutHelper.resetTime(this) {
|
||||
TimeoutHelper.lockOrResetTimeout(this) {
|
||||
super.onBackPressed()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ object TimeoutHelper {
|
||||
return true
|
||||
}
|
||||
|
||||
fun resetTime(activity: Activity, action: (() -> Unit)? = null) {
|
||||
fun lockOrResetTimeout(activity: Activity, action: (() -> Unit)? = null) {
|
||||
if (checkTime(activity)) {
|
||||
recordTime(activity)
|
||||
action?.invoke()
|
||||
|
||||
Reference in new issue
Block a user