Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            string base64Question = null;

            if (Intent.Extras != null)
            {
                string questionKey = "question";
                if (Intent.Extras.ContainsKey(questionKey))
                {
                    base64Question = Intent.Extras.GetString(questionKey);
                }
            }

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            Forms.Init(this, savedInstanceState);
            var app = new Core.App(base64Question);

            RegisterNativeServices();
            LoadApplication(app);
        }
Ejemplo n.º 2
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Forms.Init(this, bundle);

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

            //FormsMaps.Init(this, bundle);
            Xamarin.FormsGoogleMaps.Init(this, bundle);
            await CrossMedia.Current.Initialize();

            //Remove the icon in the navigation bar
            // ActionBar.SetIcon(Android.Resource.Color.Transparent);
            //ActionBar.SetBackgroundDrawable(new ColorDrawable(Xamarin.Forms.Color.FromHex("#aa80ff").ToAndroid()));

            var mvxFormsApp = new Core.App();

            LoadApplication(mvxFormsApp);

            var presenter = Mvx.Resolve <IMvxViewPresenter>() as MvxFormsDroidPagePresenter;

            presenter.MvxFormsApp = mvxFormsApp;

            UserDialogs.Init(this);

            Mvx.Resolve <IMvxAppStart>().Start();
        }
Ejemplo n.º 3
0
        protected override IMvxApplication CreateApp()
        {
            var appSettings = Mvx.Resolve <IAppSettings>();
            var app         = new Core.App(appSettings);

            return(app);
        }
Ejemplo n.º 4
0
        public override void DidFinishLaunching(NSNotification notification)
        {
            Forms.Init();
            var app = new Core.App();

            LoadApplication(app);
            base.DidFinishLaunching(notification);
        }
Ejemplo n.º 5
0
        public static void Main()
        {
            SplashScreen splashScreen = new SplashScreen("intro.png");

            splashScreen.Show(true);
            Core.App app = new Core.App();
            app.InitializeComponent();
            app.Run();
        }
Ejemplo n.º 6
0
        public MainPage()
        {
            this.InitializeComponent();

            Core.App coreApp = new Core.App();

            RegisterPlatformServices();

            LoadApplication(coreApp);
        }
Ejemplo n.º 7
0
        protected override IMvxIosViewPresenter CreatePresenter()
        {
            Forms.Init();
            //Xamarin.FormsMaps.Init();
            Xamarin.FormsGoogleMaps.Init(MapsApiKey);
            var xamarinFormsApp = new Core.App();

            var presenter = new MvxFormsIosPagePresenter(Window, xamarinFormsApp);

            return(presenter);
        }
Ejemplo n.º 8
0
        private async void OnRemoveApp(Core.App app)
        {
            if (_pebble.IsAlive == false)
            {
                return;
            }

            await _pebble.RemoveAppAsync(app);

            await LoadAppsAsync();
        }
Ejemplo n.º 9
0
        public static void Main(string[] args)
        {
            Gtk.Application.Init();
            Forms.Init();

            var app    = new Core.App(new ImageFileSelector());
            var window = new FormsWindow();

            window.LoadApplication(app);
            window.Show();

            Gtk.Application.Run();
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Shows toast message with given text
        /// </summary>
        /// <param name="app">app object; unused</param>
        /// <param name="message">toast message</param>
        private void ShowToast(Core.App app, string message)
        {
            ToastNotifier toastNotifier = ToastNotificationManager.CreateToastNotifier();

            Windows.Data.Xml.Dom.XmlDocument toastXml      = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
            Windows.Data.Xml.Dom.XmlNodeList toastNodeList = toastXml.GetElementsByTagName("text");
            toastNodeList.Item(0).AppendChild(toastXml.CreateTextNode(Constants.AppTitle));
            toastNodeList.Item(1).AppendChild(toastXml.CreateTextNode(message));

            var toast = new ToastNotification(toastXml);

            toast.ExpirationTime = DateTime.Now.AddSeconds(4);
            toastNotifier.Show(toast);
        }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            var app = new Core.App();

            string command = null;

            Console.Write("anonet: ");
            while ((command = Console.ReadLine()) != "quit")
            {
                app.Execute(command);
                Console.Write("anonet: ");
            }

            app.Dispose();
        }
Ejemplo n.º 12
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;
            base.OnCreate(bundle);


            global::Xamarin.Forms.Forms.Init(this, bundle);
            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, bundle);
            var cv       = typeof(Xamarin.Forms.CarouselView);
            var assembly = Assembly.Load(cv.FullName); // https://blog.xamarin.com/flip-through-items-with-xamarin-forms-carouselview/

            app = new Core.App(new AndroidInitializer());
            LoadApplication(app);
        }
Ejemplo n.º 13
0
        public MainPage()
        {
            this.InitializeComponent();

            if (App.Current.Resources.TryGetValue("launchedQuestion", out object launchedQuestion))
            {
                // if it exists, clear it after reading it
                App.Current.Resources.Remove("launchedQuestion");
            }

            var app = new Core.App((string)launchedQuestion);

            RegisterNativeServices();
            LoadApplication(app);
        }
Ejemplo n.º 14
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);
            _app = new Core.App();
            LoadApplication(_app);

            // The following does not seems to be intercepting exceptions
            // TODO: investigate this
            AppDomain.CurrentDomain.UnhandledException  += CurrentDomain_UnhandledException;
            TaskScheduler.UnobservedTaskException       += TaskScheduler_UnobservedTaskException;
            AndroidEnvironment.UnhandledExceptionRaiser += AndroidEnvironment_UnhandledExceptionRaiser;
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Clears cache of the web view control
        /// </summary>
        /// <param name="app">app object; unused</param>
        private void ClearCache(Core.App app)
        {
            if (this.Control == null)
            {
                return;
            }

            try
            {
                this.Control.ClearHistory();
                this.Control.ClearFormData();
                this.Control.ClearCache(true);
            }
            catch (Exception)
            {
                // ignore exception when clearing cache
            }
        }
Ejemplo n.º 16
0
        public void DoDesignSetup()
        {
            if (_app == null)
            {
                MvxSimpleIoCContainer.Initialize();

                Mvx.RegisterSingleton <INotificationService>(
                    new NotificationServiceDesign());
                Mvx.RegisterSingleton <IMvxMessenger>(
                    new MvxMessengerHub());

                Locator = new ViewModelLocator();
                _app    = new Core.App(Locator);
                _app.Initialize();

                var stateService = new StateService();
                Mvx.RegisterSingleton <IStateService>(stateService);
                stateService.Restore();
            }
        }
Ejemplo n.º 17
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)
        {
            var rootFrame = Window.Current.Content as Frame;

            var app = new Core.App();

            // 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;

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

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

            if (e.PrelaunchActivated == false)
            {
                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();
            }
        }
Ejemplo n.º 18
0
        protected override MvxApplication CreateApp()
        {
            var app = new Core.App();

            return(app);
        }
Ejemplo n.º 19
0
 /// <summary>
 /// Shows toast message with given text
 /// </summary>
 /// <param name="app">sender app object</param>
 /// <param name="message">toast message</param>
 private void ShowToast(Core.App app, string message)
 {
     Core.App.RunOnUiThread(
         () => Toast.MakeText(this, message, ToastLength.Long).Show());
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Shows toast message with given text
 /// </summary>
 /// <param name="app">app object; unused</param>
 /// <param name="message">toast message</param>
 private void ShowToast(Core.App app, string message)
 {
     Toast.MakeText(this, message, ToastLength.Short).Show();
 }
Ejemplo n.º 21
0
 protected override MvxApplication CreateApp()
 {
     var app = new Core.App();
     return app;
 }
Ejemplo n.º 22
0
 public static void Main()
 {
     Core.App app = new Core.App();
     app.InitializeComponent();
     app.Run();
 }