mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix new custom field after orientation change
This commit is contained in:
@@ -390,7 +390,7 @@ class TemplateView @JvmOverloads constructor(context: Context,
|
|||||||
return mEntryInfo ?: EntryInfo()
|
return mEntryInfo ?: EntryInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun populateEntryInfoWithViews() {
|
fun populateEntryInfoWithViews(templateFieldNotEmpty: Boolean = true) {
|
||||||
if (mEntryInfo == null)
|
if (mEntryInfo == null)
|
||||||
mEntryInfo = EntryInfo()
|
mEntryInfo = EntryInfo()
|
||||||
|
|
||||||
@@ -429,7 +429,7 @@ class TemplateView @JvmOverloads constructor(context: Context,
|
|||||||
mEntryInfo?.notes = it
|
mEntryInfo?.notes = it
|
||||||
}
|
}
|
||||||
|
|
||||||
retrieveCustomFieldsFromView(true)
|
retrieveCustomFieldsFromView(templateFieldNotEmpty)
|
||||||
|
|
||||||
mEntryInfo?.otpModel = OtpEntryFields.parseFields { key ->
|
mEntryInfo?.otpModel = OtpEntryFields.parseFields { key ->
|
||||||
getCustomField(key).protectedValue.toString()
|
getCustomField(key).protectedValue.toString()
|
||||||
@@ -621,7 +621,7 @@ class TemplateView @JvmOverloads constructor(context: Context,
|
|||||||
override fun onSaveInstanceState(): Parcelable {
|
override fun onSaveInstanceState(): Parcelable {
|
||||||
val superSave = super.onSaveInstanceState()
|
val superSave = super.onSaveInstanceState()
|
||||||
val saveState = SavedState(superSave)
|
val saveState = SavedState(superSave)
|
||||||
populateEntryInfoWithViews()
|
populateEntryInfoWithViews(false)
|
||||||
saveState.template = this.mTemplate
|
saveState.template = this.mTemplate
|
||||||
saveState.entryInfo = this.mEntryInfo
|
saveState.entryInfo = this.mEntryInfo
|
||||||
saveState.tempDateTimeViewId = this.mTempDateTimeViewId
|
saveState.tempDateTimeViewId = this.mTempDateTimeViewId
|
||||||
|
|||||||
Reference in New Issue
Block a user