mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
@@ -1,6 +1,6 @@
|
||||
KeePassDX(3.2.0)
|
||||
* Manage data merge #840 #977
|
||||
* Inherit color from template #1213
|
||||
* Inherit colors and icon from template #1213 #1130
|
||||
* Add path in quick search
|
||||
* Small fixes
|
||||
|
||||
|
||||
@@ -195,7 +195,6 @@ class EntryActivity : DatabaseLockActivity() {
|
||||
ColorDrawable(mColorAccent)
|
||||
}
|
||||
|
||||
val entryTemplate = entryInfoHistory.template
|
||||
val entryInfo = entryInfoHistory.entryInfo
|
||||
// Manage entry copy to start notification if allowed (at the first start)
|
||||
if (savedInstanceState == null) {
|
||||
@@ -215,8 +214,8 @@ class EntryActivity : DatabaseLockActivity() {
|
||||
toolbar?.title = entryTitle
|
||||
mUrl = entryInfo.url
|
||||
// Assign colors
|
||||
mBackgroundColor = entryInfo.backgroundColor ?: entryTemplate.backgroundColor
|
||||
mForegroundColor = entryInfo.foregroundColor ?: entryTemplate.foregroundColor
|
||||
mBackgroundColor = entryInfo.backgroundColor
|
||||
mForegroundColor = entryInfo.foregroundColor
|
||||
|
||||
loadingView?.hideByFading()
|
||||
mEntryLoaded = true
|
||||
|
||||
@@ -185,7 +185,6 @@ class NodesAdapter (private val context: Context,
|
||||
&& oldItem.username == newItem.username
|
||||
&& oldItem.backgroundColor == newItem.backgroundColor
|
||||
&& oldItem.foregroundColor == newItem.foregroundColor
|
||||
&& database.getTemplate(oldItem) == database.getTemplate(newItem)
|
||||
&& oldItem.getOtpElement() == newItem.getOtpElement()
|
||||
&& oldItem.containsAttachment() == newItem.containsAttachment()
|
||||
} else if (oldItem is Group && newItem is Group) {
|
||||
@@ -398,8 +397,6 @@ class NodesAdapter (private val context: Context,
|
||||
// Specific elements for entry
|
||||
if (subNode.type == Type.ENTRY) {
|
||||
val entry = subNode as Entry
|
||||
val entryTemplate = database.getTemplate(entry)
|
||||
|
||||
database.startManageEntry(entry)
|
||||
|
||||
holder.text.text = entry.getVisualTitle()
|
||||
@@ -439,7 +436,7 @@ class NodesAdapter (private val context: Context,
|
||||
if (entry.containsAttachment()) View.VISIBLE else View.GONE
|
||||
|
||||
// Assign colors
|
||||
val backgroundColor = entry.backgroundColor ?: entryTemplate?.backgroundColor
|
||||
val backgroundColor = entry.backgroundColor
|
||||
if (!holder.container.isSelected) {
|
||||
if (backgroundColor != null) {
|
||||
holder.container.setBackgroundColor(backgroundColor)
|
||||
@@ -449,7 +446,7 @@ class NodesAdapter (private val context: Context,
|
||||
} else {
|
||||
holder.container.setBackgroundColor(mColorAccentLight)
|
||||
}
|
||||
val foregroundColor = entry.foregroundColor ?: entryTemplate?.foregroundColor
|
||||
val foregroundColor = entry.foregroundColor
|
||||
if (!holder.container.isSelected) {
|
||||
if (foregroundColor != null) {
|
||||
holder.text.setTextColor(foregroundColor)
|
||||
|
||||
@@ -93,6 +93,7 @@ abstract class TemplateAbstractView<
|
||||
fun setTemplate(template: Template?) {
|
||||
if (mTemplate != template) {
|
||||
mTemplate = template
|
||||
applyTemplateParametersToEntry()
|
||||
if (mEntryInfo != null) {
|
||||
populateEntryInfoWithViews(templateFieldNotEmpty = true,
|
||||
retrieveDefaultValues = false)
|
||||
@@ -104,6 +105,16 @@ abstract class TemplateAbstractView<
|
||||
}
|
||||
}
|
||||
|
||||
private fun applyTemplateParametersToEntry() {
|
||||
// Change the entry icon by the template icon
|
||||
mTemplate?.icon?.let { templateIcon ->
|
||||
mEntryInfo?.icon = templateIcon
|
||||
}
|
||||
// Change the entry color by the template color
|
||||
mEntryInfo?.backgroundColor = mTemplate?.backgroundColor
|
||||
mEntryInfo?.foregroundColor = mTemplate?.foregroundColor
|
||||
}
|
||||
|
||||
private fun buildTemplate() {
|
||||
// Retrieve preferences
|
||||
mHideProtectedValue = PreferencesUtil.hideProtectedValue(context)
|
||||
@@ -402,8 +413,6 @@ abstract class TemplateAbstractView<
|
||||
if (mEntryInfo == null)
|
||||
mEntryInfo = EntryInfo()
|
||||
|
||||
// Icon already populate
|
||||
|
||||
try {
|
||||
val titleView: TEntryFieldView? = findViewWithTag(FIELD_TITLE_TAG)
|
||||
titleView?.value?.let {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
* Manage data merge #840 #977
|
||||
* Inherit color from template #1213
|
||||
* Inherit colors and icon from template #1213 #1130
|
||||
* Add path in quick search
|
||||
* Small fixes
|
||||
@@ -1,4 +1,4 @@
|
||||
* Gestion de la fusion des données #840 #977
|
||||
* Héritage de la couleur du gabarit #1213
|
||||
* Héritage des couleurs et icone du gabarit #1213
|
||||
* Ajout du chemin dans la recherche rapide
|
||||
* Petis correctifs
|
||||
Reference in New Issue
Block a user