language version degraded to 9.0
This commit is contained in:
@@ -3,59 +3,60 @@ using Billing.Themes;
|
||||
using Xamarin.Essentials;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Billing;
|
||||
|
||||
public class App : Application
|
||||
namespace Billing
|
||||
{
|
||||
public static AppTheme CurrentTheme { get; private set; }
|
||||
public static PlatformCulture CurrentCulture { get; private set; }
|
||||
|
||||
public App()
|
||||
public class App : Application
|
||||
{
|
||||
CurrentCulture = new PlatformCulture();
|
||||
InitResources();
|
||||
public static AppTheme CurrentTheme { get; private set; }
|
||||
public static PlatformCulture CurrentCulture { get; private set; }
|
||||
|
||||
MainPage = new MainShell();
|
||||
Shell.Current.GoToAsync("//Bills");
|
||||
}
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnResume()
|
||||
{
|
||||
SetTheme(AppInfo.RequestedTheme);
|
||||
}
|
||||
|
||||
private void InitResources()
|
||||
{
|
||||
var theme = AppInfo.RequestedTheme;
|
||||
SetTheme(theme, true);
|
||||
}
|
||||
|
||||
private void SetTheme(AppTheme theme, bool force = false)
|
||||
{
|
||||
if (force || theme != CurrentTheme)
|
||||
public App()
|
||||
{
|
||||
CurrentTheme = theme;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
Helper.Debug($"application theme: {theme}");
|
||||
CurrentCulture = new PlatformCulture();
|
||||
InitResources();
|
||||
|
||||
BaseTheme instance;
|
||||
if (theme == AppTheme.Dark)
|
||||
{
|
||||
instance = Dark.Instance;
|
||||
MainPage = new MainShell();
|
||||
Shell.Current.GoToAsync("//Bills");
|
||||
}
|
||||
else
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
instance = Light.Instance;
|
||||
}
|
||||
// TODO: status bar
|
||||
Resources = instance;
|
||||
|
||||
protected override void OnResume()
|
||||
{
|
||||
SetTheme(AppInfo.RequestedTheme);
|
||||
}
|
||||
|
||||
private void InitResources()
|
||||
{
|
||||
var theme = AppInfo.RequestedTheme;
|
||||
SetTheme(theme, true);
|
||||
}
|
||||
|
||||
private void SetTheme(AppTheme theme, bool force = false)
|
||||
{
|
||||
if (force || theme != CurrentTheme)
|
||||
{
|
||||
CurrentTheme = theme;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
Helper.Debug($"application theme: {theme}");
|
||||
|
||||
BaseTheme instance;
|
||||
if (theme == AppTheme.Dark)
|
||||
{
|
||||
instance = Dark.Instance;
|
||||
}
|
||||
else
|
||||
{
|
||||
instance = Light.Instance;
|
||||
}
|
||||
// TODO: status bar
|
||||
Resources = instance;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user