public static ConfirmationFragment NewInstance()
        {
            var f = new ConfirmationFragment();
            var b = new Bundle();

            f.Arguments = b;
            return(f);
        }
Esempio n. 2
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;
        }
Esempio n. 3
0
        public void GoToConfirmation()
        {
            // 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, ConfirmationFragment.NewInstance());
            // Append this transaction to the backstack
            fts.AddToBackStack("confirmation");
            // Commit the changes
            fts.Commit();

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
        }