summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/photoeditor
diff options
context:
space:
mode:
authorYuli Huang <yuli@google.com>2012-05-03 15:59:23 +0800
committerYuli Huang <yuli@google.com>2012-05-03 17:30:10 +0800
commit91a7d446c293d0a58f9857f828b01b1e08bf26db (patch)
tree885157e3b4b622280dfc0eee97dd70ae76335140 /src/com/android/gallery3d/photoeditor
parentccc2ef5296119c723b4b7de3d6d5e562963db420 (diff)
downloadandroid_packages_apps_Snap-91a7d446c293d0a58f9857f828b01b1e08bf26db.tar.gz
android_packages_apps_Snap-91a7d446c293d0a58f9857f828b01b1e08bf26db.tar.bz2
android_packages_apps_Snap-91a7d446c293d0a58f9857f828b01b1e08bf26db.zip
Simplify Yes/No/Cancel dialog to Yes/Cancel dialog.
Simplify the dialog options to confirm if the user wants to discard unsaved edited photo, similar to MMS asking if the user wants to discard the unsent message. bug:6436477 Change-Id: Ic5af09a1ed46033a25b4ac42bf05b9739f6e8447
Diffstat (limited to 'src/com/android/gallery3d/photoeditor')
-rw-r--r--src/com/android/gallery3d/photoeditor/ActionBar.java4
-rw-r--r--src/com/android/gallery3d/photoeditor/PhotoEditor.java12
-rw-r--r--src/com/android/gallery3d/photoeditor/YesCancelDialogBuilder.java (renamed from src/com/android/gallery3d/photoeditor/YesNoCancelDialogBuilder.java)14
3 files changed, 6 insertions, 24 deletions
diff --git a/src/com/android/gallery3d/photoeditor/ActionBar.java b/src/com/android/gallery3d/photoeditor/ActionBar.java
index 814ee8ecb..94379f71a 100644
--- a/src/com/android/gallery3d/photoeditor/ActionBar.java
+++ b/src/com/android/gallery3d/photoeditor/ActionBar.java
@@ -92,10 +92,6 @@ public class ActionBar extends RestorableView {
findViewById(R.id.action_bar_back).performClick();
}
- public void clickSave() {
- findViewById(R.id.save_button).performClick();
- }
-
public boolean canSave() {
return findViewById(R.id.save_button).isEnabled();
}
diff --git a/src/com/android/gallery3d/photoeditor/PhotoEditor.java b/src/com/android/gallery3d/photoeditor/PhotoEditor.java
index 4359cf6ed..27aaed2eb 100644
--- a/src/com/android/gallery3d/photoeditor/PhotoEditor.java
+++ b/src/com/android/gallery3d/photoeditor/PhotoEditor.java
@@ -183,22 +183,16 @@ public class PhotoEditor extends Activity {
public void run() {
// Exit effects or go back to the previous activity on pressing back button.
if (!effectsBar.exit(null)) {
- // Pop-up a dialog to save unsaved photo.
+ // Pop-up a dialog if there are unsaved changes.
if (actionBar.canSave()) {
- new YesNoCancelDialogBuilder(PhotoEditor.this, new Runnable() {
-
- @Override
- public void run() {
- actionBar.clickSave();
- }
- }, new Runnable() {
+ new YesCancelDialogBuilder(PhotoEditor.this, new Runnable() {
@Override
public void run() {
// Discard unsaved photo for the result.
finish();
}
- }, R.string.save_photo).show();
+ }, R.string.discard_unsaved_photo).show();
} else {
setResult(RESULT_OK, new Intent().setData(saveUri));
finish();
diff --git a/src/com/android/gallery3d/photoeditor/YesNoCancelDialogBuilder.java b/src/com/android/gallery3d/photoeditor/YesCancelDialogBuilder.java
index fcc99c0d3..4df76e678 100644
--- a/src/com/android/gallery3d/photoeditor/YesNoCancelDialogBuilder.java
+++ b/src/com/android/gallery3d/photoeditor/YesCancelDialogBuilder.java
@@ -7,12 +7,11 @@ import android.content.DialogInterface;
import com.android.gallery3d.R;
/**
- * Alert dialog builder that builds a simple Yes/No/Cancel dialog.
+ * Alert dialog builder that builds a simple Yes/Cancel dialog.
*/
-public class YesNoCancelDialogBuilder extends AlertDialog.Builder {
+public class YesCancelDialogBuilder extends AlertDialog.Builder {
- public YesNoCancelDialogBuilder(Context context, final Runnable yes, final Runnable no,
- int messageId) {
+ public YesCancelDialogBuilder(Context context, final Runnable yes, int messageId) {
super(context);
setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@@ -21,13 +20,6 @@ public class YesNoCancelDialogBuilder extends AlertDialog.Builder {
yes.run();
}
})
- .setNeutralButton(R.string.no, new DialogInterface.OnClickListener() {
-
- @Override
- public void onClick(DialogInterface dialog, int which) {
- no.run();
- }
- })
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override