All Projects → escamoteur → ReactiveUI.Dialogs

escamoteur / ReactiveUI.Dialogs

Licence: MIT license
ReactiveUI wrapper for Acr.UserDialogs

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to ReactiveUI.Dialogs

CustomPermissionsDialogue
Custom Permissions Dialogue is the only permissions library that supports ALL permission request scenarios. This library handles multiple edge cases such as not enabling all permissions or permanently rejecting a permission request.
Stars: ✭ 51 (+292.31%)
Mutual labels:  dialogs
Android Circledialog
仿IOS圆角对话框、进度条、列表框、输入框,ad广告框,支持横竖屏切换
Stars: ✭ 880 (+6669.23%)
Mutual labels:  dialogs
React Native Material Dialog
Material design dialogs for React Native 💬
Stars: ✭ 135 (+938.46%)
Mutual labels:  dialogs
Ookii Dialogs Wpf
Common dialog classes for WPF applications
Stars: ✭ 276 (+2023.08%)
Mutual labels:  dialogs
Material Dialogs
😍 A beautiful, fluid, and extensible dialogs API for Kotlin & Android.
Stars: ✭ 19,118 (+146961.54%)
Mutual labels:  dialogs
Macytdl
A macOS GUI front-end for the youtube-dl video downloader
Stars: ✭ 52 (+300%)
Mutual labels:  dialogs
soloalert
A customizable lightweight Alert Library with Material UI and awesome features.
Stars: ✭ 18 (+38.46%)
Mutual labels:  dialogs
Dialogsheet
An Android library to create fully material designed bottom dialogs similar to the Android Pay app.
Stars: ✭ 236 (+1715.38%)
Mutual labels:  dialogs
Xtd forms
Modern c++17 library to create native gui for Microsoft Windows, Apple macOS and Linux.
Stars: ✭ 25 (+92.31%)
Mutual labels:  dialogs
Ookii Dialogs Winforms
Common dialog classes for Windows Forms applications
Stars: ✭ 130 (+900%)
Mutual labels:  dialogs
Mvvm Dialogs
Framework simplifying the concept of opening dialogs from a view model when using MVVM in WPF or UWP
Stars: ✭ 335 (+2476.92%)
Mutual labels:  dialogs
Falcon
Take Android screenshots with Falcons bright eye!
Stars: ✭ 362 (+2684.62%)
Mutual labels:  dialogs
Botbuilder Community Js
Part of the Bot Builder Community Project. Repository for extensions for the Bot Builder JavaScript SDK, including middleware, dialogs, recognizers and more.
Stars: ✭ 88 (+576.92%)
Mutual labels:  dialogs
BalloonPopup
Forget Android Toast! BalloonPopup displays a round or squared popup and attaches it to a View, like a callout. Uses the Builder pattern for maximum ease. The popup can automatically hide and can persist when the value is updated.
Stars: ✭ 32 (+146.15%)
Mutual labels:  dialogs
Elegantdialog
A beautiful, customizable and interactive dialog for Android written in Kotlin/Java 😍
Stars: ✭ 189 (+1353.85%)
Mutual labels:  dialogs
JavaUltimateTools
A Large Repository Of Awesome Code For Java.
Stars: ✭ 24 (+84.62%)
Mutual labels:  dialogs
Lovelydialog
This library is a set of simple wrapper classes that are aimed to help you easily create fancy material dialogs.
Stars: ✭ 1,043 (+7923.08%)
Mutual labels:  dialogs
Dlgs
Go cross-platform library for displaying dialogs and input boxes
Stars: ✭ 245 (+1784.62%)
Mutual labels:  dialogs
Botbuilder Community Dotnet
Part of the Bot Builder Community Project. Repository for extensions for the Bot Builder .NET SDK, including middleware, dialogs, recognizers and more.
Stars: ✭ 196 (+1407.69%)
Mutual labels:  dialogs
Simpledialogfragments
A collection of easy to use and extendable DialogFragment's for Android
Stars: ✭ 94 (+623.08%)
Mutual labels:  dialogs

ReactiveUI.Dialogs

Allan Ritchie's Acr.UserDialogs is an amazing libary that make live for any mobile devloper much easier when it comes to Alerts, Toasts or Spinners.

One of it big advantages is that you can call it from almost anywhere in your code. This can be in at the same time problematic because it misleads to violate the separation of View and ViewModel.

Another problem that can occur if you call it to the wrong time in the App lifecycle on Android is that you get an ugly exception.

While moving the Dialog code to my View and using RxUI I could solve both problems by writing:

this.WhenAnyValue(x => x.ViewModel.Message)
    .Where(message => !string.IsNullOrWhiteSpace(message))
    .Subscribe(message =>
        {
            UserDialogs.Instance.Alert(message);
            }
    );

or

ViewModel.GetReplay.IsExecuting.Subscribe(busy =>
    {
        if (busy)
        {
            UserDialogs.Instance.ShowLoading();
        }
        else
        {
            UserDialogs.Instance.HideLoading();
            }

        });

So I deciced to start writing an ReactiveUI wrapper around Acr.UserDialogs. So that I now can write:

this.AlertWhen(x => x.ViewModel.AlertMessage).DisposeWith(d);
this.ToastWhen(x => x.ViewModel.ToastMessage).DisposeWith(d);

this.ViewModel.ShowLoadingWhen(x=>x.ShowSpinner.IsExecuting).DisposeWith(d);

As soon as the observed string properties get a value assigned a Dialog/Toast is shown

Opening a new Dialog outmatically closes any currently open ones.

Before an Dialog is shown it is checked if the App is not backgrounded (Not sure yes if it would make sense to throw an optional Exception here)

Currently I support this methods:

public static IDisposable AlertWhen<TSender>(this TSender This,
  Expression<Func<TSender, string>> property, string title = null, string okText = null)

public static IDisposable AlertWhen<TSender>(this TSender This,
    Expression<Func<TSender, AlertConfig>> property, string title = null, string okText = null)


public static IDisposable ToastWhen<TSender>(this TSender This,
    Expression<Func<TSender, string>> property, TimeSpan? dismissTimer = null)

public static IDisposable ToastWhen<TSender>(this TSender This,
    Expression<Func<TSender, ToastConfig>> property, TimeSpan? dismissTimer = null)


// Disposing the returned Disposable ensures that the Spinner 
// is hidden when the subscription is disposed

public static LoadingDisposable ShowLoadingWhen<TSender>(this TSender This,
    Expression<Func<TSender, bool>> property, string title = null, MaskType? maskType = null)


public static LoadingDisposable ShowLoadingWhen<TSender>(this TSender This,
    Func<TSender,IObservable<bool>> busy, string title = null, MaskType? maskType = null)

Nuget

Install-Package ReactiveUI.Dialogs

Important:

Make sure to add the NUget to your Platform project too Call the UserDialogs Init method in your MainActivity on Android

UserDialogs.Init(this)

Contribution

any PRs to complete this wrapper are very welcome.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].