1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00

Added showYesNoBox to NativeMessageBox class

This commit is contained in:
hogliux 2017-03-06 12:39:09 +00:00
parent 0fa188ab5b
commit 51d5572220
8 changed files with 109 additions and 6 deletions

View file

@ -490,13 +490,14 @@ public class JuceAppActivity extends Activity
builder.create().show();
}
public final void showOkCancelBox (String title, String message, final long callback)
public final void showOkCancelBox (String title, String message, final long callback,
String okButtonText, String cancelButtonText)
{
AlertDialog.Builder builder = new AlertDialog.Builder (this);
builder.setTitle (title)
.setMessage (message)
.setCancelable (true)
.setPositiveButton ("OK", new DialogInterface.OnClickListener()
.setPositiveButton (okButtonText.isEmpty() ? "OK" : okButtonText, new DialogInterface.OnClickListener()
{
public void onClick (DialogInterface dialog, int id)
{
@ -504,7 +505,7 @@ public class JuceAppActivity extends Activity
JuceAppActivity.this.alertDismissed (callback, 1);
}
})
.setNegativeButton ("Cancel", new DialogInterface.OnClickListener()
.setNegativeButton (cancelButtonText.isEmpty() ? "Cancel" : cancelButtonText, new DialogInterface.OnClickListener()
{
public void onClick (DialogInterface dialog, int id)
{