diff --git a/MauiPasswordVault/App.xaml.cs b/MauiPasswordVault/App.xaml.cs index c4a9f19..d1a3a71 100644 --- a/MauiPasswordVault/App.xaml.cs +++ b/MauiPasswordVault/App.xaml.cs @@ -1,4 +1,7 @@ using MauiPasswordVault.View; +using Microsoft.Maui.Hosting; +using System.Globalization; +using System.Text.RegularExpressions; namespace MauiPasswordVault { @@ -8,9 +11,17 @@ public App(SearchPage searchPage) { if (Application.Current != null) Application.Current.UserAppTheme = AppTheme.Dark; - InitializeComponent(); +#if DEBUG + Resources.MergedDictionaries.Add(new MauiPasswordVault.Resources.Lang.en()); +#else + if (Thread.CurrentThread.CurrentUICulture.IetfLanguageTag == "fr-FR") + Resources.MergedDictionaries.Add(new MauiPasswordVault.Resources.Lang.fr()); + else + Resources.MergedDictionaries.Add(new MauiPasswordVault.Resources.Lang.en()); +#endif + MainPage = new NavigationPage(searchPage); } } diff --git a/MauiPasswordVault/MauiPasswordVault.csproj b/MauiPasswordVault/MauiPasswordVault.csproj index 982317f..9706c53 100644 --- a/MauiPasswordVault/MauiPasswordVault.csproj +++ b/MauiPasswordVault/MauiPasswordVault.csproj @@ -14,19 +14,19 @@ Password Vault - com.companyname.mauipasswordvault + com.github.vault 8409360f-6d94-4dc3-a09f-38b31006a68d - 3.0.0.0 + 3.3.0.0 3 21.0 10.0.17763.0 10.0.17763.0 - 3.0.0.0 - 3.0.0.0 - 3.0.0.0 + 3.3.0.0 + 3.3.0.0 + 3.3.0.0 False True False @@ -42,8 +42,8 @@ - - + + @@ -57,12 +57,15 @@ - - - + + + + + + @@ -76,6 +79,12 @@ + + MSBuild:Compile + + + MSBuild:Compile + MSBuild:Compile diff --git a/MauiPasswordVault/MauiProgram.cs b/MauiPasswordVault/MauiProgram.cs index 5bebc45..c1aa0c5 100644 --- a/MauiPasswordVault/MauiProgram.cs +++ b/MauiPasswordVault/MauiProgram.cs @@ -1,8 +1,13 @@ -using MauiPasswordVault.Service; +using CommunityToolkit.Maui; +using MauiPasswordVault.Service; using MauiPasswordVault.View; using MauiPasswordVault.ViewModel; using Microsoft.Extensions.Logging; +using NLog.Extensions.Logging; +using NLog; using VaultCore; +using NLog.Config; +using NLog.Targets; namespace MauiPasswordVault; @@ -13,6 +18,7 @@ public static MauiApp CreateMauiApp() var builder = MauiApp.CreateBuilder(); builder .UseMauiApp() + .UseMauiCommunityToolkit() .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); @@ -22,6 +28,26 @@ public static MauiApp CreateMauiApp() fonts.AddFont("AwesomeSolid.otf", "AwesomeSolid"); }); + #region Logger + LoggingConfiguration logConfig = new(); + + FileTarget fileTarget = new() + { + FileName = typeof(MauiProgram).FullName + ".log", + Layout = @"${longdate} [${uppercase:${level}}] ${logger} - ${message} ${exception:format=tostring}" + }; + + LoggingRule fileRule = new("*", NLog.LogLevel.Info, fileTarget); + logConfig.LoggingRules.Add(fileRule); + logConfig.AddTarget("logfile", fileTarget); + + builder.Logging.ClearProviders(); + builder.Logging.AddNLog(logConfig); +#if DEBUG + builder.Logging.AddDebug(); +#endif + #endregion + builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); @@ -37,9 +63,6 @@ public static MauiApp CreateMauiApp() builder.Services.AddTransient(); builder.Services.AddTransient(); -#if DEBUG - builder.Logging.AddDebug(); -#endif return builder.Build(); } diff --git a/MauiPasswordVault/Platforms/Android/MainActivity.cs b/MauiPasswordVault/Platforms/Android/MainActivity.cs index 9bd089d..e907df5 100644 --- a/MauiPasswordVault/Platforms/Android/MainActivity.cs +++ b/MauiPasswordVault/Platforms/Android/MainActivity.cs @@ -4,7 +4,7 @@ namespace MauiPasswordVault { - [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] + [Activity(Theme = "@style/MyAppTheme", MainLauncher = true, ScreenOrientation = ScreenOrientation.Sensor, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] public class MainActivity : MauiAppCompatActivity { } diff --git a/MauiPasswordVault/Platforms/Android/Resources/values/colors.xml b/MauiPasswordVault/Platforms/Android/Resources/values/colors.xml index c04d749..4a65b9c 100644 --- a/MauiPasswordVault/Platforms/Android/Resources/values/colors.xml +++ b/MauiPasswordVault/Platforms/Android/Resources/values/colors.xml @@ -1,6 +1,7 @@ - #512BD4 + #A265BE #2B0B98 - #2B0B98 + #A265BE + #000000 \ No newline at end of file diff --git a/MauiPasswordVault/Platforms/Android/Resources/values/style.xml b/MauiPasswordVault/Platforms/Android/Resources/values/style.xml new file mode 100644 index 0000000..4d4e813 --- /dev/null +++ b/MauiPasswordVault/Platforms/Android/Resources/values/style.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/MauiPasswordVault/Resources/Images/dimport.png b/MauiPasswordVault/Resources/Images/dimport.png new file mode 100644 index 0000000..401cd4b Binary files /dev/null and b/MauiPasswordVault/Resources/Images/dimport.png differ diff --git a/MauiPasswordVault/Resources/Images/dotnet_bot.svg b/MauiPasswordVault/Resources/Images/dotnet_bot.svg deleted file mode 100644 index abfaff2..0000000 --- a/MauiPasswordVault/Resources/Images/dotnet_bot.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MauiPasswordVault/Resources/Images/home.svg b/MauiPasswordVault/Resources/Images/home.svg deleted file mode 100644 index ccee5c3..0000000 --- a/MauiPasswordVault/Resources/Images/home.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/MauiPasswordVault/Resources/Images/information.svg b/MauiPasswordVault/Resources/Images/information.svg deleted file mode 100644 index aa62747..0000000 --- a/MauiPasswordVault/Resources/Images/information.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/MauiPasswordVault/Resources/Images/search.png b/MauiPasswordVault/Resources/Images/search.png new file mode 100644 index 0000000..4e8b251 Binary files /dev/null and b/MauiPasswordVault/Resources/Images/search.png differ diff --git a/MauiPasswordVault/Resources/Images/show.png b/MauiPasswordVault/Resources/Images/show.png new file mode 100644 index 0000000..992c301 Binary files /dev/null and b/MauiPasswordVault/Resources/Images/show.png differ diff --git a/MauiPasswordVault/Resources/Images/splash.svg b/MauiPasswordVault/Resources/Images/splash.svg new file mode 100644 index 0000000..cbee645 --- /dev/null +++ b/MauiPasswordVault/Resources/Images/splash.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/MauiPasswordVault/Resources/Lang/en.xaml b/MauiPasswordVault/Resources/Lang/en.xaml new file mode 100644 index 0000000..3282790 --- /dev/null +++ b/MauiPasswordVault/Resources/Lang/en.xaml @@ -0,0 +1,17 @@ + + + + Unlock + Password + Ok + Initialize + Your password + Confirm it + Search + Get passwords from internet + URL + + \ No newline at end of file diff --git a/MauiPasswordVault/Resources/Lang/en.xaml.cs b/MauiPasswordVault/Resources/Lang/en.xaml.cs new file mode 100644 index 0000000..c3a5891 --- /dev/null +++ b/MauiPasswordVault/Resources/Lang/en.xaml.cs @@ -0,0 +1,9 @@ +namespace MauiPasswordVault.Resources.Lang; + +public partial class en : ResourceDictionary +{ + public en() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/MauiPasswordVault/Resources/Lang/fr.xaml b/MauiPasswordVault/Resources/Lang/fr.xaml new file mode 100644 index 0000000..cc80d65 --- /dev/null +++ b/MauiPasswordVault/Resources/Lang/fr.xaml @@ -0,0 +1,17 @@ + + + + Déverrouiller + Mot de passe + Ok + Initialiser + Votre mot de passe + Confirmez le mot de passe + Rechercher + Mise à jour depuis le net + URL + + \ No newline at end of file diff --git a/MauiPasswordVault/Resources/Lang/fr.xaml.cs b/MauiPasswordVault/Resources/Lang/fr.xaml.cs new file mode 100644 index 0000000..ff5ff26 --- /dev/null +++ b/MauiPasswordVault/Resources/Lang/fr.xaml.cs @@ -0,0 +1,9 @@ +namespace MauiPasswordVault.Resources.Lang; + +public partial class fr : ResourceDictionary +{ + public fr() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/MauiPasswordVault/Resources/Styles/Colors.xaml b/MauiPasswordVault/Resources/Styles/Colors.xaml index 245758b..5e4bac6 100644 --- a/MauiPasswordVault/Resources/Styles/Colors.xaml +++ b/MauiPasswordVault/Resources/Styles/Colors.xaml @@ -3,7 +3,7 @@ - + #512BD4 #DFD8F7 #2B0B98 diff --git a/MauiPasswordVault/View/CheckPage.xaml b/MauiPasswordVault/View/CheckPage.xaml index f78630c..9373992 100644 --- a/MauiPasswordVault/View/CheckPage.xaml +++ b/MauiPasswordVault/View/CheckPage.xaml @@ -1,54 +1,37 @@ + x:Class="MauiPasswordVault.View.CheckPage"> + Padding="30,30" + VerticalOptions="FillAndExpand"> + HeightRequest="100" + HorizontalOptions="Start" />