public UIAlertView(String title, String message, UIAlertViewDelegate delegate, String cancelButtonTitle, String ... otherButtonTitles) { super((SkipInit) null); initObject(init(title, message, delegate, cancelButtonTitle, 0)); for (String otherButtonTitle : otherButtonTitles) { addButton(otherButtonTitle); } updateStrongRef(null, delegate); }
public UIAlertView(String title, String message, UIAlertViewDelegate delegate, String cancelButtonTitle, String ... otherButtonTitles) { super((SkipInit) null); initObject(init(title, message, delegate, cancelButtonTitle, 0)); for (String otherButtonTitle : otherButtonTitles) { addButton(otherButtonTitle); } updateStrongRef(null, delegate); }
public UIAlertView(String title, String message, UIAlertViewDelegate delegate, String cancelButtonTitle, String ... otherButtonTitles) { super((SkipInit) null); initObject(init(title, message, delegate, cancelButtonTitle, 0)); for (String otherButtonTitle : otherButtonTitles) { addButton(otherButtonTitle); } updateStrongRef(null, delegate); }
@Override public RFuture<Boolean> sysDialog(String title, String text, String ok, String cancel) { final RPromise<Boolean> result = plat.exec().deferredPromise(); UIAlertView view = new UIAlertView(); view.setTitle(title); view.setMessage(text); if (cancel != null) view.addButton(cancel); view.addButton(ok); view.setAlertViewStyle(UIAlertViewStyle.Default); view.setDelegate(new UIAlertViewDelegateAdapter() { public void clicked(UIAlertView view, long buttonIndex) { result.succeed(buttonIndex == 1); } }); view.show(); return result; }
IOSAlertDialog(AlertDialog.Builder builder) { if (Foundation.getMajorSystemVersion() < 8) { alertView = new UIAlertView(); alertView.setTitle(builder.title); alertView.setMessage(builder.message); buttons = new LongMap<>(builder.buttons.size()); for (DialogButton button : builder.buttons) { long i = alertView.addButton(button.getTitle()); if (button.getStyle() == DialogButtonStyle.Cancel) { alertView.setCancelButtonIndex(i); } buttons.put(i, button); } alertView.setDelegate(new UIAlertViewDelegateAdapter() { @Override public void clicked(UIAlertView alertView, long buttonIndex) { DialogButton button = buttons.get(buttonIndex); if (button != null) { button.getClickListener().onClick(IOSAlertDialog.this, button); } } }); } else { alertController = new WindowAlertController(builder.title, builder.message, UIAlertControllerStyle.Alert); for (DialogButton button : builder.buttons) { alertController.addAction(new UIAlertAction(button.getTitle(), getActionStyleForButtonStyle(button.getStyle()), getActionCallbackForButton(button))); } } }