summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2012-08-23 16:45:11 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2012-08-27 13:24:33 -0700
commit4a52b40a06fa7bb8fd11c88af0c21cf290e45b39 (patch)
tree7dff7c0556c0408f9bc103e701038e79be14f7da /src
parentde13f16dbffc9a0cadc05913c1fce1ffcd8f6dd3 (diff)
downloadandroid_packages_apps_Snap-4a52b40a06fa7bb8fd11c88af0c21cf290e45b39.tar.gz
android_packages_apps_Snap-4a52b40a06fa7bb8fd11c88af0c21cf290e45b39.tar.bz2
android_packages_apps_Snap-4a52b40a06fa7bb8fd11c88af0c21cf290e45b39.zip
add the menu button to support trimming
This is only visible for video item. Change-Id: I17f8e902f3560cc8524f890705c020901331df74
Diffstat (limited to 'src')
-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
4 files changed, 8 insertions, 1 deletions
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);