Пример #1
0
        private void OnApplicationWillStart(object sender, EventArgs args)
        {
            var isLoggedIn = _facebookHelper.GetAccount() != null;

            isLoggedIn |= _twitterHelper.GetAccount() != null;

            if (isLoggedIn)
            {
                if (RequestHomePage != null)
                {
                    var viewModel = new HomeViewModel();

                    RequestHomePage(viewModel);
                }
            }
            else
            {
                if (RequestOnboardingPage != null)
                {
                    var viewModel = new OnboardingViewModel();

                    RequestOnboardingPage(viewModel);
                }
            }
        }
Пример #2
0
		private void OnRequestOnboardingPage (OnboardingViewModel viewModel)
		{
			var storyboard = UIStoryboard.FromName ("Onboarding", null);
			var navigationController = storyboard.InstantiateInitialViewController () as UINavigationController;
			var controller = navigationController.TopViewController as OnboardingController;

			controller.ViewModel = viewModel;

			SetRootViewController (navigationController);
		}
Пример #3
0
		private void OnApplicationWillStart (object sender, EventArgs args)
		{
			var isLoggedIn = _facebookHelper.GetAccount () != null;
			isLoggedIn |= _twitterHelper.GetAccount () != null;

			if(isLoggedIn)
			{
				if (RequestHomePage != null)
				{
					var viewModel = new HomeViewModel ();

					RequestHomePage (viewModel);
				}
			}
			else
			{
				if(RequestOnboardingPage != null)
				{
					var viewModel = new OnboardingViewModel ();

					RequestOnboardingPage (viewModel);
				}
			}
		}
Пример #4
0
		public OnboardingController (IntPtr handle) : base (handle)
		{
			if(ViewModel == null) {
				ViewModel = new OnboardingViewModel ();
			}
		}
Пример #5
0
        private async void OnRequestOnboardingPage(OnboardingViewModel oVm)
        {
            _viewModel = oVm;
            AnimationInitUI();
            BindEvents();
            
            var mainAnimatorSet = new AnimatorSet();

            var appNameLayoutFinalTopSpace = TypedValue.ApplyDimension(ComplexUnitType.Dip, 55.0f, Application.Context.Resources.DisplayMetrics);

            var decelerateInterpolator = new DecelerateInterpolator(1.0f);

            var appNameLayoutAnimator = new ValueAnimator();
            appNameLayoutAnimator.SetDuration(750);
            appNameLayoutAnimator.SetInterpolator(decelerateInterpolator);
            appNameLayoutAnimator.SetFloatValues(_appNameLayout.GetY(), appNameLayoutFinalTopSpace);
            appNameLayoutAnimator.Update += (o, args) => { _appNameLayout.SetY((float)args.Animation.AnimatedValue); };

            var whatAccountsAnimator = new ValueAnimator();
            whatAccountsAnimator.SetDuration(750);
            whatAccountsAnimator.SetInterpolator(decelerateInterpolator);
            whatAccountsAnimator.SetFloatValues(0.0f, 1.0f);
            whatAccountsAnimator.Update += (o, args) => { _whatAccounts.Alpha = (float)args.Animation.AnimatedValue; };

            var appNameAnimationSet = new AnimatorSet();
            appNameAnimationSet.PlayTogether(appNameLayoutAnimator, whatAccountsAnimator);


            var socialButtonsAnimatorSet = new AnimatorSet();

            var overshootInterpolator = new OvershootInterpolator(3f);

            var facebookButtonAnimator = new ValueAnimator();
            facebookButtonAnimator.SetDuration(500);
            facebookButtonAnimator.SetInterpolator(overshootInterpolator);
            facebookButtonAnimator.SetFloatValues(_facebookButton.GetY() + _facebookButton.Height, _facebookButton.GetY());
            facebookButtonAnimator.Update += (o, args) =>
                {
                    _facebookButton.SetY((float)args.Animation.AnimatedValue);
                    _facebookButton.Alpha = args.Animation.AnimatedFraction;
                };

            var twitterButtonAnimator = new ValueAnimator();
            twitterButtonAnimator.SetDuration(500);
            twitterButtonAnimator.SetInterpolator(overshootInterpolator);
            twitterButtonAnimator.SetFloatValues(_facebookButton.GetY() + _facebookButton.Height, _facebookButton.GetY());
            twitterButtonAnimator.Update += (o, args) =>
                {
                    _twitterButton.SetY((float)args.Animation.AnimatedValue);
                    _twitterButton.Alpha = args.Animation.AnimatedFraction;
                };
            socialButtonsAnimatorSet.PlaySequentially(facebookButtonAnimator, twitterButtonAnimator);
            socialButtonsAnimatorSet.StartDelay = 500;

            var letsGoButtonAnimator = new ValueAnimator();
            letsGoButtonAnimator.SetDuration(500);
            letsGoButtonAnimator.SetInterpolator(decelerateInterpolator);
            letsGoButtonAnimator.SetFloatValues(0.0f, 1.0f);
            letsGoButtonAnimator.Update += (sender, args) =>
                {
                    _goButton.Alpha = (float)args.Animation.AnimatedValue;
                };

            mainAnimatorSet.PlaySequentially(appNameAnimationSet, socialButtonsAnimatorSet, letsGoButtonAnimator);

            await _viewModel.DidLoad();

            await Task.Delay(2000);

            mainAnimatorSet.Start();
            await _viewModel.DidAppear();
        }