summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2013-08-19 16:50:34 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-08-19 16:50:34 +0000
commit1571239c21fc4be7fd3c8db6ff1b8dc22f4d7e6f (patch)
treeeee98f09ae1a776afdf9df36ae3a8c6d6e9d498a
parente9d3428f605ef90efbf94c18abf5bba3ac64d870 (diff)
parent6b9203214d828d72758943aca55adceab684a862 (diff)
downloadandroid_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
-rw-r--r--res/menu/operations.xml4
-rw-r--r--src/com/android/camera/CameraActivity.java23
2 files changed, 13 insertions, 14 deletions
diff --git a/res/menu/operations.xml b/res/menu/operations.xml
index bcebbb47b..3f0f5a123 100644
--- a/res/menu/operations.xml
+++ b/res/menu/operations.xml
@@ -35,10 +35,6 @@
android:title="@string/trim_action"
android:showAsAction="never"
android:visible="false" />
- <item android:id="@+id/action_mute"
- android:title="@string/mute_action"
- android:showAsAction="never"
- android:visible="false" />
<item android:id="@+id/action_rotate_ccw"
android:showAsAction="never"
android:visible="false"
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.