Added screenshotsAllowed to data model but functionality is not implemented yet
This commit is contained in:
parent
93e348edc1
commit
b283a3014b
|
@ -190,7 +190,7 @@ open class RoomBankingPersistence(protected open val applicationContext: Context
|
|||
|
||||
override fun saveOrUpdateAppSettings(appSettings: AppSettings) {
|
||||
val mapped = net.dankito.banking.persistence.model.AppSettings(appSettings.automaticallyUpdateAccountsAfterMinutes,
|
||||
appSettings.lockAppAfterMinutes)
|
||||
appSettings.lockAppAfterMinutes, appSettings.screenshotsAllowed)
|
||||
database.appSettingsDao().saveOrUpdate(mapped)
|
||||
|
||||
saveOrUpdateTanMethodSettings(appSettings.flickerCodeSettings, FlickerCodeTanMethodSettingsId)
|
||||
|
@ -214,6 +214,7 @@ open class RoomBankingPersistence(protected open val applicationContext: Context
|
|||
database.appSettingsDao().getAll().firstOrNull { it.id == AppSettingsId }?.let { persistedSettings ->
|
||||
settings.automaticallyUpdateAccountsAfterMinutes = persistedSettings.automaticallyUpdateAccountsAfterMinutes
|
||||
settings.lockAppAfterMinutes = persistedSettings.lockAppAfterMinutes
|
||||
settings.screenshotsAllowed = persistedSettings.screenshotsAllowed
|
||||
}
|
||||
|
||||
settings.flickerCodeSettings = findTanMethodSettings(FlickerCodeTanMethodSettingsId, tanMethodSettings)
|
||||
|
|
|
@ -9,10 +9,11 @@ import net.dankito.banking.ui.model.settings.AppSettings
|
|||
@Entity
|
||||
open class AppSettings(
|
||||
open var automaticallyUpdateAccountsAfterMinutes: Int? = AppSettings.DefaultAutomaticallyUpdateAccountsAfterMinutes,
|
||||
open var lockAppAfterMinutes: Int? = null
|
||||
open var lockAppAfterMinutes: Int? = null,
|
||||
open var screenshotsAllowed: Boolean = false
|
||||
) {
|
||||
|
||||
internal constructor() : this(AppSettings.DefaultAutomaticallyUpdateAccountsAfterMinutes, null)
|
||||
internal constructor() : this(AppSettings.DefaultAutomaticallyUpdateAccountsAfterMinutes, null, false)
|
||||
|
||||
@PrimaryKey
|
||||
open var id: Int = RoomBankingPersistence.AppSettingsId
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.dankito.utils.multiplatform.UUID
|
|||
open class AppSettings(
|
||||
open var automaticallyUpdateAccountsAfterMinutes: Int? = DefaultAutomaticallyUpdateAccountsAfterMinutes,
|
||||
open var lockAppAfterMinutes: Int? = null,
|
||||
open var screenshotsAllowed: Boolean = false, // TODO: implement
|
||||
open var flickerCodeSettings: TanMethodSettings? = null,
|
||||
open var qrCodeSettings: TanMethodSettings? = null,
|
||||
open var photoTanSettings: TanMethodSettings? = null
|
||||
|
@ -16,7 +17,7 @@ open class AppSettings(
|
|||
}
|
||||
|
||||
|
||||
internal constructor() : this(DefaultAutomaticallyUpdateAccountsAfterMinutes, null, null, null) // for object deserializers
|
||||
internal constructor() : this(DefaultAutomaticallyUpdateAccountsAfterMinutes, null, false, null, null) // for object deserializers
|
||||
|
||||
|
||||
open var technicalId: String = UUID.random()
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
<entity name="PersistedAppSettings" representedClassName="PersistedAppSettings" syncable="YES" codeGenerationType="class">
|
||||
<attribute name="automaticallyUpdateAccountsAfterMinutes" optional="YES" attributeType="Integer 32" defaultValueString="360" usesScalarValueType="NO"/>
|
||||
<attribute name="lockAppAfterMinutes" optional="YES" attributeType="Integer 32" defaultValueString="-1" usesScalarValueType="NO"/>
|
||||
<attribute name="screenshotsAllowed" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||
<relationship name="flickerCodeSettings" optional="YES" maxCount="1" deletionRule="Cascade" destinationEntity="PersistedTanMethodSettings"/>
|
||||
<relationship name="photoTanSettings" optional="YES" maxCount="1" deletionRule="Cascade" destinationEntity="PersistedTanMethodSettings"/>
|
||||
<relationship name="qrCodeSettings" optional="YES" maxCount="1" deletionRule="Cascade" destinationEntity="PersistedTanMethodSettings"/>
|
||||
|
@ -108,7 +109,7 @@
|
|||
</entity>
|
||||
<elements>
|
||||
<element name="PersistedAccountTransaction" positionX="-36" positionY="45" width="128" height="553"/>
|
||||
<element name="PersistedAppSettings" positionX="-45" positionY="144" width="128" height="118"/>
|
||||
<element name="PersistedAppSettings" positionX="-45" positionY="144" width="128" height="133"/>
|
||||
<element name="PersistedBankAccount" positionX="-54" positionY="63" width="128" height="418"/>
|
||||
<element name="PersistedBankData" positionX="-63" positionY="-18" width="128" height="298"/>
|
||||
<element name="PersistedTanMedium" positionX="-45" positionY="144" width="128" height="28"/>
|
||||
|
|
|
@ -321,6 +321,7 @@ class Mapper {
|
|||
let mapped = AppSettings(
|
||||
automaticallyUpdateAccountsAfterMinutes: mapToInt(settings.automaticallyUpdateAccountsAfterMinutes),
|
||||
lockAppAfterMinutes: mapToInt(settings.lockAppAfterMinutes),
|
||||
screenshotsAllowed: settings.screenshotsAllowed,
|
||||
flickerCodeSettings: map(settings.flickerCodeSettings),
|
||||
qrCodeSettings: map(settings.qrCodeSettings),
|
||||
photoTanSettings: map(settings.photoTanSettings))
|
||||
|
@ -335,6 +336,7 @@ class Mapper {
|
|||
|
||||
mapped.automaticallyUpdateAccountsAfterMinutes = mapFromInt(settings.automaticallyUpdateAccountsAfterMinutes)
|
||||
mapped.lockAppAfterMinutes = mapFromInt(settings.lockAppAfterMinutes)
|
||||
mapped.screenshotsAllowed = settings.screenshotsAllowed
|
||||
|
||||
mapped.flickerCodeSettings = map(settings.flickerCodeSettings, context)
|
||||
mapped.qrCodeSettings = map(settings.qrCodeSettings, context)
|
||||
|
|
Loading…
Reference in New Issue