示例#1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            XForms.Init(this, bundle);
            LoadApplication(new App());
        }
示例#2
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();
        }
示例#3
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                Forms.Init(e);

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }
示例#4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Xamarin.Forms.Forms.SetFlags("Brush_Experimental", "Shapes_Experimental");
            Platform.Init(this, savedInstanceState);
            XamForms.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
示例#5
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            Forms.Init(this, bundle);
            UserDialogs.Init(() => (Activity)Forms.Context);
            PlotViewRenderer.Init();
            MobileAds.Initialize(ApplicationContext, "ca-app-pub-7314872527484882~4323451454");
            LoadApplication(new App());
        }
        //
        // 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));
        }
示例#7
0
 protected override void OnCreate(Bundle bundle)
 {
     Instance          = this;
     TabLayoutResource = Resource.Layout.Tabbar;
     ToolbarResource   = Resource.Layout.Toolbar;
     base.OnCreate(bundle);
     XForms.Init(this, bundle);
     ActivityContext = this;
     UpdateManager   = new UpdateManager(this);
     UpdateManager.Update();
     scale = Resources.DisplayMetrics.Density;
     // Intent it = new Intent(this, typeof(SampleService));
     // StartService(it);
     LoadApplication(new App()
     {
     });
 }