summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/menu/photo.xml3
-rw-r--r--res/values/strings.xml1
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java4
-rw-r--r--src/com/android/gallery3d/data/LocalVideo.java2
-rw-r--r--src/com/android/gallery3d/data/MediaObject.java1
-rw-r--r--src/com/android/gallery3d/ui/MenuExecutor.java2
6 files changed, 12 insertions, 1 deletions
diff --git a/res/menu/photo.xml b/res/menu/photo.xml
index b3820c3a6..eb23684ad 100644
--- a/res/menu/photo.xml
+++ b/res/menu/photo.xml
@@ -48,6 +48,9 @@
<item android:id="@+id/action_crop"
android:title="@string/crop_action"
android:showAsAction="never" />
+ <item android:id="@+id/action_trim"
+ android:title="@string/trim_action"
+ android:showAsAction="never" />
<item android:id="@+id/action_setas"
android:title="@string/set_image"
android:showAsAction="never" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 0000c61e4..a52723bfa 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -175,6 +175,7 @@
<string name="caching_label">Caching\u2026</string>
<string name="crop_action">Crop</string>
+ <string name="trim_action">Trim</string>
<string name="set_as">Set as</string>
<!-- String indicating an approximate location eg. Around Palo Alto, CA -->
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 4698b88d0..2d2375bd3 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -668,6 +668,10 @@ public class PhotoPage extends ActivityState implements
: REQUEST_CROP);
return true;
}
+ case R.id.action_trim: {
+ // TODO: Add trimming activity here.
+ return true;
+ }
case R.id.action_edit: {
Intent intent = new Intent(Intent.ACTION_EDIT)
.setData(manager.getContentUri(path))
diff --git a/src/com/android/gallery3d/data/LocalVideo.java b/src/com/android/gallery3d/data/LocalVideo.java
index 5ccc21b93..addb8fdbd 100644
--- a/src/com/android/gallery3d/data/LocalVideo.java
+++ b/src/com/android/gallery3d/data/LocalVideo.java
@@ -178,7 +178,7 @@ public class LocalVideo extends LocalMediaItem {
@Override
public int getSupportedOperations() {
- return SUPPORT_DELETE | SUPPORT_SHARE | SUPPORT_PLAY | SUPPORT_INFO;
+ return SUPPORT_DELETE | SUPPORT_SHARE | SUPPORT_PLAY | SUPPORT_INFO | SUPPORT_TRIM;
}
@Override
diff --git a/src/com/android/gallery3d/data/MediaObject.java b/src/com/android/gallery3d/data/MediaObject.java
index 0ed5b7a9a..45f425fdd 100644
--- a/src/com/android/gallery3d/data/MediaObject.java
+++ b/src/com/android/gallery3d/data/MediaObject.java
@@ -36,6 +36,7 @@ public abstract class MediaObject {
public static final int SUPPORT_EDIT = 1 << 9;
public static final int SUPPORT_INFO = 1 << 10;
public static final int SUPPORT_IMPORT = 1 << 11;
+ public static final int SUPPORT_TRIM = 1 << 12;
public static final int SUPPORT_ALL = 0xffffffff;
// These are the bits returned from getMediaType():
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index 7bccda84c..691056294 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -160,6 +160,7 @@ public class MenuExecutor {
boolean supportDelete = (supported & MediaObject.SUPPORT_DELETE) != 0;
boolean supportRotate = (supported & MediaObject.SUPPORT_ROTATE) != 0;
boolean supportCrop = (supported & MediaObject.SUPPORT_CROP) != 0;
+ boolean supportTrim = (supported & MediaObject.SUPPORT_TRIM) != 0;
boolean supportShare = (supported & MediaObject.SUPPORT_SHARE) != 0;
boolean supportSetAs = (supported & MediaObject.SUPPORT_SETAS) != 0;
boolean supportShowOnMap = (supported & MediaObject.SUPPORT_SHOW_ON_MAP) != 0;
@@ -172,6 +173,7 @@ public class MenuExecutor {
setMenuItemVisible(menu, R.id.action_rotate_ccw, supportRotate);
setMenuItemVisible(menu, R.id.action_rotate_cw, supportRotate);
setMenuItemVisible(menu, R.id.action_crop, supportCrop);
+ setMenuItemVisible(menu, R.id.action_trim, supportTrim);
setMenuItemVisible(menu, R.id.action_share, supportShare);
setMenuItemVisible(menu, R.id.action_setas, supportSetAs);
setMenuItemVisible(menu, R.id.action_show_on_map, supportShowOnMap);