This is only visible for video item.
Change-Id: I17f8e902f3560cc8524f890705c020901331df74
<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" />
<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 -->
: 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))
@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
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():
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;
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);