summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/PhotoPage.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/app/PhotoPage.java')
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index b43cf2a70..76e050a75 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -17,7 +17,6 @@
package com.android.gallery3d.app;
import android.annotation.TargetApi;
-import android.app.ActionBar.OnMenuVisibilityListener;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
@@ -32,13 +31,15 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
-import android.view.Menu;
-import android.view.MenuItem;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.android.camera.CameraActivity;
import com.android.camera.ProxyLauncher;
+
+import com.actionbarsherlock.app.ActionBar.OnMenuVisibilityListener;
+import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuItem;
import com.android.gallery3d.R;
import com.android.gallery3d.common.ApiHelper;
import com.android.gallery3d.data.ComboAlbum;
@@ -71,7 +72,7 @@ import com.android.gallery3d.ui.SelectionManager;
import com.android.gallery3d.ui.SynchronizedHandler;
import com.android.gallery3d.util.GalleryUtils;
-public class PhotoPage extends ActivityState implements
+public abstract class PhotoPage extends ActivityState implements
PhotoView.Listener, AppBridge.Server,
PhotoPageBottomControls.Delegate, GalleryActionBar.OnAlbumModeSelectedListener {
private static final String TAG = "PhotoPage";
@@ -1017,11 +1018,16 @@ public class PhotoPage extends ActivityState implements
refreshHidingMessage();
MediaItem current = mModel.getMediaItem(0);
+ // This is a shield for monkey when it clicks the action bar
+ // menu when transitioning from filmstrip to camera
+ if (current instanceof SnailItem) return true;
+ // TODO: We should check the current photo against the MediaItem
+ // that the menu was initially created for. We need to fix this
+ // after PhotoPage being refactored.
if (current == null) {
// item is not ready, ignore
return true;
}
-
int currentIndex = mModel.getCurrentIndex();
Path path = current.getPath();
@@ -1062,6 +1068,12 @@ public class PhotoPage extends ActivityState implements
mActivity.startActivityForResult(intent, REQUEST_TRIM);
return true;
}
+ case R.id.action_mute: {
+ MuteVideo muteVideo = new MuteVideo(current,
+ manager.getContentUri(path), mActivity);
+ muteVideo.muteInBackground();
+ return true;
+ }
case R.id.action_edit: {
launchPhotoEditor();
return true;
@@ -1154,9 +1166,7 @@ public class PhotoPage extends ActivityState implements
} else if (goBack) {
onBackPressed();
} else if (unlock) {
- Intent intent = new Intent(mActivity, Gallery.class);
- intent.putExtra(Gallery.KEY_DISMISS_KEYGUARD, true);
- mActivity.startActivity(intent);
+ mActivity.getStateManager().finishState(this);
} else if (launchCamera) {
launchCamera();
} else {
@@ -1240,7 +1250,7 @@ public class PhotoPage extends ActivityState implements
Bundle data = new Bundle(getData());
data.putString(KEY_MEDIA_SET_PATH, albumPath.toString());
data.putString(PhotoPage.KEY_MEDIA_ITEM_PATH, path.toString());
- mActivity.getStateManager().startState(PhotoPage.class, data);
+ mActivity.getStateManager().startState(SinglePhotoPage.class, data);
return;
}
mModel.setCurrentPhoto(path, mCurrentIndex);