manifest and changelog for 1.12-r0. Fix changelog to adhere to theme.

This commit is contained in:
Philipp Crocoll
2025-02-25 12:38:40 +01:00
parent 82fedb3526
commit eddcedd00b
3 changed files with 59 additions and 27 deletions

View File

@@ -14,9 +14,11 @@ using Android.Runtime;
using Android.Text; using Android.Text;
using Android.Text.Method; using Android.Text.Method;
using Android.Text.Util; using Android.Text.Util;
using Android.Util;
using Android.Views; using Android.Views;
using Android.Webkit; using Android.Webkit;
using Android.Widget; using Android.Widget;
using AndroidX.Core.Content;
using Google.Android.Material.Dialog; using Google.Android.Material.Dialog;
using keepass2android; using keepass2android;
@@ -29,7 +31,16 @@ namespace keepass2android
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(ctx); MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(ctx);
builder.SetTitle(ctx.GetString(Resource.String.ChangeLog_title)); builder.SetTitle(ctx.GetString(Resource.String.ChangeLog_title));
List<string> changeLog = new List<string>{ List<string> changeLog = new List<string>{
BuildChangelogString(ctx, new List<int>{Resource.Array.ChangeLog_1_11,Resource.Array.ChangeLog_1_11_net}, "1.11"), BuildChangelogString(ctx, new List<int>{Resource.Array.ChangeLog_1_12
#if !NoNet
,Resource.Array.ChangeLog_1_12_net
#endif
}, "1.12"),
BuildChangelogString(ctx, new List<int>{Resource.Array.ChangeLog_1_11
#if !NoNet
,Resource.Array.ChangeLog_1_11_net
#endif
}, "1.11"),
BuildChangelogString(ctx, Resource.Array.ChangeLog_1_10, "1.10"), BuildChangelogString(ctx, Resource.Array.ChangeLog_1_10, "1.10"),
BuildChangelogString(ctx, Resource.Array.ChangeLog_1_09e, "1.09e"), BuildChangelogString(ctx, Resource.Array.ChangeLog_1_09e, "1.09e"),
BuildChangelogString(ctx, Resource.Array.ChangeLog_1_09d, "1.09d"), BuildChangelogString(ctx, Resource.Array.ChangeLog_1_09d, "1.09d"),
@@ -99,32 +110,28 @@ namespace keepass2android
warning = ctx.GetString(Resource.String.PreviewWarning); warning = ctx.GetString(Resource.String.PreviewWarning);
} }
builder.SetPositiveButton(Android.Resource.String.Ok, (dlgSender, dlgEvt) => {((AlertDialog)dlgSender).Dismiss(); }); builder.SetPositiveButton(Android.Resource.String.Ok, (dlgSender, dlgEvt) => {((AndroidX.AppCompat.App.AlertDialog)dlgSender).Dismiss(); });
builder.SetCancelable(false); builder.SetCancelable(false);
WebView wv = new WebView(ctx); WebView wv = new WebView(ctx);
wv.SetBackgroundColor(Color.White);
wv.LoadDataWithBaseURL(null, GetLog(changeLog, warning, ctx), "text/html", "UTF-8", null);
//builder.SetMessage("");
builder.SetView(wv); builder.SetView(wv);
Dialog dialog = builder.Create(); Dialog dialog = builder.Create();
dialog.DismissEvent += (sender, e) => dialog.DismissEvent += (sender, e) =>
{ {
onDismiss(); onDismiss();
}; };
dialog.Show(); wv.SetBackgroundColor(Color.Transparent);
/*TextView message = (TextView)dialog.FindViewById(Android.Resource.Id.Message); wv.LoadDataWithBaseURL(null, GetLog(changeLog, warning, dialog.Context), "text/html", "UTF-8", null);
message.TextFormatted = Html.FromHtml(ConcatChangeLog(ctx, changeLog.ToArray()));
message.AutoLinkMask=MatchOptions.WebUrls;*/
dialog.Show();
} }
private static string BuildChangelogString(Context ctx, int changeLogResId, string version) private static string BuildChangelogString(Context ctx, int changeLogResId, string version)
{ {
return BuildChangelogString(ctx, new List<int>() { changeLogResId }, version); return BuildChangelogString(ctx, new List<int>() { changeLogResId }, version);
@@ -150,32 +157,44 @@ namespace keepass2android
} }
private const string HtmlStart = @"<html> private const string HtmlEnd = @"</body>
</html>";
private static string GetLog(List<string> changeLog, string warning, Context ctx)
{
string secondaryColor = "31628D";
string onSurfaceColor = "171D1E";
if (((int)ctx.Resources.Configuration.UiMode & (int)UiMode.NightMask) == (int)UiMode.NightYes)
{
secondaryColor = "99CBFF";
onSurfaceColor = "E1E4D6";
}
string HtmlStart = @"<html>
<head> <head>
<style type='text/css'> <style type='text/css'>
a { color:#000000 } a { color:#"+ onSurfaceColor + @" }
div.title { div.title {
color:287AA9; color:"+ secondaryColor+@";
font-size:1.2em; font-size:1.2em;
font-weight:bold; font-weight:bold;
margin-top:1em; margin-top:1em;
margin-bottom:0.5em; margin-bottom:0.5em;
text-align:center } text-align:center }
div.subtitle { div.subtitle {
color:287AA9; color:"+ secondaryColor+@";
font-size:0.8em; font-size:0.8em;
margin-bottom:1em; margin-bottom:1em;
text-align:center } text-align:center }
div.freetext { color:#000000 } div.freetext { color:#"+ onSurfaceColor + @" }
div.list { color:#000000 } div.list { color:#"+ onSurfaceColor + @" }
</style> </style>
</head> </head>
<body>"; <body>";
private const string HtmlEnd = @"</body>
</html>";
private static string GetLog(List<string> changeLog, string warning, Context ctx) StringBuilder sb = new StringBuilder(HtmlStart);
{
StringBuilder sb = new StringBuilder(HtmlStart);
if (!string.IsNullOrEmpty(warning)) if (!string.IsNullOrEmpty(warning))
{ {
sb.Append(warning); sb.Append(warning);

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="200" android:versionCode="201"
android:versionName="1.11-r0" android:versionName="1.12-r0"
package="keepass2android.keepass2android" package="keepass2android.keepass2android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto"> android:installLocation="auto">

View File

@@ -726,6 +726,19 @@
<string name="CloseDbAfterFailedAttempts">Close database after three failed biometric unlock attempts.</string> <string name="CloseDbAfterFailedAttempts">Close database after three failed biometric unlock attempts.</string>
<string name="WarnFingerprintInvalidated">Warning! Biometric authentication can be invalidated by Android, e.g. after adding a new fingerprint in your device settings. Make sure you always know how to unlock with your master password!</string> <string name="WarnFingerprintInvalidated">Warning! Biometric authentication can be invalidated by Android, e.g. after adding a new fingerprint in your device settings. Make sure you always know how to unlock with your master password!</string>
<string-array name="ChangeLog_1_12">
<item>Upgraded from Xamarin Android to .net 8</item>
<item>Upgraded to Target SDK 34</item>
<item>Upgraded to Material 3 user interface</item>
<item>Improve autofill to work with Compose apps</item>
<item>Fix hostname matching in autofill and search</item>
</string-array>
<string-array name="ChangeLog_1_12_net">
<item>Upgraded OneDrive SDK to version 5.68</item>
<item>Upgraded Dropbox SDK to version 7.0.0</item>
<item>Upgraded Gradle, NewtonsoftJson, FluentFTP, MegaApiClient and okhttp</item>
</string-array>
<string-array name="ChangeLog_1_11"> <string-array name="ChangeLog_1_11">
<item>Added floating action buttons for search and TOTP overview (if TOTP entries are present).</item> <item>Added floating action buttons for search and TOTP overview (if TOTP entries are present).</item>