- When there are two buttons, place the positive button on the left

and the negative button on the right to match the alert dialog.
- If an alert dialog only needs one button, assign it as the PostiveButton.
- If an alert dialog needs two buttons, assign one Positive and another
Negative.
- for CheckUnits, change the message to
  "Do you want to use metrics as your default units?" so that
  "yes" corresponds to the default case of using metrics as
  the default units.
This commit is contained in:
Jimmy Shih
2011-10-24 14:30:33 -07:00
parent ef86905c58
commit a012943119
22 changed files with 37 additions and 48 deletions
@@ -127,7 +127,7 @@ public class AccountChooser {
builder.setTitle(R.string.no_account_found_title);
builder.setMessage(R.string.no_account_found);
builder.setCancelable(true);
builder.setNegativeButton(R.string.ok,
builder.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
@@ -60,12 +60,12 @@ class CheckUnits {
builder.setCancelable(true);
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
accept(context, preferences);
recordCheckPerformed(preferences);
}
});
builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
recordCheckPerformed(preferences);
changeDefaultUnits(context, preferences);
}
});
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
@@ -77,7 +77,7 @@ class CheckUnits {
builder.show();
}
private static void accept(Context context, SharedPreferences preferences) {
private static void changeDefaultUnits(Context context, SharedPreferences preferences) {
recordCheckPerformed(preferences);
Intent startIntent = new Intent(context, SettingsActivity.class);
startIntent.putExtra(context.getString(R.string.open_settings_screen),
@@ -47,7 +47,7 @@ public class WelcomeActivity extends Activity {
WebView web = (WebView) findViewById(R.id.welcome_web);
web.loadUrl("file:///android_asset/welcome.html");
findViewById(R.id.welcome_read_later).setOnClickListener(
findViewById(R.id.welcome_ok).setOnClickListener(
new OnClickListener() {
public void onClick(View v) {
finish();
@@ -72,7 +72,7 @@ public class WelcomeActivity extends Activity {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(view);
builder.setPositiveButton(R.string.ok, null);
builder.setNeutralButton(R.string.license, new DialogInterface.OnClickListener() {
builder.setNegativeButton(R.string.license, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Eula.showEula(WelcomeActivity.this);
@@ -104,7 +104,7 @@ public class ImportActivity extends Activity {
finish();
}
});
dialogBuilder.setNeutralButton(R.string.import_show_track, new OnClickListener() {
dialogBuilder.setNegativeButton(R.string.import_show_track, new OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
showImportedTrack();
@@ -114,7 +114,7 @@ public class ImportActivity extends Activity {
return dialogBuilder.create();
case FAILURE_DIALOG:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setNeutralButton(R.string.ok, new OnClickListener() {
builder.setPositiveButton(R.string.ok, new OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
finish();
@@ -168,7 +168,7 @@ public class SaveActivity extends Activity {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(writer.getErrorMessage());
builder.setNeutralButton(R.string.ok, new OnClickListener() {
builder.setPositiveButton(R.string.ok, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int arg1) {
dialog.dismiss();
@@ -81,7 +81,7 @@ public class ResultDialogFactory {
builder.setPositiveButton(activity.getString(R.string.ok), onOkClickListener);
if (onShareClickListener != null) {
builder.setNeutralButton(activity.getString(R.string.share_track),
builder.setNegativeButton(activity.getString(R.string.share_track),
onShareClickListener);
}