コード例 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            App.screenHeight = (int)(Resources.DisplayMetrics.HeightPixels / Resources.DisplayMetrics.Density);
            App.screenWidth  = (int)(Resources.DisplayMetrics.WidthPixels / Resources.DisplayMetrics.Density);

            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            Xamarin.Forms.Forms.SetFlags("Expander_Experimental");
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);

            // Override default BitmapDescriptorFactory by your implementation.
            var platformConfig = new PlatformConfig
            {
                BitmapDescriptorFactory = new BitmapConfig()
            };

            Xamarin.FormsGoogleMaps.Init(this, savedInstanceState, platformConfig); // initialize for Xamarin.Forms.GoogleMaps
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);


            LoadApplication(new App());
        }
コード例 #2
0
 public static void Init(string apiKey, PlatformConfig config = null)
 {
     MapServices.ProvideAPIKey(apiKey);
     GeocoderBackend.Register();
     MapRenderer.Config = config ?? new PlatformConfig();
     IsInitialized      = true;
 }
コード例 #3
0
        public override void OnCreate()
        {
            base.OnCreate();
            Com.Chteam.Agent.BuglyAgentHelper.Init(this.ApplicationContext, "e2fab3d122");

            PlatformConfig.SetWeixin("wxcf8f642a8aa4c630", "76ebc29b4194164aee32eedff2e17900");
            PlatformConfig.SetSinaWeibo("1422675167", "02975c36afd93d3ae983f8da9e596b86", "https://api.weibo.com/oauth2/default.html");
        }
コード例 #4
0
        public override void OnCreate()
        {
            base.OnCreate();
            Com.Chteam.Agent.BuglyAgentHelper.Init(this.ApplicationContext, "");

            PlatformConfig.SetWeixin("", "");
            PlatformConfig.SetSinaWeibo("", "", "https://api.weibo.com/oauth2/default.html");
        }
コード例 #5
0
        private void Verify(Runtime runtime, Jit jit, Platform platform, string expectedText)
        {
            var logger = new OutputLogger(Output);
            var config = new PlatformConfig(runtime, jit, platform).With(logger).With(DefaultColumnProviders.Instance);

            BenchmarkRunner.Run(new[] { BenchmarkConverter.TypeToBenchmarks(typeof(TestBenchmark), config) });

            Assert.Contains(expectedText, logger.GetLog());
        }
コード例 #6
0
        /// <summary>
        /// Update the title of the window to reflect a current filename or other info.
        /// </summary>
        /// <param name="subName">A name to place as a secondary name in the title.</param>
        public void updateWindowTitle(String subName)
        {
            if (windowDefaultText == null)
            {
                windowDefaultText = this.Title;
            }

            Title = PlatformConfig.formatTitle(windowDefaultText, subName);
        }
コード例 #7
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            var platformConfig = new PlatformConfig
            {
                BitmapDescriptorFactory = new AccessNativeBitmapConfig()
            };

            global::Xamarin.Forms.Forms.SetFlags("CarouselView_Experimental");

            Xamarin.FormsGoogleMaps.Init(this, savedInstanceState, platformConfig);
            await CrossMedia.Current.Initialize();

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

            CachedImageRenderer.Init(true);
            var ignore = typeof(SvgCachedImage);

            Delegate.SetLocalNightMode(AppCompatDelegate.ModeNightNo);
            FirebaseOptions options = new FirebaseOptions.Builder()
                                      .SetApplicationId("1:497356794783:android:f50ef84b369d3a3e696baa")
                                      .SetApiKey("AIzaSyBCZCjGqk3f0SdH7prNkEEQT-SI29-vxG0")
                                      .SetGcmSenderId("497356794783")
                                      .Build();

            bool hasBeenInitialized          = false;
            IList <FirebaseApp> firebaseApps = FirebaseApp.GetApps(Application.Context);

            foreach (FirebaseApp app in firebaseApps)
            {
                if (app.Name.Equals(FirebaseApp.DefaultAppName))
                {
                    hasBeenInitialized = true;
                    FirebaseApp firebaseApp = app;
                }
            }

            if (!hasBeenInitialized)
            {
                FirebaseApp firebaseApp = FirebaseApp.InitializeApp(Application.Context, options);
            }

            //SetContentView(Resource.Layout.MasterPage);
            IsPlayServicesAvailable(); //You can use this method to check if play services are available.
            CreateNotificationChannel();

            LoadApplication(new App());
            FirebasePushNotificationManager.ProcessIntent(this, Intent);
        }
コード例 #8
0
 private MixinStandardServiceLocator(SharedInfoProfile profile, PlatformConfig config)
 {
     Debug.Log("[Vial] This assembly has been compiled with Vial mixins");
     if (profile.AutoBugReportingEnabled)
     {
         Debug.Log("[Vial] Automatic bug reporting is currently enabled, setting to disabled");
         profile.AutoBugReportingEnabled = false;
     }
     Base(profile, config);
 }
コード例 #9
0
    private void Reset(PlatformConfig config)
    {
        LeanTween.cancel(gameObject);

        transform.position = config.Position;
        var color = _gameConfig.GetPlatformColorBy(config.Type);

        Material.color = color;
        _type          = config.Type;
    }
コード例 #10
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            if (Window == null)
            {
                Window = new UIWindow(frame: UIScreen.MainScreen.Bounds);
                var initialViewController = new SplashViewController();
                Window.RootViewController = initialViewController;
                Window.MakeKeyAndVisible();

                return(true);
            }
            else
            {
                global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental", "Expander_Experimental");
                HtmlLabelRenderer.Initialize();

                new Syncfusion.XForms.iOS.ComboBox.SfComboBoxRenderer();

                global::Xamarin.Forms.Forms.Init();
                global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init();
                //Xamarin.FormsMaps.Init();

                ZXing.Net.Mobile.Forms.iOS.Platform.Init();
                var ignore = typeof(SvgCachedImage);

                CachedImageRenderer.Init(); // Initializing FFImageLoading

                Stormlion.PhotoBrowser.iOS.Platform.Init();
                CarouselViewRenderer.Init(); // Initializing CarouselView
                new SfRotatorRenderer();
                Syncfusion.XForms.iOS.TabView.SfTabViewRenderer.Init();
                Syncfusion.XForms.iOS.BadgeView.SfBadgeViewRenderer.Init();
                AnimationViewRenderer.Init();

                var platformConfig = new PlatformConfig
                {
                    ImageFactory = new CachingImageFactory()
                };
                Xamarin.FormsGoogleMaps.Init(GlobalSettings.GoogleMapsApiKey, platformConfig);

                //ButtonCircleRenderer.Init();

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

                CardsViewRenderer.Preserve();
                TouchEffectPreserver.Preserve();
                LoadApplication(new App());

                Plugin.Segmented.Control.iOS.SegmentedControlRenderer.Initialize();

                FirebasePushNotificationManager.Initialize(options, true);

                return(base.FinishedLaunching(app, options));
            }
        }
コード例 #11
0
        private void Verify(Platform platform, Type benchmark, string failureText)
        {
            var logger = new AccumulationLogger();
            var config = new PlatformConfig(platform).With(logger);

            BenchmarkRunner.Run(benchmark, config);
            var testLog = logger.GetLog();

            Assert.DoesNotContain(failureText, testLog);
            Assert.DoesNotContain(BenchmarkNotFound, testLog);
        }
コード例 #12
0
        private void Verify(Platform platform, Type benchmark, string failureText)
        {
            var logger = new AccumulationLogger();
            var config = new PlatformConfig(platform).With(logger);

            BenchmarkRunner.Run(benchmark, config);
            var testLog = logger.GetLog();

            Assert.DoesNotContain(failureText, testLog);
            Assert.DoesNotContain(BenchmarkNotFound, testLog);
        }
コード例 #13
0
        private void Verify(Platform platform, Type benchmark, string failureText)
        {
            var logger = new AccumulationLogger();
            // make sure we get an output in the TestRunner log
            var config = new PlatformConfig(platform).With(logger).With(ConsoleLogger.Default);

            BenchmarkTestExecutor.CanExecute(benchmark, config);
            var testLog = logger.GetLog();

            Assert.DoesNotContain(failureText, testLog);
            Assert.DoesNotContain(BenchmarkNotFound, testLog);
        }
コード例 #14
0
        private void Verify(Platform platform, Type benchmark, string failureText)
        {
            var logger = new AccumulationLogger();
            // make sure we get an output in the TestRunner log
            var config = new PlatformConfig(platform).With(logger).With(ConsoleLogger.Default);

            BenchmarkTestExecutor.CanExecute(benchmark, config);
            var testLog = logger.GetLog();

            Assert.DoesNotContain(failureText, testLog);
            Assert.DoesNotContain(BenchmarkNotFound, testLog);
        }
コード例 #15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;


            //var locator = Plugin.Geolocator.CrossGeolocator.Current;
            //var currentPosition = new Position();
            //var currentPosition = await locator.GetPositionAsync(TimeSpan.FromSeconds(10000));


            base.OnCreate(savedInstanceState);

            //RequestPermissions(PermissionsLocation, RequestLocationId);

            //SetContentView(Resource.Layout.activity_maps);
            Rg.Plugins.Popup.Popup.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(ApplicationContext, savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            RequestPermissions(PermissionsLocation, RequestLocationId);

            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);

            var deviceId = CrossDeviceInfo.Current.Id;

            Android.Telephony.TelephonyManager mTelephonyMgr;
            mTelephonyMgr = (Android.Telephony.TelephonyManager)GetSystemService(TelephonyService);


            //IMEI number
            //String m_deviceId = mTelephonyMgr.DeviceId; //primero debe aceptar los permisos

            //String m_deviceId2 = GetIMEI(); //primero debe aceptar los permisos

            string getUniqueIdAndroid = Android.Provider.Settings.Secure.GetString(Forms.Context.ContentResolver, Android.Provider.Settings.Secure.AndroidId);

            var platformConfig = new PlatformConfig
            {
                BitmapDescriptorFactory = new CachingNativeBitmapDescriptorFactory()
            };

            Xamarin.FormsGoogleMaps.Init(this, savedInstanceState, platformConfig); // initialize for Xamarin.Forms.GoogleMaps
            var refreshedToken = FirebaseInstanceId.Instance.Token;

            //var ontokenRefresh = CrossFirebasePushNotification.Current.Token;

            LoadApplication(new App(refreshedToken));
            FirebasePushNotificationManager.ProcessIntent(this, Intent);
            CrossFirebasePushNotification.Current.OnNotificationReceived += (s, p) =>
            {
            };
        }
コード例 #16
0
        private void Verify(Platform platform, Type benchmark, string failureText)
        {
            var logger = new OutputLogger(Output);
            // make sure we get an output in the TestRunner log
            var config = new PlatformConfig(platform).With(logger).With(DefaultColumnProviders.Instance);

            CanExecute(benchmark, config);
            var testLog = logger.GetLog();

            Assert.DoesNotContain(failureText, testLog);
            Assert.DoesNotContain(BenchmarkNotFound, testLog);
        }
コード例 #17
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)
        {
            global::Xamarin.Forms.Forms.Init();
            var platformConfig = new PlatformConfig
            {
                ImageFactory = new CachingImageFactory()
            };

            Xamarin.FormsGoogleMaps.Init(GoogleMapsKey.ApiKey, platformConfig);
            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
コード例 #18
0
ファイル: Config.cs プロジェクト: BANANAMAGIC/Code_Samples
        /// <summary>
        /// Gets the platform config.
        /// </summary>
        /// <returns>The platform config.</returns>
        /// <param name="serviceType">Service type.</param>
        public PlatformConfig GetPlatformConfig(ServiceType serviceType)
        {
            // getting the service
            ServiceConfig serviceConfig = environmentConfig.Services.First(service => service.Type == serviceType);

            PlatformConfig platformConfig = serviceConfig.Platforms.First(platform => platform.Type == PlatformType.iOS);

                        #if UNITY_ANDROID
            platformConfig = serviceConfig.Platforms.First(platform => platform.Type == PlatformType.Android);
                        #endif

            return(platformConfig);
        }
コード例 #19
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            //SetTheme(Resource.Style.MainTheme); // <-- Added
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            // Initializing FFImageLoading
            FFImageLoading.Forms.Platform.CachedImageRenderer.Init(enableFastRenderer: true);
            Forms.SetFlags("FastRenderers_Experimental", "CollectionView_Experimental", "Expander_Experimental");
            HtmlLabelRenderer.Initialize();
            ZXing.Net.Mobile.Forms.Android.Platform.Init();
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            global::Xamarin.Auth.Presenters.XamarinAndroid.AuthenticationConfiguration.Init(this, savedInstanceState);
            Xamarin.FormsMaps.Init(this, savedInstanceState);

            TouchEffectPreserver.Preserve();
            // Initializing Popups
            Rg.Plugins.Popup.Popup.Init(this, savedInstanceState);
            //CardsView
            PanCardView.Droid.CardsViewRenderer.Preserve();
            CarouselViewRenderer.Init();

            PayCardsRecognizerService.Initialize(this);

            ButtonCircleRenderer.Init();

            //ACR UserDialogs initializing
            UserDialogs.Init(this);

            Lottie.Forms.Droid.AnimationViewRenderer.Init();
            Stormlion.PhotoBrowser.Droid.Platform.Init(this);
            PancakeViewRenderer.Init();
            CrossCurrentActivity.Current.Init(this, savedInstanceState);

            var platformConfig = new PlatformConfig
            {
                BitmapDescriptorFactory = new CachingNativeBitmapDescriptorFactory()
            };

            Xamarin.FormsGoogleMaps.Init(this, savedInstanceState, platformConfig);

            CustomTabsConfiguration.CustomTabsClosingMessage = null;

            LoadApplication(new App());

            FirebasePushNotificationManager.ProcessIntent(this, Intent);
            Window.SetSoftInputMode(Android.Views.SoftInput.AdjustResize);
        }
コード例 #20
0
    public void AddOrUpdatePlatformConfig(Hashtable obj)
    {
        PlatformConfig newConfig = new PlatformConfig(obj["name"].ToString(), obj["value"].ToString());
        PlatformConfig oldConfig = configs.Find(cfg => cfg.Type == newConfig.Type);

        if (oldConfig != null)
        {
            oldConfig.Value = newConfig.Value;
        }
        else
        {
            configs.Add(newConfig);
        }
    }
コード例 #21
0
        private void Verify(Platform platform, Type benchmark, string failureText)
        {
            var logger = new OutputLogger(Output);
            // make sure we get an output in the TestRunner log
            var config = new PlatformConfig(platform)
                                .With(logger)
                                .With(DefaultConfig.Instance.GetColumns().ToArray());

            CanExecute(benchmark, config);
            var testLog = logger.GetLog();

            Assert.DoesNotContain(failureText, testLog);
            Assert.DoesNotContain(BenchmarkNotFound, testLog);
        }
コード例 #22
0
        public EditPlatformConfigDialog(PlatformConfig platformConfig, string action)
        {
            InitializeComponent();
            App.SetWindowFont(this);
            this.Title = action + " Platform Config";

            this.PlatformConfig = SerializationHelper.CloneObject <PlatformConfig>(platformConfig);
            WPFHelper.FillComboBox(comboPlatform, EnumHelper.EnumToList <Platform>(),
                                   this.PlatformConfig.Platform);
            this.DataContext = this.PlatformConfig;

            UpdateGameConfigs();
            UpdateEmulators();
        }
コード例 #23
0
        public PlatformModel(PlatformConfig config)
        {
            _config = config;

            fsm = new FSM <PlatformState, BasePlatformState>();

            /*fsm.Add(new UpState(_config.upStateDuration));
             * fsm.Add(new DownState(_config.downStateDuration));*/
            fsm.Add(new BasePlatformState(PlatformState.Up, PlatformState.Down, _config.upStateDuration));
            fsm.Add(new BasePlatformState(PlatformState.Down, PlatformState.Appear, _config.downStateDuration));
            fsm.Add(new BasePlatformState(PlatformState.Appear, PlatformState.Up, _config.highlightDuration));

            fsm.OnStateChanged += OnStateChanged;
        }
コード例 #24
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)
        {
            MapServices.ProvideApiKey(MapsApiKey);
            global::Xamarin.Forms.Forms.Init();
            // Override default ImageFactory by your implementation.
            var platformConfig = new PlatformConfig
            {
                ImageFactory = new CachingImageFactory()
            };

            Xamarin.FormsGoogleMaps.Init(MapsApiKey, platformConfig);
            LoadApplication(new App());

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

            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            var platformConfig = new PlatformConfig
            {
                BitmapDescriptorFactory = new AccessNativeBitmapConfig()
            };

            Xamarin.FormsGoogleMaps.Init(this, savedInstanceState, platformConfig);
            LoadApplication(new App());
        }
コード例 #26
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)
        {
            global::Xamarin.Forms.Forms.Init();
            CachedImageRenderer.Init();
            // Override default ImageFactory by your implementation.
            var platformConfig = new PlatformConfig
            {
                ImageFactory = new CachingImageFactory()
            };

            Xamarin.FormsGoogleMaps.Init("AIzaSyDqf_hvQ5-GuDK8q1TCwcw3rW_vGEMriHg", platformConfig);
            LoadApplication(new App(new iOSInitializer()));

            return(base.FinishedLaunching(app, options));
        }
コード例 #27
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            // Override default ImageFactory by your implementation.
            var platformConfig = new PlatformConfig
            {
                ImageFactory = new CachingImageFactory()
            };

            Xamarin.FormsGoogleMaps.Init(Variables.GOOGLE_MAPS_IOS_API_KEY, platformConfig);
            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
コード例 #28
0
 public IPlatform GetPlatform(PlatformConfig config)
 {
     if (pool.objectGroupNames.Contains(config.name))
     {
         if (_inGamePlatform == null)
         {
             _inGamePlatform = new InGamePlatform();
         }
         _inGamePlatform.pool = pool;
         return(_inGamePlatform);
     }
     else
     {
         throw new Exception("There is no InGameObject with name: " + config.name);
     }
 }
コード例 #29
0
        private void buttonAddPlatformConfig_Click(object sender, RoutedEventArgs e)
        {
            var platformConfig = new PlatformConfig();
            var dialog         = new EditPlatformConfigDialog(platformConfig, "Add");

            dialog.Owner = this;

            var result = dialog.ShowDialog();

            if (result.HasValue && result.Value)
            {
                this.Config.PlatformConfigs.Add(dialog.PlatformConfig);
                UpdatePlatformConfigs();
                listPlatformConfigs.SelectedItem = dialog.PlatformConfig;
            }
        }
コード例 #30
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;
            Locale        locale = Locale.English;
            Configuration config = new Configuration();

            config.Locale = locale;
            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            var platformConfig = new PlatformConfig
            {
                BitmapDescriptorFactory = new CachingNativeBitmapDescriptorFactory()
            };

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            Xamarin.FormsGoogleMaps.Init(this, savedInstanceState, platformConfig);

            if (ActivityCompat.CheckSelfPermission(Application.Context, Manifest.Permission.AccessCoarseLocation) != Android.Content.PM.Permission.Granted ||
                ActivityCompat.CheckSelfPermission(Application.Context, Manifest.Permission.AccessFineLocation) != Android.Content.PM.Permission.Granted)
            {
                ActivityCompat.RequestPermissions(this, new string[]
                {
                    Manifest.Permission.AccessCoarseLocation,
                    Manifest.Permission.AccessFineLocation,
                    Manifest.Permission.WriteExternalStorage,
                    Manifest.Permission.Internet,
                    Manifest.Permission.LocationHardware,
                }, 1001);
            }

            do
            {
                if (ActivityCompat.CheckSelfPermission(Application.Context, Manifest.Permission.AccessCoarseLocation) == Android.Content.PM.Permission.Granted &&
                    ActivityCompat.CheckSelfPermission(Application.Context, Manifest.Permission.AccessFineLocation) == Android.Content.PM.Permission.Granted)
                {
                    break;
                }
                else
                {
                    Task.Delay(1000);
                }
            } while (true);

            LoadApplication(new App());
        }
コード例 #31
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Forms.Init(this, savedInstanceState);

            var platformConfig = new PlatformConfig
            {
                BitmapDescriptorFactory = new CachingNativeBitmapDescriptorFactory()
            };

            Xamarin.FormsGoogleMaps.Init(this, savedInstanceState, platformConfig);

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

            LocationManager locationManager = (LocationManager)GetSystemService(Context.LocationService);

            if (locationManager.IsProviderEnabled(LocationManager.GpsProvider) == false)
            {
                Android.App.AlertDialog.Builder dialog = new AlertDialog.Builder(this);
                AlertDialog alert = dialog.Create();
                alert.SetTitle("RadarFamilyCore: ATIVAR LOCALIZAÇÃO");
                alert.SetMessage("É necessário ativar a localização do celular para que o rastreamento funcione.");
                alert.SetButton("OK", (c, ev) =>
                {
                    Intent gpsSettingIntent = new Intent(Android.Provider.Settings.ActionLocationSourceSettings);
                    StartActivity(gpsSettingIntent);
                });
                alert.Show();
            }

            CachedImageRenderer.Init(enableFastRenderer: true);

            OneSignal.Current.StartInit("a3cd15a8-3fde-435d-b210-cb771ba6007b").EndInit();

            LoadApplication(new App());

            Window.SetStatusBarColor(Android.Graphics.Color.MediumPurple);

            WireUpLongRunningTask();
            WireUpLongDownloadTask();
        }
コード例 #32
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            // Override default BitmapDescriptorFactory by your implementation.
            var platformConfig = new PlatformConfig
            {
                BitmapDescriptorFactory = new CachingNativeBitmapDescriptorFactory()
            };

            Xamarin.FormsGoogleMaps.Init(this, savedInstanceState, platformConfig); // initialize for Xamarin.Forms.GoogleMaps
            LoadApplication(new App());
        }
コード例 #33
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)
        {
            Forms.Init();
            ImageCircleRenderer.Init();

            //Google Maps config
            var platformConfig = new PlatformConfig
            {
                ImageFactory = new CachingImageFactory()
            };

            Xamarin.FormsGoogleMaps.Init("AIzaSyDMggkmREZaQbC-QXdsUJLmPBdDh16Ud9w", platformConfig);
            LoadApplication(new App());
            //App.AuthUiParent = new UIParent();
            App.ParentWindow = null;
            return(base.FinishedLaunching(app, options));
        }