예제 #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)));
        }
예제 #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));
            }
        }
예제 #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);
                });
            }
        }