mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-12-01 14:22:48 -08:00
Allow null default item in selection
This commit is contained in:
1 parent
422984ac41
commit
55fe10d2dc
6 files changed
+13
-18
No files matched your search
+2
-3
@@ -47,9 +47,8 @@ class DatabaseDataCompressionPreferenceDialogFragmentCompat
|
||||
recyclerView.adapter = compressionAdapter
|
||||
|
||||
mDatabase?.let { database ->
|
||||
compressionSelected = database.compressionAlgorithm?.apply {
|
||||
compressionAdapter.setItems(database.availableCompressionAlgorithms, this)
|
||||
}
|
||||
compressionSelected = database.compressionAlgorithm
|
||||
compressionAdapter.setItems(database.availableCompressionAlgorithms, compressionSelected)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -47,9 +47,8 @@ class DatabaseEncryptionAlgorithmPreferenceDialogFragmentCompat
|
||||
recyclerView.adapter = encryptionAlgorithmAdapter
|
||||
|
||||
mDatabase?.let { database ->
|
||||
algorithmSelected = database.encryptionAlgorithm?.apply {
|
||||
encryptionAlgorithmAdapter.setItems(database.availableEncryptionAlgorithms, this)
|
||||
}
|
||||
algorithmSelected = database.encryptionAlgorithm
|
||||
encryptionAlgorithmAdapter.setItems(database.availableEncryptionAlgorithms, algorithmSelected)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -51,9 +51,8 @@ class DatabaseKeyDerivationPreferenceDialogFragmentCompat
|
||||
recyclerView.adapter = kdfAdapter
|
||||
|
||||
mDatabase?.let { database ->
|
||||
kdfEngineSelected = database.kdfEngine?.apply {
|
||||
kdfAdapter.setItems(database.availableKdfEngines, this)
|
||||
}
|
||||
kdfEngineSelected = database.kdfEngine
|
||||
kdfAdapter.setItems(database.availableKdfEngines, kdfEngineSelected)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -45,9 +45,8 @@ class DatabaseRecycleBinGroupPreferenceDialogFragmentCompat
|
||||
recyclerView.adapter = groupsAdapter
|
||||
|
||||
mDatabase?.let { database ->
|
||||
mGroupRecycleBin = database.recycleBin?.apply {
|
||||
groupsAdapter.setItems(database.getAllGroupsWithoutRoot(), this)
|
||||
}
|
||||
mGroupRecycleBin = database.recycleBin
|
||||
groupsAdapter.setItems(database.getAllGroupsWithoutRoot(), mGroupRecycleBin)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -45,9 +45,8 @@ class DatabaseTemplatesGroupPreferenceDialogFragmentCompat
|
||||
recyclerView.adapter = groupsAdapter
|
||||
|
||||
mDatabase?.let { database ->
|
||||
mGroupTemplates = database.templatesGroup?.apply {
|
||||
groupsAdapter.setItems(database.getAllGroupsWithoutRoot(), this)
|
||||
}
|
||||
mGroupTemplates = database.templatesGroup
|
||||
groupsAdapter.setItems(database.getAllGroupsWithoutRoot(), mGroupTemplates)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -54,10 +54,10 @@ class ListRadioItemAdapter<T>(private val context: Context)
|
||||
return radioItemList.size
|
||||
}
|
||||
|
||||
fun setItems(algorithms: List<T>, algorithmUsed: T) {
|
||||
fun setItems(items: List<T>, itemUsed: T?) {
|
||||
this.radioItemList.clear()
|
||||
this.radioItemList.addAll(algorithms)
|
||||
this.radioItemUsed = algorithmUsed
|
||||
this.radioItemList.addAll(items)
|
||||
this.radioItemUsed = itemUsed
|
||||
}
|
||||
|
||||
private fun setRadioItemUsed(radioItemUsed: T) {
|
||||
|
||||
Reference in new issue
Block a user