Giter Site home page Giter Site logo

airboss001 / userdialogs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aritchie/userdialogs

0.0 1.0 0.0 8.13 MB

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: Microsoft Public License

PowerShell 0.03% Shell 0.03% C# 99.85% Batchfile 0.09%

userdialogs's Introduction

v5 Announcement

Acr.UserDialogs.Android.AppCompat is now obsolete. v5 has this all internalized and uses the most modern mechanism is can to display dialogs. Android Support Libraries should be agnostic now. I will allow nuget to flow up to the next major (v24).

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, and Unified Windows Platform (UWP, UAP)

Features

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

Support Platforms

  • iOS 7+
  • Android
  • Universal Windows Platform (Win10/UWP)
  • Portable Class Libraries (Profile 259)

Experimental Platforms (no support)

  • tvOS
  • WPF/NET45
  • Windows Phone 8/8.1
  • MacOS - coming soon

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.  There is an Init function for iOS but it is OPTIONAL and only required if you want/need to control
the top level viewcontroller for things like iOS extensions.  Progress prompts will not use this factory function though!

Android Initialization (In your main activity)

UserDialogs.Init(this);
OR UserDialogs.Init(() => provide your own top level activity provider)
OR MvvmCross - UserDialogs.Init(() => Mvx.Resolve<IMvxTopActivity>().Activity)
OR Xamarin.Forms - UserDialogs.Init(() => (Activity)Forms.Context)

MvvmCross

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

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

    • DefaultAndroidStyleId
    • DefaultCancelText
    • DefaultDestructiveText
    • DefaultItemIcon
  • AlertConfig

    • DefaultOkText
  • ConfirmConfig

    • DefaultYes
    • DefaultNo
    • DefaultOkText
    • DefaultCancelText
  • DatePromptConfig

    • DefaultOkText
    • DefaultCancelText
  • LoginConfig

    • DefaultTitle
    • DefaultOkText
    • DefaultCancelText
    • DefaultLoginPlaceholder
    • DefaultPasswordPlaceholder
  • ProgressDialogConfig

    • DefaultCancelText
    • DefaultTitle
    • DefaultMaskType
  • PromptConfig

    • DefaultOkText
    • DefaultCancelText -ToastConfig
    • DefaultDuration
    • DefaultMessageTextColor
    • DefaultActionTextColor
    • DefaultBackgroundColor
  • TimePromptConfig

    • DefaultOkText
    • DefaultCancelText
    • DefaultMinuteInterval

FAQ

  1. I'm 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. 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
  3. Navigating while inside of a loading/progress dialog causes exceptions or the progress no longer appears properly

    • Hide the progress dialog before navigating
  4. 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:

userdialogs's People

Contributors

aritchie avatar martijn00 avatar airboss001 avatar alanspires avatar briansakhai avatar dexyon avatar raste avatar geirsagberg avatar haroldma-zz avatar philippd avatar rmevans9 avatar rubgithub avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.