summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/menu/photo.xml4
-rw-r--r--res/values/strings.xml6
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java27
-rw-r--r--src/com/android/gallery3d/ui/MenuExecutor.java1
4 files changed, 37 insertions, 1 deletions
diff --git a/res/menu/photo.xml b/res/menu/photo.xml
index 9074aaa07..48742d12c 100644
--- a/res/menu/photo.xml
+++ b/res/menu/photo.xml
@@ -47,6 +47,10 @@
android:title="@string/edit"
android:showAsAction="never"
android:visible="false" />
+ <item android:id="@+id/action_simple_edit"
+ android:title="@string/simple_edit"
+ android:showAsAction="never"
+ android:visible="false" />
<item android:id="@+id/action_rotate_ccw"
android:showAsAction="never"
android:title="@string/rotate_left" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6e35bfc14..27663c946 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -167,10 +167,14 @@
<!-- Toast message prompted when the specified item is not found [CHAR LIMIT=40]-->
<string name="no_such_item">Couldn\'t find item.</string>
- <!-- String used as a menu label. The suer can choose to edit the image
+ <!-- String used as a menu label. The user can choose to edit the image
[CHAR_LIMIT=20]-->
<string name="edit">Edit</string>
+ <!-- String used as a menu label. The user can choose to edit the image
+ [CHAR_LIMIT=20]-->
+ <string name="simple_edit">Simple Edit</string>
+
<!-- String used as a title of a progress dialog. The user can
choose to cache some Picasa picture albums on device, so it can
be viewed offline. This string is shown when the request is being
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 8875f7495..9b6f2b961 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -119,6 +119,7 @@ public abstract class PhotoPage extends ActivityState implements
public static final int MSG_ALBUMPAGE_PICKED = 4;
public static final String ACTION_NEXTGEN_EDIT = "action_nextgen_edit";
+ public static final String ACTION_SIMPLE_EDIT = "action_simple_edit";
private GalleryApp mApplication;
private SelectionManager mSelectionManager;
@@ -721,6 +722,28 @@ public abstract class PhotoPage extends ActivityState implements
overrideTransitionToEditor();
}
+ private void launchSimpleEditor() {
+ MediaItem current = mModel.getMediaItem(0);
+ if (current == null || (current.getSupportedOperations()
+ & MediaObject.SUPPORT_EDIT) == 0) {
+ return;
+ }
+
+ Intent intent = new Intent(ACTION_SIMPLE_EDIT);
+
+ intent.setDataAndType(current.getContentUri(), current.getMimeType())
+ .setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+ if (mActivity.getPackageManager()
+ .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).size() == 0) {
+ intent.setAction(Intent.ACTION_EDIT);
+ }
+ intent.putExtra(FilterShowActivity.LAUNCH_FULLSCREEN,
+ mActivity.isFullscreen());
+ ((Activity) mActivity).startActivityForResult(Intent.createChooser(intent, null),
+ REQUEST_EDIT);
+ overrideTransitionToEditor();
+ }
+
private void requestDeferredUpdate() {
mDeferUpdateUntil = SystemClock.uptimeMillis() + DEFERRED_UPDATE_MS;
if (!mDeferredUpdateWaiting) {
@@ -1085,6 +1108,10 @@ public abstract class PhotoPage extends ActivityState implements
launchPhotoEditor();
return true;
}
+ case R.id.action_simple_edit: {
+ launchSimpleEditor();
+ return true;
+ }
case R.id.action_details: {
if (mShowDetails) {
hideDetails();
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index 497632f5e..f5d3dc397 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -190,6 +190,7 @@ public class MenuExecutor {
setMenuItemVisible(menu, R.id.action_setas, supportSetAs);
setMenuItemVisible(menu, R.id.action_show_on_map, supportShowOnMap);
setMenuItemVisible(menu, R.id.action_edit, supportEdit);
+ setMenuItemVisible(menu, R.id.action_simple_edit, supportEdit);
setMenuItemVisible(menu, R.id.action_details, supportInfo);
}