summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/ApiHelper.java3
-rw-r--r--src/com/android/gallery3d/app/TrimVideo.java24
-rw-r--r--src/com/android/gallery3d/ui/MenuExecutor.java3
3 files changed, 16 insertions, 14 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
index cfdde15..45a859e 100644
--- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
+++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
@@ -165,9 +165,6 @@ public class ApiHelper {
public static final boolean CAN_START_PREVIEW_IN_JPEG_CALLBACK =
Build.VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH;
- public static final boolean HAS_MEDIA_MUXER =
- Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
-
public static int getIntFieldIfExists(Class<?> klass, String fieldName,
Class<?> obj, int defaultVal) {
try {
diff --git a/src/com/android/gallery3d/app/TrimVideo.java b/src/com/android/gallery3d/app/TrimVideo.java
index f7ff43e..1018ef6 100644
--- a/src/com/android/gallery3d/app/TrimVideo.java
+++ b/src/com/android/gallery3d/app/TrimVideo.java
@@ -16,8 +16,6 @@
package com.android.gallery3d.app;
-import android.app.ActionBar;
-import android.app.Activity;
import android.app.ProgressDialog;
import android.content.ContentResolver;
import android.content.ContentValues;
@@ -31,14 +29,17 @@ import android.os.Environment;
import android.os.Handler;
import android.provider.MediaStore.Video;
import android.provider.MediaStore.Video.VideoColumns;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import android.widget.VideoView;
+import com.actionbarsherlock.app.ActionBar;
+import com.actionbarsherlock.app.SherlockActivity;
+import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuInflater;
+import com.actionbarsherlock.view.MenuItem;
+import com.actionbarsherlock.view.Window;
import com.android.gallery3d.R;
import com.android.gallery3d.util.BucketNames;
@@ -47,7 +48,7 @@ import java.io.IOException;
import java.sql.Date;
import java.text.SimpleDateFormat;
-public class TrimVideo extends Activity implements
+public class TrimVideo extends SherlockActivity implements
MediaPlayer.OnErrorListener,
MediaPlayer.OnCompletionListener,
ControllerOverlay.Listener {
@@ -83,8 +84,13 @@ public class TrimVideo extends Activity implements
mContext = getApplicationContext();
super.onCreate(savedInstanceState);
- ActionBar actionBar = getActionBar();
- actionBar.setDisplayHomeAsUpEnabled(true);
+ requestWindowFeature(Window.FEATURE_ACTION_BAR);
+ requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
+
+ ActionBar actionBar = getSupportActionBar();
+ int displayOptions = ActionBar.DISPLAY_HOME_AS_UP
+ | ActionBar.DISPLAY_SHOW_TITLE;
+ actionBar.setDisplayOptions(displayOptions, displayOptions);
Intent intent = getIntent();
mUri = intent.getData();
@@ -209,7 +215,7 @@ public class TrimVideo extends Activity implements
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
- MenuInflater inflater = getMenuInflater();
+ MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.trim, menu);
return true;
};
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index bd386f8..1f28555 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -165,8 +165,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
- && ApiHelper.HAS_MEDIA_MUXER;
+ 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;