Skip to content

rofiqsetiawan/iOSDialog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iOSDialog - iOS UIAlertView on Xamarin.Android

With this library you can use iOS UIAlertView on Xamarin.Android. This library is Xamarin.Android (C#) version of iOSDialog by Acciaro Gennaro Daniele.



Two Buttons

One Button

To install the library just execute this command on Package Manager Console:

PM> Install-Package Karamunting.Android.MagicDog707.iOSDialog -Version 1.0.3

Usage

Single Button

// 1 Button
new IOSDialogBuilder(this)
    .SetTitle("I'm Single")
    .SetSubtitle("Seriously")
    .SetPositiveListener(
        positiveLabel: "Ok",
        listener: dlg =>
        {
            Toast.MakeText(this, "I'm single button", ToastLength.Short).Show();
            dlg.Dismiss();
        }
    )
    .Build()
    .Show();

Double Buttons

// 2 buttons
new IOSDialogBuilder(this)
    .SetTitle("How's your day?")
    .SetSubtitle("Just asking..")
    .SetPositiveListener(
        "Good",
        dlg =>
        {
            Toast.MakeText(this, "You have good day", ToastLength.Short).Show();
            dlg.Dismiss();
        }
    )
    .SetNegativeListener(
        "Bad",
        dlg =>
        {
            Toast.MakeText(this, "You have bad day :(", ToastLength.Short).Show();
            dlg.Dismiss();
        }
    )
    .Build()
    .Show();

If you liked this library, feel free to make a donation to Acciaro Gennaro Daniele :D