Merge branch 'develop' into feature/Templates

This commit is contained in:
J-Jamet committed 2021-05-07 10:44:40 +02:00
commit 39d95105e1
6 files changed
+17 -21

No files matched your search

@@ -26,8 +26,9 @@ import com.kunzisoft.keepass.utils.unregisterLockReceiver
abstract class LockNotificationService : NotificationService() {
private var onStart: Boolean = false
private var mLockReceiver: LockReceiver? = null
private var mLockReceiver: LockReceiver = LockReceiver {
actionOnLock()
}
protected open fun actionOnLock() {
// Stop the service in all cases
@@ -36,30 +37,17 @@ abstract class LockNotificationService : NotificationService() {
override fun onCreate() {
super.onCreate()
// Register a lock receiver to stop notification service when lock on keyboard is performed
mLockReceiver = LockReceiver {
if (onStart)
actionOnLock()
}
registerLockReceiver(mLockReceiver)
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
onStart = true
return super.onStartCommand(intent, flags, startId)
}
override fun onTaskRemoved(rootIntent: Intent?) {
notificationManager?.cancel(notificationId)
stopSelf()
super.onTaskRemoved(rootIntent)
}
override fun onDestroy() {
unregisterLockReceiver(mLockReceiver)
mLockReceiver = null
super.onDestroy()
}
}
@@ -46,10 +46,10 @@ class EntryField @JvmOverloads constructor(context: Context,
var hiddenProtectedValue: Boolean
get() {
return showButtonView.isSelected
return !showButtonView.isSelected
}
set(value) {
showButtonView.isSelected = !value
showButtonView.isSelected = value
changeProtectedValueParameters()
}
@@ -101,7 +101,7 @@ class EntryField @JvmOverloads constructor(context: Context,
} else {
setTextIsSelectable(true)
}
applyHiddenStyle(isProtected && !showButtonView.isSelected)
applyHiddenStyle(isProtected && showButtonView.isSelected)
if (!isProtected) linkify()
}
}