diff --git a/src/keepass2android/EntryActivity.cs b/src/keepass2android/EntryActivity.cs index 868453d6..e96f11ba 100644 --- a/src/keepass2android/EntryActivity.cs +++ b/src/keepass2android/EntryActivity.cs @@ -937,10 +937,9 @@ namespace keepass2android iv.SetImageDrawable(Resources.GetDrawable(Resource.Drawable.ic00)); } - - SupportActionBar.Title = Entry.Strings.ReadSafe(PwDefs.TitleField); - SupportActionBar.SetDisplayHomeAsUpEnabled(true); + SupportActionBar.Title = SprEngine.Compile(SupportActionBar.Title, new SprContext(Entry, App.Kp2a.CurrentDb.KpDatabase, SprCompileFlags.All)); + SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); PopulateGroupText (Resource.Id.entry_group_name, Resource.Id.entryfield_group_container, KeyGroupFullPath); diff --git a/src/keepass2android/search/SearchProvider.cs b/src/keepass2android/search/SearchProvider.cs index 07bd4e05..bcb782c2 100644 --- a/src/keepass2android/search/SearchProvider.cs +++ b/src/keepass2android/search/SearchProvider.cs @@ -30,6 +30,7 @@ using KeePassLib; using KeePassLib.Utility; using System.Threading; using System.Collections.Generic; +using KeePass.Util.Spr; namespace keepass2android.search { @@ -294,7 +295,10 @@ namespace keepass2android.search return Position.ToString(CultureInfo.InvariantCulture); case 1: // SuggestColumnText1 string username = CurrentEntry.Strings.ReadSafe(PwDefs.UserNameField); - return CurrentEntry.Strings.ReadSafe(PwDefs.TitleField) + (string.IsNullOrWhiteSpace(username) ? "" : " ("+username+")"); + username = SprEngine.Compile(username, new SprContext(CurrentEntry, App.Kp2a.CurrentDb.KpDatabase, SprCompileFlags.All)); + var title = CurrentEntry.Strings.ReadSafe(PwDefs.TitleField); + title = SprEngine.Compile(title, new SprContext(CurrentEntry, App.Kp2a.CurrentDb.KpDatabase, SprCompileFlags.All)); + return title + (string.IsNullOrWhiteSpace(username) ? "" : " ("+username+")"); case 2: // SuggestColumnText2 return Internationalise(_entriesWithContexts[Position].resultContext); case 3: // SuggestColumnIcon1 diff --git a/src/keepass2android/services/Kp2aAutofill/ChooseForAutofillActivity.cs b/src/keepass2android/services/Kp2aAutofill/ChooseForAutofillActivity.cs index 49a9e893..cf8b360a 100644 --- a/src/keepass2android/services/Kp2aAutofill/ChooseForAutofillActivity.cs +++ b/src/keepass2android/services/Kp2aAutofill/ChooseForAutofillActivity.cs @@ -10,6 +10,7 @@ using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; +using KeePass.Util.Spr; using keepass2android.services.AutofillBase; using keepass2android.services.AutofillBase.model; using Keepass2android.Pluginsdk; @@ -108,6 +109,7 @@ namespace keepass2android.services.Kp2aAutofill fieldCollection.DatasetName = pwEntry.Strings.ReadSafe(PwDefs.TitleField); + fieldCollection.DatasetName = SprEngine.Compile(fieldCollection.DatasetName, new SprContext(pwEntry, App.Kp2a.CurrentDb.KpDatabase, SprCompileFlags.All)); return fieldCollection; } diff --git a/src/keepass2android/views/PwEntryView.cs b/src/keepass2android/views/PwEntryView.cs index 91ad7a2a..69e1d731 100644 --- a/src/keepass2android/views/PwEntryView.cs +++ b/src/keepass2android/views/PwEntryView.cs @@ -125,7 +125,8 @@ namespace keepass2android.view } String title = pw.Strings.ReadSafe(PwDefs.TitleField); - var str = new SpannableString(title); + title = SprEngine.Compile(title, new SprContext(_entry, db.KpDatabase, SprCompileFlags.All)); + var str = new SpannableString(title); if (isExpired) {