// ok public override void Toast(ToastConfig config) { var app = UIApplication.SharedApplication; var top = this.ViewControllerFunc(); ToastBuilder.Build(app, top.View, config); }
//public override IDisposable Alert(AlertConfig config) //{ // var activity = this.TopActivityFunc(); // if (activity is AppCompatActivity compatActivity) // return this.ShowDialog<AlertAppCompatDialogFragment, AlertConfig>(compatActivity, config); // return this.Show(activity, () => new AlertBuilder().Build(activity, config)); //} //public override IDisposable Confirm(ConfirmConfig config) //{ // var activity = this.TopActivityFunc(); // if (activity is AppCompatActivity compatActivity) // return this.ShowDialog<ConfirmAppCompatDialogFragment, ConfirmConfig>(compatActivity, config); // return this.Show(activity, () => new ConfirmBuilder().Build(activity, config)); //} public override void Toast(ToastConfig options) { var activity = TopActivityFunc(); activity.SafeRunOnUi(() => { ToastBuilder.Show(activity, options); }); }
private void CreateWithBuilder() { var toast = new ToastBuilder(this) .SetCaption("Hello! I am Toast") .SetDescription("This is demo") .SetDuration(Duration.LENGTH_SHORT) .SetMuting(false) .Build(); toast.Show(); }
//public override IDisposable Alert(AlertConfig config) //{ // var activity = this.TopActivityFunc(); // if (activity is AppCompatActivity compatActivity) // return this.ShowDialog<AlertAppCompatDialogFragment, AlertConfig>(compatActivity, config); // return this.Show(activity, () => new AlertBuilder().Build(activity, config)); //} //public override IDisposable Confirm(ConfirmConfig config) //{ // var activity = this.TopActivityFunc(); // if (activity is AppCompatActivity compatActivity) // return this.ShowDialog<ConfirmAppCompatDialogFragment, ConfirmConfig>(compatActivity, config); // return this.Show(activity, () => new ConfirmBuilder().Build(activity, config)); //} public override void Toast(ToastConfig options) { var activity = this.TopActivityFunc(); ToastBuilder.Show(activity, options); }
private void sendToastCommandExecute() { this.toastService.SendToast(ToastBuilder.Create("TestMessage").AddLine("First Line").AddLine("Second Line").AddImage("toastImageAndText.png").Build()); }