예제 #1
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            App.ScreenHeight = UIScreen.MainScreen.Bounds.Height;
            App.ScreenWidth  = UIScreen.MainScreen.Bounds.Width;

            Forms.SetFlags("CollectionView_Experimental");
            Forms.Init();
            CachedImageRenderer.Init();
            CardsViewRenderer.Preserve();

            Rg.Plugins.Popup.Popup.Init();

            Accessibility.SetAccessibility(UIAccessibility.IsVoiceOverRunning, false);
            NSNotificationCenter.DefaultCenter.AddObserver(UIView.VoiceOverStatusDidChangeNotification, notification =>
            {
                Accessibility.SetAccessibility(UIAccessibility.IsVoiceOverRunning);
            });

            LoadApplication(new App());

            UNUserNotificationCenter.Current.Delegate = new UserNotificationCenterDelegate();

            // start background task
            UIApplication.SharedApplication.SetMinimumBackgroundFetchInterval(Config.DownloadInterval / 1000f);

            // reset our badge
            UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;

            CheckPermissions();

            return(base.FinishedLaunching(app, options));
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            App.ScreenHeight = (Resources.DisplayMetrics.HeightPixels / Resources.DisplayMetrics.Density);
            App.ScreenWidth  = (Resources.DisplayMetrics.WidthPixels / Resources.DisplayMetrics.Density);

            var accessibilityManager = (AccessibilityManager)GetSystemService(AccessibilityService);

            //NOTE: ref: https://stackoverflow.com/a/12362545 we only use touch exploration events for checking if talkback is enabled
            accessibilityManager.AddTouchExplorationStateChangeListener(this);
            Accessibility.SetAccessibility(accessibilityManager.IsTouchExplorationEnabled, false);

            base.OnCreate(savedInstanceState);

            Forms.SetFlags("CollectionView_Experimental");

            Forms.Init(this, savedInstanceState);
            Platform.Init(this, savedInstanceState);
            CachedImageRenderer.Init(true);
            Rg.Plugins.Popup.Popup.Init(this, savedInstanceState);
            CardsViewRenderer.Preserve();

            var locale = new Java.Util.Locale(CultureInfo.InvariantCulture.Name);

            Java.Util.Locale.Default = locale;

            var config = new Android.Content.Res.Configuration {
                Locale = locale
            };

            Android.App.Application.Context.Resources.Configuration.SetTo(config);

            JobStarter.SetupBackgroundUpdateJob(this);

            LoadApplication(new App());
        }
예제 #3
0
 public void OnTouchExplorationStateChanged(bool enabled)
 {
     Accessibility.SetAccessibility(enabled);
 }