示例#1
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;
            base.Window.RequestFeature(WindowFeatures.ActionBar);
            // Name of the MainActivity theme you had there before.
            // Or you can use global::Android.Resource.Style.ThemeHoloLight
            base.SetTheme(Resource.Style.MainTheme);

            base.OnCreate(bundle);

            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskSchedulerOnUnobservedTaskException;
            SharpnadoInitializer.Initialize();
            Forms.Init(this, bundle);
            ImageCircleRenderer.Init();
            CachedImageRenderer.Init(true);
            CarouselView.FormsPlugin.Android.CarouselViewRenderer.Init();
            Platform.Init(this, bundle);
            CrossCurrentActivity.Current.Init(this, bundle);
            PlotViewRenderer.Init();
            GoogleService.Init(this);
            XF.Material.Droid.Material.Init(this, bundle);
            FacebookClientManager.Initialize(this);
            Rg.Plugins.Popup.Popup.Init(this, bundle);
            var platformConfig = new PlatformConfig
            {
                BitmapDescriptorFactory = new CachingNativeBitmapDescriptorFactory()
            };

            FormsGoogleMaps.Init(this, bundle, platformConfig);
            FormsGoogleMapsBindings.Init();
            LoadApplication(new App(string.IsNullOrEmpty(Intent.GetStringExtra("message")) == false));
            HandleNotification();
        }
示例#2
0
        private void InitializeLibs(Bundle bundle)
        {
            Forms.SetFlags("FastRenderers_Experimental");
            //Forms.SetFlags("CollectionView_Experimental");
            CachedImageRenderer.Init(true);
            Popup.Init(this, bundle);
            Forms.Init(this, bundle);
            FileManager.SavingPath =
                ApplicationContext.GetExternalFilesDir(Environment.DirectoryDownloads).AbsolutePath;

            // Donwload manager
            CrossDownloadManager.Current.PathNameForDownloadedFile = file =>
            {
                var fileName = file.Url.GetHashCode().ToString();
                //  string  fileName= Path.GetFileName(file.Url);
                var path = Path.Combine(
                    ApplicationContext.GetExternalFilesDir(Environment.DirectoryDownloads).AbsolutePath, fileName);

                return(path);
            };
            FormsGoogleMaps.Init(this, bundle);
            FormsGoogleMapsBindings.Init();
            UserDialogs.Init(this);
            CrossCurrentActivity.Current.Init(this, bundle);
            Material.Init(this, bundle);
            Popup.Init(this, bundle);
            PlotViewRenderer.Init();
            Platform.Init(this, bundle);
        }
        //
        // 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)
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskSchedulerOnUnobservedTaskException;
            Forms.SetFlags("CollectionView_Experimental");
            ApplicationBootstrapper.InitializeIfNeeds <FloodCitiSenseXamarinIosModule>();
            SharpnadoInitializer.Initialize();
            Forms.Init();
            ImageCircleRenderer.Init();
            FormsGoogleMaps.Init("AIzaSyA_4G_We4nEDQ-R3mfipus-bIM1lHAMbUc");
            FormsGoogleMapsBindings.Init();
            CachedImageRenderer.Init();
            CarouselViewRenderer.Init();
            ConfigureFlurlHttp();
            PlotViewRenderer.Init();
            SetExitAction();
            Material.Init();
            Rg.Plugins.Popup.Popup.Init();
            if (options == null)
            {
                LoadApplication(new App(false));
            }
            else
            {
                LoadApplication(new App(options.ContainsKey(new NSString(ApsNotificationKey))));
            }

            FacebookClientManager.Initialize(app, options);

            ProcessNotification(options, true);


            if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                _locationManager.RequestAlwaysAuthorization();
            }

            if (UIDevice.CurrentDevice.CheckSystemVersion(9, 0))
            {
                _locationManager.AllowsBackgroundLocationUpdates = true;
            }

            RegisterForRemoteNotifications();

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

            base.OnCreate(savedInstanceState);

            Instance = this;

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            FormsGoogleMaps.Init(this, savedInstanceState); // Google map.
            FormsGoogleMapsBindings.Init();
            PayCardsRecognizerService.Initialize(this);
            CachedImageRenderer.Init(false);
            UserDialogs.Init(this);
            Effects.Init();

            LoadApplication(new App());
        }
示例#5
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)
        {
            Rg.Plugins.Popup.Popup.Init();
            global::Xamarin.Forms.Forms.Init();
            // Download manager
            FileManager.SavingPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            CrossDownloadManager.Current.PathNameForDownloadedFile = new Func <IDownloadFile, string>(file =>
            {
                string fileName = file.Url.GetHashCode().ToString();
                string path     = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), fileName);
                return(path);
            });
            Xamarin.FormsGoogleMaps.Init("AIzaSyCm-_Fc-5-vvbhTPQg38LlCreorYtsC2Us");
            FormsGoogleMapsBindings.Init();
            CachedImageRenderer.Init();
            XF.Material.iOS.Material.Init();
            Rg.Plugins.Popup.Popup.Init();
            OxyPlot.Xamarin.Forms.Platform.iOS.PlotViewRenderer.Init();
            LoadApplication(new App(new iOSInitializer()));

            return(base.FinishedLaunching(app, options));
        }