Skip to content

A cross platform library that allows you to call for standard user dialogs from a shared/portable library, Actionsheets, alerts, confirmations, loading, login, progress, prompt, toast... async just for fun

License

GustavoTancredo/userdialogs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACR User Dialogs for Xamarin and Windows

A cross platform library that allows you to call for standard user dialogs from a shared/portable library. Supports Android, iOS, Windows Phone 8.0 (silverlight), and Unified Windows Platform (UWP, UAP)

Features

  • Action Sheet (multiple choice menu)
  • Alert
  • Confirm
  • Loading
  • Login
  • Progress
  • Prompt
  • Toasts
  • examples

Support Platforms

  • Xamarin (iOS Unified/Android)
  • Universal Windows Platform (Win10/UWP)
  • Windows Phone 8 (Silverlight)
  • Portable Class Libraries (Profile 259)

Setup

To use, simply reference the nuget package in each of your platform projects.

iOS and Windows

Nothing is necessary any longer as of v4.x

Android Initialization (In your main activity)

UserDialogs.Init(this);

MvvmCross

// from your PCL app.cs (remember to Init on android platform project)
Mvx.RegisterSingleton<IUserDialogs>(() => UserDialogs.Instance);

Android Material Design/AppCompat

In your android project, use Acr.UserDialogs.Android.AppCompat from nuget instead of Acr.UserDialogs. Call the Init just like above. Xamarin Forms Users: DO NOT use appcompat unless you know how to use AppCompat. Please wait for Xamarin to update to this or use an open source alternative

Themes/Defaults

All config objects contain static vars that contain defaults which are basically used as a poor man's stylesheet. These save you time of always have to pass what the text for OK should be. This is particularily useful for multilingual applications.

  • ActionSheetConfig
    • DefaultCancelText
    • DefaultDestructiveText
    • DefaultItemIcon
  • AlertConfig
    • DefaultOkText
  • ConfirmConfig
    • DefaultYes
    • DefaultNo
    • DefaultOkText
    • DefaultCancelText
  • LoginConfig
    • DefaultTitle
    • DefaultOkText
    • DefaultCancelText
    • DefaultLoginPlaceholder
    • DefaultPasswordPlaceholder
  • ProgressDialogConfig
    • DefaultCancelText
    • DefaultTitle
    • DefaultMaskType
  • PromptConfig
    • DefaultOkText
    • DefaultCancelText -ToastConfig
    • InfoIcon
    • InfoBackgroundColor
    • InfoTextColor
    • SuccessIcon
    • SuccessBackgroundColor
    • SuccessTextColor
    • WarnIcon
    • WarnBackgroundColor
    • WarnTextColor
    • ErrorIcon
    • ErrorBackgroundColor
    • ErrorTextColor
    • DefaultDuration

FAQ

  1. I'm using Xamarin Forms and getting a nullreferenceexception when using loading

    • This happens when you run loading (or almost any dialog) from the constructor of your page or viewmodel. The view hasn't been rendered yet, therefore there is nothing to render to.
  2. Is Windows 8 Support?

    • No. I never got around to this, but I'm going to support 10 as soon as I figure it out. It is in a very betaish mode now. I'm hoping someone will help in this area!!
  3. Is AppCompat/Material Dialogs supported on Android?

    • Yes. It a separate package. Please make sure to install Acr.UserDialogs to your PCL, but when installing on your android project.
  4. A new release just came out and the MvvmCross plugin is broken

    • I don't update the MvvmCross plugin right along side Acr.UserDialogs. I'm happy to take a PR
  5. Do you take pull requests?

    • Absolutely. I may not always accept them, but I do appreciate the help.
  6. I'm getting "This is the PCL library, not the platform library. Did you include the nuget package in your main "executable" project?"

    • Do exactly what it says
  7. Navigating while inside of a loading/progress dialog causes exceptions or the progress no longer appears properly

    • Hide the progress dialog before navigating
  8. I don't like the way X method works on platform Y

    • No problems. Override the implementation like below

    on the platform public class MyCustomUserDialogs : Acr.UserDialogs.UserDialogImpl { public override .. }

    in appdelegate or the starting activity UserDialogs.Instance = new MyCustomUserDialogs();

Powered By:

About

A cross platform library that allows you to call for standard user dialogs from a shared/portable library, Actionsheets, alerts, confirmations, loading, login, progress, prompt, toast... async just for fun

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.7%
  • Batchfile 0.3%