public IDisposable ShowAlert(InteractiveAlertConfig alertConfig) { var activity = TopActivityFunc(); var dialogAlert = InteractiveDialogFragment.NewInstance <InteractiveDialogFragment>(alertConfig); dialogAlert.Show(activity.SupportFragmentManager, DefaultDialogTag); return(new DisposableAction(dialogAlert.Dismiss)); }
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); }
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); }
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); }
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); }
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); }
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); }
public IDisposable ShowAlert(InteractiveAlertConfig alertConfig) { var alertView = CreateAlertView(alertConfig); return(new DisposableAction(alertView.HideView)); }