diff options
author | ztenghui <ztenghui@google.com> | 2013-08-19 16:50:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-19 16:50:34 +0000 |
commit | 1571239c21fc4be7fd3c8db6ff1b8dc22f4d7e6f (patch) | |
tree | eee98f09ae1a776afdf9df36ae3a8c6d6e9d498a /src/com/android | |
parent | e9d3428f605ef90efbf94c18abf5bba3ac64d870 (diff) | |
parent | 6b9203214d828d72758943aca55adceab684a862 (diff) | |
download | android_packages_apps_Snap-1571239c21fc4be7fd3c8db6ff1b8dc22f4d7e6f.tar.gz android_packages_apps_Snap-1571239c21fc4be7fd3c8db6ff1b8dc22f4d7e6f.tar.bz2 android_packages_apps_Snap-1571239c21fc4be7fd3c8db6ff1b8dc22f4d7e6f.zip |
Merge "Add the trim functionality back to FilmStripView" into gb-ub-photos-carlsbad
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index acac19199..e300b5d08 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -76,6 +76,9 @@ public class CameraActivity extends Activity "android.media.action.STILL_IMAGE_CAMERA_SECURE"; public static final String ACTION_IMAGE_CAPTURE_SECURE = "android.media.action.IMAGE_CAPTURE_SECURE"; + public static final String ACTION_TRIM_VIDEO = + "com.android.camera.action.TRIM"; + public static final String MEDIA_ITEM_PATH = "media-item-path"; // The intent extra for camera from secure lock screen. True if the gallery // should only show newly captured pictures. sSecureAlbumId does not @@ -92,8 +95,7 @@ public class CameraActivity extends Activity private static final int SUPPORT_SETAS = 1 << 4; private static final int SUPPORT_EDIT = 1 << 5; private static final int SUPPORT_TRIM = 1 << 6; - private static final int SUPPORT_MUTE = 1 << 7; - private static final int SUPPORT_SHOW_ON_MAP = 1 << 8; + private static final int SUPPORT_SHOW_ON_MAP = 1 << 7; private static final int SUPPORT_ALL = 0xffffffff; /** This data adapter is used by FilmStripView. */ @@ -275,8 +277,7 @@ public class CameraActivity extends Activity | SUPPORT_SHOW_ON_MAP; break; case LocalData.LOCAL_VIDEO: - supported |= SUPPORT_DELETE | SUPPORT_INFO | SUPPORT_TRIM - | SUPPORT_MUTE; + supported |= SUPPORT_DELETE | SUPPORT_INFO | SUPPORT_TRIM; break; case LocalData.LOCAL_PHOTO_SPHERE: supported |= SUPPORT_DELETE | SUPPORT_ROTATE | SUPPORT_INFO @@ -297,8 +298,6 @@ public class CameraActivity extends Activity (supported & SUPPORT_CROP) != 0); setMenuItemVisible(mActionBarMenu, R.id.action_trim, (supported & SUPPORT_TRIM) != 0); - setMenuItemVisible(mActionBarMenu, R.id.action_mute, - (supported & SUPPORT_MUTE) != 0); setMenuItemVisible(mActionBarMenu, R.id.action_setas, (supported & SUPPORT_SETAS) != 0); setMenuItemVisible(mActionBarMenu, R.id.action_edit, @@ -443,10 +442,14 @@ public class CameraActivity extends Activity // TODO: add the functionality. return true; case R.id.action_trim: - // TODO: add the functionality. - return true; - case R.id.action_mute: - // TODO: add the functionality. + // This is going to be handled by the Gallery app. + Intent intent = new Intent(ACTION_TRIM_VIDEO); + LocalData currentData = mDataAdapter.getLocalData( + mFilmStripView.getCurrentId()); + intent.setData(currentData.getContentUri()); + // We need the file path to wrap this into a RandomAccessFile. + intent.putExtra(MEDIA_ITEM_PATH, currentData.getPath()); + startActivity(intent); return true; case R.id.action_rotate_ccw: // TODO: add the functionality. |