MainActivity.cs 1.3 KB

12345678910111213141516171819202122232425262728
  1. using Android.App;
  2. using Android.Content.PM;
  3. using Avalonia;
  4. using Avalonia.Android;
  5. using static Android.Content.Intent;
  6. // leanback and touchscreen are required for the Android TV.
  7. [assembly: UsesFeature("android.software.leanback", Required = false)]
  8. [assembly: UsesFeature("android.hardware.touchscreen", Required = false)]
  9. namespace ControlCatalog.Android
  10. {
  11. [Activity(Label = "ControlCatalog.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", MainLauncher = true, Exported = true, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
  12. // CategoryBrowsable and DataScheme are required for Protocol activation.
  13. // CategoryLeanbackLauncher is required for Android TV.
  14. [IntentFilter(new [] { ActionView }, Categories = new [] { CategoryDefault, CategoryBrowsable, CategoryLeanbackLauncher }, DataScheme = "avln" )]
  15. public class MainActivity : AvaloniaMainActivity<App>
  16. {
  17. protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
  18. {
  19. return base.CustomizeAppBuilder(builder)
  20. .AfterSetup(_ =>
  21. {
  22. Pages.EmbedSample.Implementation = new EmbedSampleAndroid();
  23. });
  24. }
  25. }
  26. }