public IDisposable ShowAlert(InteractiveAlertConfig alertConfig)
        {
            var activity    = TopActivityFunc();
            var dialogAlert = InteractiveDialogFragment.NewInstance <InteractiveDialogFragment>(alertConfig);

            dialogAlert.Show(activity.SupportFragmentManager, DefaultDialogTag);
            return(new DisposableAction(dialogAlert.Dismiss));
        }
예제 #2
0
        private void CreateAlertConfigItem(string title, string alertMessage, InteractiveAlertStyle style)
        {
            var alertConfig = new InteractiveAlertConfig
            {
                OkButton      = new InteractiveActionButton(),
                CancelButton  = new InteractiveActionButton(),
                Message       = alertMessage,
                Title         = title,
                Style         = style,
                IsCancellable = true
            };

            _alerts.ShowAlert(alertConfig);
        }
예제 #3
0
        public void Show(string message, AlertType type)
        {
            var interactiveAlerts = Mvx.IoCProvider.Resolve <IInteractiveAlerts>();
            var alertConfig       = new InteractiveAlertConfig
            {
                OkButton      = new InteractiveActionButton(),
                Title         = type == AlertType.Warning ? AppResources.Warning : AppResources.Error,
                Message       = message,
                Style         = type == AlertType.Warning ? InteractiveAlertStyle.Warning : InteractiveAlertStyle.Error,
                IsCancellable = true
            };

            interactiveAlerts.ShowAlert(alertConfig);
        }
예제 #4
0
        private void Show(string message, string title, string okButtonText, Action okButtonAction, InteractiveAlertStyle style)
        {
            var alertConfig = new InteractiveAlertConfig
            {
                OkButton = new InteractiveActionButton
                {
                    Title  = okButtonText,
                    Action = okButtonAction
                },
                Title         = title,
                Message       = message,
                Style         = style,
                IsCancellable = false
            };

            _interactiveAlerts.ShowAlert(alertConfig);
        }
예제 #5
0
        public void ShowConfirmation(string message, string title = "Error", string okButtonText = "Ok", Action okButtonAction = null, string cancelButtonText = "Cancel", Action cancelButtonAction = null, InteractiveAlertStyle alertStyle = Warning)
        {
            var alertConfig = new InteractiveAlertConfig
            {
                OkButton = new InteractiveActionButton
                {
                    Title  = okButtonText,
                    Action = okButtonAction
                },
                CancelButton = new InteractiveActionButton
                {
                    Title  = cancelButtonText,
                    Action = cancelButtonAction
                },
                Title         = title,
                Message       = message,
                Style         = alertStyle,
                IsCancellable = false
            };

            _interactiveAlerts.ShowAlert(alertConfig);
        }
예제 #6
0
        protected InteractiveAlertView CreateAlertView(InteractiveAlertConfig alertConfig)
        {
            var appearance =
                new InteractiveAlertView.SclAppearance
            {
                ShowCloseButton   = alertConfig.CancelButton != null,
                DisableTapGesture = !alertConfig.IsCancellable,
                HideWhenBackgroundViewIsTapped = alertConfig.IsCancellable
            };

            var alertView = new InteractiveAlertView(appearance);

            alertView.SetDismissBlock(alertConfig.CancelButton?.Action);
            if (alertConfig.OkButton != null)
            {
                alertView.AddButton(alertConfig.OkButton.Title, alertConfig.OkButton.Action);
            }

            alertView.ShowAlert(alertConfig.Style, alertConfig.Title, alertConfig.Message, alertConfig.CancelButton?.Title);

            return(alertView);
        }
예제 #7
0
        protected AlertConfigItem CreateAlertConfigItem(string title, string alertMessage, InteractiveAlertStyle style)
        {
            var config = new AlertConfigItem
            {
                Title = title
            };

            config.Command = () =>
            {
                var alertConfig = new InteractiveAlertConfig
                {
                    OkButton     = new InteractiveActionButton(),
                    CancelButton = new InteractiveActionButton(),
                    Message      = alertMessage,
                    Title        = "Good job!",
                    Style        = style
                };

                this.interactiveAlerts.ShowAlert(alertConfig);
            };

            return(config);
        }
예제 #8
0
        public IDisposable ShowAlert(InteractiveAlertConfig alertConfig)
        {
            var alertView = CreateAlertView(alertConfig);

            return(new DisposableAction(alertView.HideView));
        }