language version degraded to 9.0

This commit is contained in:
Tsanie Lily 2022-02-25 13:38:42 +08:00
parent 9a6011c3d8
commit e012110b00
32 changed files with 1287 additions and 1262 deletions

View File

@ -3,8 +3,8 @@ using Billing.Themes;
using Xamarin.Essentials; using Xamarin.Essentials;
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing; namespace Billing
{
public class App : Application public class App : Application
{ {
public static AppTheme CurrentTheme { get; private set; } public static AppTheme CurrentTheme { get; private set; }
@ -59,3 +59,4 @@ public class App : Application
Resources = instance; Resources = instance;
} }
} }
}

View File

@ -1,7 +1,7 @@
using System; using System;
namespace Billing; namespace Billing
{
internal static class Helper internal static class Helper
{ {
public static void Debug(string message) public static void Debug(string message)
@ -21,3 +21,4 @@ internal static class Helper
System.Diagnostics.Debug.Fail($"[{time}] - {category}", message); System.Diagnostics.Debug.Fail($"[{time}] - {category}", message);
} }
} }
}

View File

@ -36,7 +36,7 @@ namespace Billing.Languages
{ {
get get
{ {
if (strings?.TryGetValue(key, out string val) == true) if (strings != null && strings.TryGetValue(key, out string val))
{ {
return val; return val;
} }

View File

@ -1,7 +1,7 @@
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing; namespace Billing
{
public partial class MainShell : Shell public partial class MainShell : Shell
{ {
public MainShell() public MainShell()
@ -9,3 +9,4 @@ public partial class MainShell : Shell
InitializeComponent(); InitializeComponent();
} }
} }
}

View File

@ -1,7 +1,7 @@
using System.Xml.Linq; using System.Xml.Linq;
namespace Billing.Models; namespace Billing.Models
{
public class Account : BaseModel public class Account : BaseModel
{ {
public int Id { get; set; } public int Id { get; set; }
@ -39,3 +39,4 @@ public enum AccountCategory
DebitCard, DebitCard,
ElecAccount ElecAccount
} }
}

View File

@ -5,8 +5,8 @@ using System.Linq;
using System.Text; using System.Text;
using System.Xml.Linq; using System.Xml.Linq;
namespace Billing.Models; namespace Billing.Models
{
public interface IModel public interface IModel
{ {
void OnXmlSerialize(XElement node); void OnXmlSerialize(XElement node);
@ -182,3 +182,4 @@ public abstract class BaseModel : IModel, IDisposable
} }
} }
} }
}

View File

@ -1,8 +1,8 @@
using System; using System;
using System.Xml.Linq; using System.Xml.Linq;
namespace Billing.Models; namespace Billing.Models
{
public class Billing : BaseModel public class Billing : BaseModel
{ {
public decimal Amount { get; set; } public decimal Amount { get; set; }
@ -32,3 +32,4 @@ public class Billing : BaseModel
Write(node, nameof(CreateTime), CreateTime); Write(node, nameof(CreateTime), CreateTime);
} }
} }
}

View File

@ -1,7 +1,7 @@
using System.Xml.Linq; using System.Xml.Linq;
namespace Billing.Models; namespace Billing.Models
{
public class Category : BaseModel public class Category : BaseModel
{ {
public int Id { get; set; } public int Id { get; set; }
@ -32,3 +32,4 @@ public class Category : BaseModel
} }
} }
} }
}

View File

@ -1,8 +1,8 @@
using Billing.UI; using Billing.UI;
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing.Themes; namespace Billing.Themes
{
public abstract class BaseTheme : ResourceDictionary public abstract class BaseTheme : ResourceDictionary
{ {
public const string CascadiaFontRegular = nameof(CascadiaFontRegular); public const string CascadiaFontRegular = nameof(CascadiaFontRegular);
@ -74,3 +74,4 @@ public abstract class BaseTheme : ResourceDictionary
}); });
} }
} }
}

View File

@ -1,8 +1,7 @@
using Billing.UI; using Xamarin.Forms;
using Xamarin.Forms;
namespace Billing.Themes;
namespace Billing.Themes
{
public class Dark : BaseTheme public class Dark : BaseTheme
{ {
private static Dark _instance; private static Dark _instance;
@ -48,3 +47,4 @@ public class Dark : BaseTheme
}); });
} }
} }
}

View File

@ -1,8 +1,7 @@
using Billing.UI; using Xamarin.Forms;
using Xamarin.Forms;
namespace Billing.Themes;
namespace Billing.Themes
{
public class Light : BaseTheme public class Light : BaseTheme
{ {
private static Light _instance; private static Light _instance;
@ -48,3 +47,4 @@ public class Light : BaseTheme
}); });
} }
} }
}

View File

@ -1,8 +1,8 @@
using System; using System;
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing.UI; namespace Billing.UI
{
public partial class BillingDate : ContentView public partial class BillingDate : ContentView
{ {
#region UI Properties #region UI Properties
@ -287,3 +287,4 @@ public class BillingDay : BindableObject
} }
} }
} }
}

View File

@ -1,8 +1,8 @@
using Billing.Themes; using Billing.Themes;
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing.UI; namespace Billing.UI
{
public abstract class BillingPage : ContentPage public abstract class BillingPage : ContentPage
{ {
public BillingPage() public BillingPage()
@ -10,3 +10,4 @@ public abstract class BillingPage : ContentPage
SetDynamicResource(BackgroundColorProperty, BaseTheme.WindowBackgroundColor); SetDynamicResource(BackgroundColorProperty, BaseTheme.WindowBackgroundColor);
} }
} }
}

View File

@ -3,8 +3,8 @@ using System;
using System.Globalization; using System.Globalization;
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing.UI; namespace Billing.UI
{
public class TitleDateConverter : IValueConverter public class TitleDateConverter : IValueConverter
{ {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
@ -38,3 +38,4 @@ public class MoneyConverter : IValueConverter
return value; return value;
} }
} }
}

View File

@ -2,8 +2,8 @@
using System; using System;
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing.UI; namespace Billing.UI
{
public class TintImage : Image public class TintImage : Image
{ {
public static readonly BindableProperty PrimaryColorProperty = BindableProperty.Create(nameof(PrimaryColor), typeof(Color?), typeof(TintImage)); public static readonly BindableProperty PrimaryColorProperty = BindableProperty.Create(nameof(PrimaryColor), typeof(Color?), typeof(TintImage));
@ -152,3 +152,4 @@ public class OptionEntryCell : OptionCell
.DynamicResource(Entry.PlaceholderColorProperty, BaseTheme.SecondaryTextColor) .DynamicResource(Entry.PlaceholderColorProperty, BaseTheme.SecondaryTextColor)
.DynamicResource(VisualElement.BackgroundColorProperty, BaseTheme.OptionTintColor); .DynamicResource(VisualElement.BackgroundColorProperty, BaseTheme.OptionTintColor);
} }
}

View File

@ -1,7 +1,7 @@
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing.UI; namespace Billing.UI
{
public class ShadowEffect : RoutingEffect public class ShadowEffect : RoutingEffect
{ {
public float Radius { get; set; } public float Radius { get; set; }
@ -13,3 +13,4 @@ public class ShadowEffect : RoutingEffect
{ {
} }
} }
}

View File

@ -1,8 +1,8 @@
using System; using System;
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing.UI; namespace Billing.UI
{
public static partial class Definition public static partial class Definition
{ {
public static partial string GetCascadiaRegularFontFamily(); public static partial string GetCascadiaRegularFontFamily();
@ -66,3 +66,4 @@ public class Tap : IDisposable
} }
} }
} }
}

View File

@ -1,9 +1,8 @@
using Billing.UI; using Billing.UI;
using System;
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing.Views; namespace Billing.Views
{
public partial class AccountPage : BillingPage public partial class AccountPage : BillingPage
{ {
private static readonly BindableProperty BalanceProperty = BindableProperty.Create(nameof(Balance), typeof(decimal), typeof(AccountPage)); private static readonly BindableProperty BalanceProperty = BindableProperty.Create(nameof(Balance), typeof(decimal), typeof(AccountPage));
@ -42,3 +41,4 @@ public partial class AccountPage : BillingPage
Helper.Debug(e.Account.ToString()); Helper.Debug(e.Account.ToString());
} }
} }
}

View File

@ -3,8 +3,8 @@ using Billing.UI;
using System; using System;
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing.Views; namespace Billing.Views
{
public partial class AddAccountPage : BillingPage public partial class AddAccountPage : BillingPage
{ {
private static readonly BindableProperty AccountNameProperty = BindableProperty.Create(nameof(AccountName), typeof(string), typeof(AddAccountPage)); private static readonly BindableProperty AccountNameProperty = BindableProperty.Create(nameof(AccountName), typeof(string), typeof(AddAccountPage));
@ -84,3 +84,4 @@ public class AccountEventArgs : EventArgs
{ {
public Account Account { get; set; } public Account Account { get; set; }
} }
}

View File

@ -1,7 +1,7 @@
using Billing.UI; using Billing.UI;
namespace Billing.Views; namespace Billing.Views
{
public partial class AddBillPage : BillingPage public partial class AddBillPage : BillingPage
{ {
public AddBillPage() public AddBillPage()
@ -9,3 +9,4 @@ public partial class AddBillPage : BillingPage
InitializeComponent(); InitializeComponent();
} }
} }
}

View File

@ -2,8 +2,8 @@ using Billing.UI;
using System; using System;
using Xamarin.Forms; using Xamarin.Forms;
namespace Billing.Views; namespace Billing.Views
{
public partial class BillPage : BillingPage public partial class BillPage : BillingPage
{ {
private static readonly BindableProperty SelectedDateProperty = BindableProperty.Create(nameof(SelectedDate), typeof(DateTime), typeof(BillPage)); private static readonly BindableProperty SelectedDateProperty = BindableProperty.Create(nameof(SelectedDate), typeof(DateTime), typeof(BillPage));
@ -42,3 +42,4 @@ public partial class BillPage : BillingPage
await Navigation.PushAsync(new AddBillPage()); await Navigation.PushAsync(new AddBillPage());
} }
} }
}

View File

@ -1,7 +1,7 @@
using Billing.UI; using Billing.UI;
namespace Billing.Views; namespace Billing.Views
{
public partial class SettingPage : BillingPage public partial class SettingPage : BillingPage
{ {
public SettingPage() public SettingPage()
@ -9,3 +9,4 @@ public partial class SettingPage : BillingPage
InitializeComponent(); InitializeComponent();
} }
} }
}

View File

@ -16,14 +16,13 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest> <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix> <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix> <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion> <TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent> <AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2> <AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType> <AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
<LangVersion>10.0</LangVersion> <LangVersion>9.0</LangVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -65,8 +64,8 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" /> <PackageReference Include="Xamarin.Forms" Version="5.0.0.2337" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" /> <PackageReference Include="Xamarin.Essentials" Version="1.7.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Definition.cs" /> <Compile Include="Definition.cs" />

View File

@ -1,8 +1,8 @@
using Foundation; using Foundation;
using UIKit; using UIKit;
namespace Billing.iOS; namespace Billing.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the // The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to // User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS. // application events from iOS.
@ -24,3 +24,4 @@ public partial class AppDelegate : Xamarin.Forms.Platform.iOS.FormsApplicationDe
return base.FinishedLaunching(app, options); return base.FinishedLaunching(app, options);
} }
} }
}

View File

@ -15,7 +15,7 @@
<MtouchEnableSGenConc>true</MtouchEnableSGenConc> <MtouchEnableSGenConc>true</MtouchEnableSGenConc>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler> <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<ProvisioningType>automatic</ProvisioningType> <ProvisioningType>automatic</ProvisioningType>
<LangVersion>10.0</LangVersion> <LangVersion>9.0</LangVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -138,8 +138,8 @@
<Reference Include="System.Numerics.Vectors" /> <Reference Include="System.Numerics.Vectors" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" /> <PackageReference Include="Xamarin.Forms" Version="5.0.0.2337" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" /> <PackageReference Include="Xamarin.Essentials" Version="1.7.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<BundleResource Include="Resources\bars.png" /> <BundleResource Include="Resources\bars.png" />

View File

@ -1,5 +1,5 @@
namespace Billing.UI; namespace Billing.UI
{
public static partial class Definition public static partial class Definition
{ {
public static partial string GetCascadiaRegularFontFamily() => "CascadiaCode-Regular"; public static partial string GetCascadiaRegularFontFamily() => "CascadiaCode-Regular";
@ -7,3 +7,4 @@ public static partial class Definition
public static partial string GetRobotoCondensedRegularFontFamily() => "RobotoCondensed-Regular"; public static partial string GetRobotoCondensedRegularFontFamily() => "RobotoCondensed-Regular";
public static partial string GetRobotoCondensedBoldFontFamily() => "RobotoCondensed-Bold"; public static partial string GetRobotoCondensedBoldFontFamily() => "RobotoCondensed-Bold";
} }
}

View File

@ -7,8 +7,8 @@ using Xamarin.Forms.Platform.iOS;
[assembly: ResolutionGroupName("Org.Tsanie")] [assembly: ResolutionGroupName("Org.Tsanie")]
[assembly: ExportEffect(typeof(ShadowEffectPlatform), nameof(ShadowEffect))] [assembly: ExportEffect(typeof(ShadowEffectPlatform), nameof(ShadowEffect))]
namespace Billing.iOS.Effects; namespace Billing.iOS.Effects
{
public class ShadowEffectPlatform : PlatformEffect public class ShadowEffectPlatform : PlatformEffect
{ {
protected override void OnAttached() protected override void OnAttached()
@ -41,3 +41,4 @@ public class ShadowEffectPlatform : PlatformEffect
} }
} }
} }
}

View File

@ -1,7 +1,7 @@
using UIKit; using UIKit;
namespace Billing.iOS; namespace Billing.iOS
{
public class Application public class Application
{ {
// This is the main entry point of the application. // This is the main entry point of the application.
@ -12,3 +12,4 @@ public class Application
UIApplication.Main(args, null, typeof(AppDelegate)); UIApplication.Main(args, null, typeof(AppDelegate));
} }
} }
}

View File

@ -4,8 +4,8 @@ using System.Diagnostics.CodeAnalysis;
using System.Globalization; using System.Globalization;
using System.Threading; using System.Threading;
namespace Billing.Languages; namespace Billing.Languages
{
public partial class PlatformCulture public partial class PlatformCulture
{ {
public partial string GetNamespace() public partial string GetNamespace()
@ -73,3 +73,4 @@ public partial class PlatformCulture
return netLanguage; return netLanguage;
} }
} }
}

View File

@ -5,8 +5,8 @@ using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS; using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(LongPressButton), typeof(LongPressButtonRenderer))] [assembly: ExportRenderer(typeof(LongPressButton), typeof(LongPressButtonRenderer))]
namespace Billing.iOS.Renderers; namespace Billing.iOS.Renderers
{
public class LongPressButtonRenderer : ButtonRenderer public class LongPressButtonRenderer : ButtonRenderer
{ {
private UILongPressGestureRecognizer longGesture; private UILongPressGestureRecognizer longGesture;
@ -41,3 +41,4 @@ public class LongPressButtonRenderer : ButtonRenderer
} }
} }
} }
}

View File

@ -5,8 +5,8 @@ using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS; using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(OptionEntry), typeof(OptionEntryRenderer))] [assembly: ExportRenderer(typeof(OptionEntry), typeof(OptionEntryRenderer))]
namespace Billing.iOS.Renderers; namespace Billing.iOS.Renderers
{
public class OptionEntryRenderer : EntryRenderer public class OptionEntryRenderer : EntryRenderer
{ {
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e) protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
@ -20,3 +20,4 @@ public class OptionEntryRenderer : EntryRenderer
} }
} }
} }
}

View File

@ -5,8 +5,8 @@ using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS; using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(TintImage), typeof(TintImageRenderer))] [assembly: ExportRenderer(typeof(TintImage), typeof(TintImageRenderer))]
namespace Billing.iOS.Renderers; namespace Billing.iOS.Renderers
{
public class TintImageRenderer : ImageRenderer public class TintImageRenderer : ImageRenderer
{ {
@ -29,3 +29,4 @@ public class TintImageRenderer : ImageRenderer
} }
} }
} }
}