Ejemplo n.º 1
0
        public LoginViewController(IAlertDialogFactory alertDialogService, IDefaultValueService defaultValueService)
        {
            _alertDialogService = alertDialogService;

            this.WhenAnyValue(x => x.ViewModel.ShowLoginOptionsCommand)
            .Select(x => x.ToBarButtonItem(UIBarButtonSystemItem.Action))
            .Subscribe(x => NavigationItem.RightBarButtonItem = x);

            this.Appearing
            .Take(1)
            .Select(_ => this.WhenAnyValue(x => x.ViewModel.LoginUrl))
            .Switch()
            .IsNotNull()
            .Subscribe(LoadRequest);

            bool hasSeenWelcome = false;

            if (!defaultValueService.TryGet(HasSeenWelcomeKey, out hasSeenWelcome))
            {
                hasSeenWelcome = false;
            }

            this.Appeared
            .Where(_ => !hasSeenWelcome)
            .Take(1)
            .Subscribe(_ =>
                       BlurredAlertView.Display(OAuthWelcome, () => defaultValueService.Set(HasSeenWelcomeKey, true)));
        }
Ejemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            LoadRequest();

            if (!Core.Settings.HasSeenOAuthWelcome)
            {
                Appeared
                .Take(1)
                .Do(_ => Core.Settings.HasSeenOAuthWelcome = true)
                .Subscribe(_ => BlurredAlertView.Display(OAuthWelcome));
            }
        }
Ejemplo n.º 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            LoadRequest();

            bool hasSeenWelcome      = false;
            var  defaultValueService = Mvx.Resolve <IDefaultValueService>();

            defaultValueService.TryGet(HasSeenWelcomeKey, out hasSeenWelcome);

            if (!hasSeenWelcome)
            {
                Appeared
                .Take(1)
                .Subscribe(_ =>
                {
                    defaultValueService.Set(HasSeenWelcomeKey, true);
                    BlurredAlertView.Display(OAuthWelcome);
                });
            }
        }