Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi committed Oct 23, 2024
1 parent 9d30069 commit d9206f4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//+:cnd:noEmit
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]

namespace Boilerplate.Client.Maui;

Expand All @@ -8,15 +7,18 @@ public partial class App
private readonly Page mainPage;
private readonly IExceptionHandler exceptionHandler;
private readonly IBitDeviceCoordinator deviceCoordinator;
private readonly IStringLocalizer<AppStrings> localizer;

public App(MainPage mainPage,
IExceptionHandler exceptionHandler,
IBitDeviceCoordinator deviceCoordinator,
IStorageService storageService)
IStorageService storageService,
IStringLocalizer<AppStrings> localizer)
{
this.exceptionHandler = exceptionHandler;
this.deviceCoordinator = deviceCoordinator;
this.mainPage = new NavigationPage(mainPage);
this.localizer = localizer;

InitializeComponent();
}
Expand All @@ -33,6 +35,20 @@ protected async override void OnStart()
base.OnStart();

await deviceCoordinator.ApplyTheme(AppInfo.Current.RequestedTheme is AppTheme.Dark);

//+:cnd:noEmit
//#if (framework == 'net9.0')
//-:cnd:noEmit
#if Android
if (Version.TryParse(Android.Webkit.WebView.CurrentWebViewPackage?.VersionName, out var webViewVersion) &&
webViewVersion.Major < 94)
{
await App.Current!.Windows.First().Page!.DisplayAlert("Boilerplate", localizer[nameof(AppStrings.UpdateWebViewThroughGooglePlay)], localizer[nameof(AppStrings.Ok)]);
await Launcher.OpenAsync($"https://play.google.com/store/apps/details?id={Android.Webkit.WebView.CurrentWebViewPackage.PackageName}");
}
#endif
//+:cnd:noEmit
//#endif
}
catch (Exception exp)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@
</data>
<data name="UnknownDevice" xml:space="preserve">
<value>دستگاه نامشخص</value>
</data>
<data name="UpdateWebViewThroughGooglePlay" xml:space="preserve">
<value>لطفا وب ویو را از طریق Google Play آپدیت کنید</value>
</data>
<data name="Ok" xml:space="preserve">
<value>باشه</value>
</data>
<!--#if (offlineDb == true) -->
<data name="OfflineEditProfileTitle" xml:space="preserve">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@
</data>
<data name="UnknownDevice" xml:space="preserve">
<value>Onbekend apparaat</value>
</data>
<data name="UpdateWebViewThroughGooglePlay" xml:space="preserve">
<value>Werk de webview bij via Google Play.</value>
</data>
<data name="Ok" xml:space="preserve">
<value>Ok</value>
</data>
<!--#if (offlineDb == true) -->
<data name="OfflineEditProfileTitle" xml:space="preserve">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@
</data>
<data name="UnknownDevice" xml:space="preserve">
<value>Unknown device</value>
</data>
<data name="UpdateWebViewThroughGooglePlay" xml:space="preserve">
<value>Please update webview through google play.</value>
</data>
<data name="Ok" xml:space="preserve">
<value>باشه</value>
</data>
<!--#if (offlineDb == true) -->
<data name="OfflineEditProfileTitle" xml:space="preserve">
Expand Down

0 comments on commit d9206f4

Please sign in to comment.