Files
WCS/Cowain.TestProject.Android/MainActivity.cs

32 lines
978 B
C#
Raw Normal View History

using Android.App;
using Android.Content.PM;
using Avalonia;
using Avalonia.Android;
using Avalonia.Media;
using Cowain.TestProject.Services;
namespace Cowain.TestProject.Android;
[Activity(
Label = "Cowain.TestProject.Android",
Theme = "@style/MyTheme.NoActionBar",
Icon = "@drawable/icon",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity<App>
{
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
//.WithInterFont();
.ConfigureFonts(fontManager =>
{
fontManager.AddFontCollection(new HarmonyOSFontCollection());
})
.With(new FontManagerOptions()
{
DefaultFamilyName = "fonts:HarmonyOS Sans#HarmonyOS Sans SC"
});
}
}