2023-02-11 14:54:55 +01:00
|
|
|
|
using Android.App;
|
|
|
|
|
using Android.Content;
|
2020-09-10 15:05:08 +02:00
|
|
|
|
using Android.Content.PM;
|
|
|
|
|
using Android.OS;
|
2021-09-20 18:55:16 +02:00
|
|
|
|
using AndroidX.AppCompat.App;
|
2020-09-10 15:05:08 +02:00
|
|
|
|
|
|
|
|
|
namespace Borepin.Droid
|
|
|
|
|
{
|
2023-02-26 19:50:58 +01:00
|
|
|
|
[Activity(Theme = "@style/MainTheme", LaunchMode = LaunchMode.SingleTask, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, Exported = true)]
|
2023-02-11 14:54:55 +01:00
|
|
|
|
[IntentFilter(
|
|
|
|
|
new[]
|
|
|
|
|
{
|
2023-02-11 17:14:17 +01:00
|
|
|
|
"android.nfc.action.NDEF_DISCOVERED",
|
2023-02-11 14:54:55 +01:00
|
|
|
|
},
|
2023-02-11 17:14:17 +01:00
|
|
|
|
Categories = new[]
|
2023-02-11 14:54:55 +01:00
|
|
|
|
{
|
2023-02-26 19:50:58 +01:00
|
|
|
|
Intent.CategoryDefault
|
2023-02-11 14:54:55 +01:00
|
|
|
|
},
|
2023-02-11 17:14:17 +01:00
|
|
|
|
DataScheme = "fabaccess"
|
2023-02-11 14:54:55 +01:00
|
|
|
|
)]
|
2020-09-10 15:05:08 +02:00
|
|
|
|
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
|
|
|
|
{
|
|
|
|
|
protected override void OnCreate(Bundle savedInstanceState)
|
|
|
|
|
{
|
2021-09-20 18:55:16 +02:00
|
|
|
|
AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo;
|
|
|
|
|
|
2020-11-21 00:58:55 +01:00
|
|
|
|
TabLayoutResource = Resource.Layout.Tabbar;
|
|
|
|
|
ToolbarResource = Resource.Layout.Toolbar;
|
|
|
|
|
|
2020-09-10 15:05:08 +02:00
|
|
|
|
base.OnCreate(savedInstanceState);
|
|
|
|
|
|
2022-01-03 21:13:03 +00:00
|
|
|
|
ZXing.Net.Mobile.Forms.Android.Platform.Init();
|
|
|
|
|
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
|
|
|
|
|
|
|
|
|
|
Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
2023-02-26 19:50:58 +01:00
|
|
|
|
LoadApplication(new App(new PlatformInitializer()));
|
2020-09-10 15:05:08 +02:00
|
|
|
|
}
|
2023-02-11 14:54:55 +01:00
|
|
|
|
protected override void OnNewIntent(Intent intent)
|
|
|
|
|
{
|
2023-02-11 17:14:17 +01:00
|
|
|
|
if(intent.Action == "android.nfc.action.NDEF_DISCOVERED")
|
|
|
|
|
{
|
|
|
|
|
intent.SetAction(Intent.ActionView);
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-11 14:54:55 +01:00
|
|
|
|
base.OnNewIntent(intent);
|
|
|
|
|
}
|
2022-01-03 21:13:03 +00:00
|
|
|
|
|
|
|
|
|
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults)
|
|
|
|
|
{
|
|
|
|
|
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
|
|
|
|
|
|
|
|
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
|
|
|
}
|
2020-09-10 15:05:08 +02:00
|
|
|
|
}
|
|
|
|
|
}
|