// Constructor public MainPage() { InitializeComponent(); Xamarin.Forms.Forms.Init(); FormsMaps.Init(); SvgImageRenderer.Init(); TwoColumnCellRenderer.Init(); ExtendedMapRenderer.Init(); RoundedBoxViewRenderer.Init(); LoadApplication(new PluginSampleApp.App()); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.tabs; ToolbarResource = Resource.Layout.toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); RoundedBoxViewRenderer.Init(); ImageCircleRenderer.Init(); LoadApplication(new App(new AndroidInitializer())); Xamarin.FormsMaps.Init(this, bundle); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); RoundedBoxViewRenderer.Init(); CarouselViewRenderer.Init(); SegmentedControlRenderer.Init(); XamForms.Controls.iOS.Calendar.Init(); mainForms = new App(); LoadApplication(mainForms); return(base.FinishedLaunching(app, options)); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); SegmentedControlRenderer.Init(); Xamarin.FormsGoogleMaps.Init(this, bundle); Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity = this; RoundedBoxViewRenderer.Init(); LoadApplication(new App()); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); RoundedBoxViewRenderer.Init(); DependencyService.Register <ToastNotificatorImplementation>(); ToastNotificatorImplementation.Init(); LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); ServicePointManager.ServerCertificateValidationCallback += (o, certificate, chain, errors) => true; Xamarin.Forms.Forms.Init(this, savedInstanceState); CachedImageRenderer.Init(enableFastRenderer: true); RoundedBoxViewRenderer.Init(); LoadApplication(new App()); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); RoundedBoxViewRenderer.Init(); CachedImageRenderer.Init(); // Code for starting up the Xamarin Test Cloud Agent #if ENABLE_TEST_CLOUD Xamarin.Calabash.Start(); #endif LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
// // 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 uiApplication, NSDictionary launchOptions) { Popup.Init(); Config.Init(); PullToRefreshLayoutRenderer.Init(); CachedImageRenderer.Init(); Forms.Init(); CardsViewRenderer.Preserve(); RoundedBoxViewRenderer.Init(); ImageCircleRenderer.Init(); Xamarin.FormsMaps.Init(); LoadApplication(new App()); return(base.FinishedLaunching(uiApplication, launchOptions)); }
public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions) { ZXing.Net.Mobile.Forms.iOS.Platform.Init(); XFGloss.iOS.Library.Init(); XamEffects.iOS.Effects.Init(); RoundedBoxViewRenderer.Init(); ProgressRingRenderer.Init(); Xamarin.FormsMaps.Init(); Xamarin.FormsGoogleMaps.Init("AIzaSyDnC69vNlEd0nv9-nnI5NDFY2zj6WChPOw"); Stormlion.PhotoBrowser.iOS.Platform.Init(); global::Xamarin.Forms.Forms.Init(); RegisterServiceContainers(); //Countly initialization var config = new CountlyConfig() { AppKey = Config.CountlyAppKey, Host = Config.CountlyServerURL, //EnableDebug = true, Features = new NSObject[] { CountlySDK.Constants.CLYCrashReporting } }; Countly.SharedInstance().StartWithConfig(config); Countly.SharedInstance().BeginSession(); LoadApplication(new App()); uiApplication.SetStatusBarStyle(UIStatusBarStyle.BlackOpaque, false); uiApplication.SetMinimumBackgroundFetchInterval(3600); if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes( UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null ); uiApplication.RegisterUserNotificationSettings(notificationSettings); } RegisterRemoteNotifications(); return(base.FinishedLaunching(uiApplication, launchOptions)); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); Xamarin.FormsMaps.Init(this, bundle); UserDialogs.Init(this); ImageCircleRenderer.Init(); RoundedBoxViewRenderer.Init(); DependencyService.Register <ToastNotification>(); ToastNotification.Init(this); LoadApplication(new App()); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); Rg.Plugins.Popup.Popup.Init(this, savedInstanceState); App.DisplayScreenWidth = (double)Resources.DisplayMetrics.WidthPixels / (double)Resources.DisplayMetrics.Density; App.DisplayScreenHeight = (double)Resources.DisplayMetrics.HeightPixels / (double)Resources.DisplayMetrics.Density; global::Xamarin.Forms.Forms.Init(this, savedInstanceState); CarouselViewRenderer.Init(); RoundedBoxViewRenderer.Init(); ImageCircleRenderer.Init(); PullToRefreshLayoutRenderer.Init(); DependencyService.Register <ToastNotificatorImplementation>(); ToastNotificatorImplementation.Init(this); LoadApplication(new App()); }
/// <summary> /// Invoqué lorsque l'application est lancée normalement par l'utilisateur final. D'autres points d'entrée /// seront utilisés par exemple au moment du lancement de l'application pour l'ouverture d'un fichier spécifique. /// </summary> /// <param name="e">Détails concernant la requête et le processus de lancement.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { this.DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // Ne répétez pas l'initialisation de l'application lorsque la fenêtre comporte déjà du contenu, // assurez-vous juste que la fenêtre est active if (rootFrame == null) { // Créez un Frame utilisable comme contexte de navigation et naviguez jusqu'à la première page rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; Xamarin.Forms.Forms.Init(e); RoundedBoxViewRenderer.Init(); if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: chargez l'état de l'application précédemment suspendue } // Placez le frame dans la fenêtre active Window.Current.Content = rootFrame; } if (e.PrelaunchActivated == false) { if (rootFrame.Content == null) { // Quand la pile de navigation n'est pas restaurée, accédez à la première page, // puis configurez la nouvelle page en transmettant les informations requises en tant que // paramètre rootFrame.Navigate(typeof(MainPage), e.Arguments); } // Vérifiez que la fenêtre actuelle est active Window.Current.Activate(); } }
protected override void OnCreate(Bundle bundle) { AndroidEnvironment.UnhandledExceptionRaiser += HandleAndroidException; base.OnCreate(bundle); Forms.Init(this, bundle); Xamarin.FormsMaps.Init(this, bundle); App.Version = ApplicationContext.PackageManager.GetPackageInfo(ApplicationContext.PackageName, 0).VersionName; UserDialogs.Init(this); RoundedBoxViewRenderer.Init(); ImageCircleRenderer.Init(); ZXing.Net.Mobile.Forms.Android.Platform.Init(); //this is needed for UI testing Forms.ViewInitialized += (sender, e) => { if (!String.IsNullOrWhiteSpace(e.View.StyleId)) { e.NativeView.ContentDescription = e.View.StyleId; } }; // App.UserDialogService = new UserDialogService(); - OLD // COMMENT OUT TO CREATE NEW DB //InitializeDatabase (); InitializeDevice(); App.Init(new AppSetup()); LoadApplication(new App()); var width = Resources.DisplayMetrics.WidthPixels; var height = Resources.DisplayMetrics.HeightPixels; var density = Resources.DisplayMetrics.Density; App.ScreenWidth = (width - 0.5f) / density; App.ScreenHeight = (height - 0.5f) / density; App.AppLoadedDateTime = DateTime.UtcNow; var x = typeof(Xamarin.Forms.Themes.LightThemeResources); x = typeof(Xamarin.Forms.Themes.Android.UnderlineEffect); }
// // 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) { Xamarin.Calabash.Start(); Rg.Plugins.Popup.Popup.Init(); global::Xamarin.Forms.Forms.Init(); App.DisplayScreenWidth = (double)UIScreen.MainScreen.Bounds.Width; App.DisplayScreenHeight = (double)UIScreen.MainScreen.Bounds.Height; App.DisplayScaleFactor = (double)UIScreen.MainScreen.Scale; DependencyService.Register <ToastNotificatorImplementation>(); ToastNotificatorImplementation.Init(); FloatingActionButtonRenderer.InitRenderer(); PullToRefreshLayoutRenderer.Init(); ImageCircleRenderer.Init(); CarouselViewRenderer.Init(); RoundedBoxViewRenderer.Init(); LoadApplication(new App()); //imprimirFuentes(); return(base.FinishedLaunching(app, options)); }
//BluetoothConnection myConnection = new BluetoothCKConnection(); protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); RoundedBoxViewRenderer.Init(); LoadApplication(new App()); // BluetoothSocket _socket = null; // myConnection = new BluetoothConnection(); // myConnection.getAdapter(); // myConnection.thisAdapter.StartDiscovery(); // try // { // myConnection.getDevice(); // myConnection.thisDevice.SetPairingConfirmation(false); // // myConnection.thisDevice.Dispose(); // myConnection.thisDevice.SetPairingConfirmation(true); // myConnection.thisDevice.CreateBond(); // } // catch (Exception deviceEX) // { // } // myConnection.thisAdapter.CancelDiscovery(); //} //public class BluetoothConnection //{ // public void getAdapter() { this.thisAdapter = BluetoothAdapter.DefaultAdapter; } // public void getDevice() { this.thisDevice = (from bd in this.thisAdapter.BondedDevices where bd.Name == "Loivi Fetz" select bd).FirstOrDefault(); } // public BluetoothAdapter thisAdapter { get; set; } // public BluetoothDevice thisDevice { get; set; } // public BluetoothSocket thisSocket { get; set; } }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); RoundedBoxViewRenderer.Init(); CarouselViewRenderer.Init(); SegmentedControlRenderer.Init(); XamForms.Controls.Droid.Calendar.Init(); UserDialogs.Init(() => (Activity)Forms.Context); var mainForms = new App(); LoadApplication(mainForms); if (Intent.Action == Intent.ActionSend) { // This is just an example of the data stored in the extras var uriFromExtras = Intent.GetParcelableExtra(Intent.ExtraStream) as Android.Net.Uri; string path = Intent.GetParcelableExtra(Intent.ExtraStream).ToString(); var subject = Intent.GetStringExtra(Intent.ExtraTitle); // Get the info from ClipData var pdf = Intent.ClipData.GetItemAt(0); // Open a stream from the URI var pdfStream = ContentResolver.OpenInputStream(pdf.Uri); // Save it over var memOfPdf = new System.IO.MemoryStream(); pdfStream.CopyTo(memOfPdf); var docsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); var filePath = System.IO.Path.Combine(docsPath, "temp"); System.IO.File.WriteAllBytes(filePath, memOfPdf.ToArray()); mainForms.ShareFile(memOfPdf.ToArray(), System.IO.Path.GetFileName(path)); } }
// 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) { new Telerik.XamarinForms.ChartRenderer.iOS.CartesianChartRenderer(); Forms.Init(); TelerikForms.Init(); new SfChartRenderer(); new SfGaugeRenderer(); RoundedBoxViewRenderer.Init(); FAB.iOS.FloatingActionButtonRenderer.InitControl(); BITHockeyManager manager = BITHockeyManager.SharedHockeyManager; manager.Configure(Configuration.HockeyAppIdIOS); manager.CrashManager.CrashManagerStatus = BITCrashManagerStatus.AutoSend; manager.StartManager(); manager.Authenticator.AuthenticateInstallation(); if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { var settings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null); UIApplication.SharedApplication.RegisterUserNotificationSettings(settings); } if (options != null && options.ContainsKey(UIApplication.LaunchOptionsLocalNotificationKey)) { if (options[UIApplication.LaunchOptionsLocalNotificationKey] is UILocalNotification localNotification) { UIAlertController okayAlertController = UIAlertController.Create(localNotification.AlertAction, localNotification.AlertBody, UIAlertControllerStyle.Alert); okayAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); this.Window.RootViewController.PresentViewController(okayAlertController, true, null); UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; } } this.LoadApplication(new Hubo.Application()); return(base.FinishedLaunching(app, options)); }
//static SqliteService sqliteService = new SqliteService(); protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.Window.RequestFeature(WindowFeatures.ActionBar); SetTheme(Resource.Style.lightAppTheme); base.OnCreate(bundle); NavigationSam.Droid.Preserver.Preserve(); Stormlion.ImageCropper.Droid.Platform.Init(); Xamarin.Forms.Forms.Init(this, bundle); TouchEffectPreserver.Preserve(); XamarinBackgroundKit.Android.BackgroundKit.Init(); Xamarin.Essentials.Platform.Init(this, bundle); // Override default BitmapDescriptorFactory by your implementation. var platformConfig = new PlatformConfig { BitmapDescriptorFactory = new CachingNativeBitmapDescriptorFactory() }; Xamarin.FormsGoogleMaps.Init(this, bundle, platformConfig); // initialize for Xamarin.Forms.GoogleMaps CardsViewRenderer.Preserve(); RoundedBoxViewRenderer.Init(); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(true);//For use FFImageLoading. You must do this AFTER you call Xamarin.Forms.Init(); UserDialogs.Init(this); VersionTracking.Track(); LoadApplication(new App(new AndroidInitializer())); Instance = this; //To use Keyboard setting view App.Current.On <Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); UserDialogs.Init(() => (Activity)Forms.Context); Forms.Init(this, bundle); RoundedBoxViewRenderer.Init(); FAB.Droid.FloatingActionButtonRenderer.InitControl(); new SfGaugeRenderer(); new SfChartRenderer(); new SfAutoCompleteRenderer(); if (((int)Build.VERSION.SdkInt) >= 21) { this.Window.SetStatusBarColor(Android.Graphics.Color.ParseColor("#0e1d25")); } CrashManager.Register(this, Configuration.HockeyAppIdDroid); this.LoadApplication(new Application()); }
// // 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(); ImageCircleRenderer.Init(); var statusBar = UIApplication.SharedApplication.ValueForKey(new NSString("statusBar")) as UIView; if (statusBar.RespondsToSelector(new ObjCRuntime.Selector("setBackgroundColor:"))) { statusBar.BackgroundColor = UIColor.FromRGB(251, 67, 60); statusBar.TintColor = UIColor.White; } LoadApplication(new App()); TintedImageRenderer.Init(); CachedImageRenderer.Init(); RoundedBoxViewRenderer.Init(); CarouselViewRenderer.Init(); KeyboardOverlapRenderer.Init(); OneSignal.Current.StartInit("84ec0128-74a1-40f9-89b1-35e35da35acd") .EndInit(); return(base.FinishedLaunching(app, options)); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Xamarin.Forms.Forms.Init(this, bundle); FormsMaps.Init(this, bundle); SvgImageRenderer.Init(); TwoColumnCellRenderer.Init(); ExtendedMapRenderer.Init(); RoundedBoxViewRenderer.Init(); // http://forums.xamarin.com/discussion/21148/calabash-and-xamarin-forms-what-am-i-missing global::Xamarin.Forms.Forms.ViewInitialized += (object sender, Xamarin.Forms.ViewInitializedEventArgs e) => { if (!string.IsNullOrWhiteSpace(e.View.StyleId)) { if (e.NativeView != null) { e.NativeView.ContentDescription = e.View.StyleId; } } }; LoadApplication(new App()); }
//protected override void OnNewIntent(Intent intent) //{ // base.OnNewIntent(intent); // FirebasePushNotificationManager.ProcessIntent(this, intent); //} public void ResetRoundView(object sender, EventArgs e) { RoundedBoxViewRenderer.Init(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); jobScheduler = (JobScheduler)GetSystemService(JobSchedulerService); XamEffects.Droid.Effects.Init(); XFGloss.Droid.Library.Init(this, bundle); ZXing.Net.Mobile.Forms.Android.Platform.Init(); Xamarin.FormsMaps.Init(this, bundle); Xamarin.FormsGoogleMaps.Init(this, bundle, null); Stormlion.PhotoBrowser.Droid.Platform.Init(this); Vapolia.Droid.Lib.Effects.PlatformGestureEffect.Init(); Countly.SharedInstance().Init(this, Config.CountlyServerURL, Config.CountlyAppKey).EnableCrashReporting(); //Countly.SharedInstance().SetLoggingEnabled(true); Instance = this; TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; RegisterServiceContainers(); global::Xamarin.Forms.Forms.Init(this, bundle); RoundedBoxViewRenderer.Init(); LoadApplication(new App()); UserDialogs.Init(this); CrossCurrentActivity.Current.Init(this, bundle); CrossCurrentActivity.Current.Activity = this; InitializeUIAsync(); if (Intent != null && Intent.DataString != null) { try { string package = ""; package = Intent.Data.GetQueryParameter("id"); if (package != null && package != "") { Xamarin.Forms.MessagingCenter.Send <string, string>(Constants.NOTIFICATION, Constants.APP_LAUNCHED_FROM_DEEP_LINK, package); } } catch (Exception e) { Console.WriteLine(e); } } //StartPackageService(); IsPlayServicesAvailable(); CreateNotificationChannel(); var refreshedToken = FirebaseInstanceId.Instance.Token; if (refreshedToken != null) { App.Locator.DeviceService.FCMToken = refreshedToken; SendRegistrationToServer(refreshedToken); } }
/// <summary> /// Invoqué lorsque l'application est lancée normalement par l'utilisateur final. D'autres points d'entrée /// sont utilisés lorsque l'application est lancée pour ouvrir un fichier spécifique, pour afficher /// des résultats de recherche, etc. /// </summary> /// <param name="e">Détails concernant la requête et le processus de lancement.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { this.DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // Ne répétez pas l'initialisation de l'application lorsque la fenêtre comporte déjà du contenu, // assurez-vous juste que la fenêtre est active if (rootFrame == null) { // Créez un Frame utilisable comme contexte de navigation et naviguez jusqu'à la première page rootFrame = new Frame(); // TODO: modifier cette valeur à une taille de cache qui contient à votre application rootFrame.CacheSize = 1; // Définir la page par défaut rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; // Xamarin init Xamarin.Forms.Forms.Init(e); RoundedBoxViewRenderer.Init(); if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { // TODO: chargez l'état de l'application précédemment suspendue } // Placez le frame dans la fenêtre active Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // Supprime la navigation tourniquet pour le démarrage. if (rootFrame.ContentTransitions != null) { this.transitions = new TransitionCollection(); foreach (var c in rootFrame.ContentTransitions) { this.transitions.Add(c); } } rootFrame.ContentTransitions = null; rootFrame.Navigated += this.RootFrame_FirstNavigated; // Quand la pile de navigation n'est pas restaurée, accédez à la première page, // puis configurez la nouvelle page en transmettant les informations requises en tant que // paramètre if (!rootFrame.Navigate(typeof(MainPage), e.Arguments)) { throw new Exception("Failed to create initial page"); } } // Vérifiez que la fenêtre actuelle est active Window.Current.Activate(); }