With this library you can use iOS UIAlertView on Android.
![]() Two Buttons | ![]() One Button |
To install the library just add this line to your gradle:
compile 'com.gdacciaro:iosdialog:1.0.2' And add this where you want:
final iOSDialog iOSDialog = new iOSDialog(MainActivity.this); iOSDialog.setTitle( "Allow \"Calendar\" to access your location while you use the app?"); iOSDialog.setSubtitle(" "); iOSDialog.setNegativeLabel("Don't Allow"); iOSDialog.setPositiveLabel("Allow"); iOSDialog.setBoldPositiveLabel(true); iOSDialog.setNegativeListener(new View.OnClickListener() { @Override public void onClick(View view) { iOSDialog.dismiss(); } }); iOSDialog.setPositiveListener(new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(MainActivity.this,"OK clicked",Toast.LENGTH_SHORT).show(); iOSDialog.dismiss(); } }); iOSDialog.show(); If you liked this library, add a star to this project and feel free to make a fork!
And of course, every donation is well accepted :D
A special thanks to Rofiq Setiawan who made a porting of iOSDialog for Xamarin. Check it out here: https://github.com/rofiqsetiawan/iOSDialog

