Ejemplo n.º 1
0
        protected override void OnCreate(Android.OS.Bundle bundle)
        {
            base.OnCreate(bundle);

            ServiceContainer.Register <IUIThreadDispacher>(() => new UIThreadDispacher());
            ServiceContainer.Register <ILiveConnection>(() => new WebSocketConnection());
            App.Init();

            //don't need to do this every time unless testing
            if (Settings.IsLoggedIn && !App.ForceSignup)
            {
                StartActivity(typeof(MainActivity));
                return;
            }

            // Create the transaction
            var fts = SupportFragmentManager.BeginTransaction();

            fts.SetCustomAnimations(Resource.Animation.enter, Resource.Animation.exit, Resource.Animation.pop_enter, Resource.Animation.pop_exit);

            // Replace the content of the container
            fts.Replace(Android.Resource.Id.Content, WelcomeFragment.NewInstance());
            // Commit the changes
            fts.Commit();

            SupportActionBar.Title = "Welcome";
            SupportActionBar.SetDisplayHomeAsUpEnabled(false);
            SupportActionBar.SetHomeButtonEnabled(false);

            viewModel = App.SignUpViewModel;
            viewModel.PropertyChanged += ViewModelPropertyChanged;
        }
Ejemplo n.º 2
0
		public static WelcomeFragment NewInstance ()
		{
			var f = new WelcomeFragment ();
			var b = new Bundle ();
			f.Arguments = b;
			return f;
		}
Ejemplo n.º 3
0
        public static WelcomeFragment NewInstance()
        {
            var f = new WelcomeFragment();
            var b = new Bundle();

            f.Arguments = b;
            return(f);
        }
Ejemplo n.º 4
0
        protected override void OnCreate(Android.OS.Bundle bundle)
        {
            base.OnCreate(bundle);

            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);

            if (toolbar != null)
            {
                toolbar.SetBackgroundResource(Settings.AppTheme == AppTheme.Red ? Resource.Drawable.red_gradient : Resource.Drawable.blue_gradient);
                SetSupportActionBar(toolbar);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetHomeButtonEnabled(true);
            }

            //don't need to do this every time unless testing
            if (Settings.IsLoggedIn && !App.ForceSignup)
            {
                StartActivity(typeof(MainActivity));
                return;
            }

            // Create the transaction
            var fts = SupportFragmentManager.BeginTransaction();

            fts.SetCustomAnimations(Resource.Animation.enter, Resource.Animation.exit, Resource.Animation.pop_enter, Resource.Animation.pop_exit);

            if (Settings.IsPinSent)
            {
                fts.Replace(Android.Resource.Id.Content, ConfirmationFragment.NewInstance());
                fts.Commit();

                SupportActionBar.Title = !string.IsNullOrWhiteSpace(Settings.Email) ? Settings.Email : Settings.PhoneNumber;
                SupportActionBar.SetDisplayHomeAsUpEnabled(false);
                SupportActionBar.SetHomeButtonEnabled(false);
            }
            else
            {
                // Replace the content of the container
                fts.Replace(Android.Resource.Id.Content, WelcomeFragment.NewInstance());
                // Commit the changes
                fts.Commit();

                SupportActionBar.Title = "Welcome";
                SupportActionBar.SetDisplayHomeAsUpEnabled(false);
                SupportActionBar.SetHomeButtonEnabled(false);
            }

            viewModel = App.SignUpViewModel;
            viewModel.PropertyChanged += ViewModelPropertyChanged;
        }