summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/PhotoPage.java
diff options
context:
space:
mode:
authorRay Chen <raychen@google.com>2011-10-21 16:07:12 +0800
committerRay Chen <raychen@google.com>2011-10-27 17:49:59 +0800
commit09efcf9a9367bda0a9d28f312c9b3d0e93dd49da (patch)
treeadbbdd51460d52d7b47f5fe2caa35bbde09f320b /src/com/android/gallery3d/app/PhotoPage.java
parent773d368357ce50bc299551a768584d5a222fd440 (diff)
downloadandroid_packages_apps_Snap-09efcf9a9367bda0a9d28f312c9b3d0e93dd49da.tar.gz
android_packages_apps_Snap-09efcf9a9367bda0a9d28f312c9b3d0e93dd49da.tar.bz2
android_packages_apps_Snap-09efcf9a9367bda0a9d28f312c9b3d0e93dd49da.zip
Fix 5471518 Playing slide show from any picture doesn't start from the current picture which is unexpected IRL17 Crespo
Change-Id: I2ed78cee2f6257254794a7724897845c43a3e0a5
Diffstat (limited to 'src/com/android/gallery3d/app/PhotoPage.java')
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java48
1 files changed, 27 insertions, 21 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 44b9299fc..ec7d16175 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -16,6 +16,25 @@
package com.android.gallery3d.app;
+import android.app.ActionBar;
+import android.app.Activity;
+import android.app.ActionBar.OnMenuVisibilityListener;
+import android.content.ActivityNotFoundException;
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.WindowManager;
+import android.view.View.MeasureSpec;
+import android.widget.ShareActionProvider;
+import android.widget.Toast;
+
import com.android.gallery3d.R;
import com.android.gallery3d.data.DataManager;
import com.android.gallery3d.data.MediaDetails;
@@ -41,25 +60,6 @@ import com.android.gallery3d.ui.SynchronizedHandler;
import com.android.gallery3d.ui.UserInteractionListener;
import com.android.gallery3d.util.GalleryUtils;
-import android.app.ActionBar;
-import android.app.ActionBar.OnMenuVisibilityListener;
-import android.app.Activity;
-import android.content.ActivityNotFoundException;
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.View.MeasureSpec;
-import android.view.WindowManager;
-import android.widget.ShareActionProvider;
-import android.widget.Toast;
-
public class PhotoPage extends ActivityState
implements PhotoView.PhotoTapListener, FilmStripView.Listener,
UserInteractionListener {
@@ -92,7 +92,7 @@ public class PhotoPage extends ActivityState
private MediaSet mMediaSet;
private Menu mMenu;
- private Intent mResultIntent = new Intent();
+ private final Intent mResultIntent = new Intent();
private int mCurrentIndex = 0;
private Handler mHandler;
private boolean mShowBars = true;
@@ -121,7 +121,7 @@ public class PhotoPage extends ActivityState
}
}
- private GLView mRootPane = new GLView() {
+ private final GLView mRootPane = new GLView() {
@Override
protected void renderBackground(GLCanvas view) {
@@ -305,6 +305,11 @@ public class PhotoPage extends ActivityState
if (!GalleryUtils.isEditorAvailable((Context) mActivity, "image/*")) {
supportedOperations &= ~MediaObject.SUPPORT_EDIT;
}
+ MenuItem item = mMenu.findItem(R.id.action_slideshow);
+ if (item != null) {
+ item.setVisible(mCurrentPhoto.getMediaType() == MediaObject.MEDIA_TYPE_IMAGE);
+ }
+
MenuExecutor.updateMenuOperation(mMenu, supportedOperations);
}
@@ -417,6 +422,7 @@ public class PhotoPage extends ActivityState
case R.id.action_slideshow: {
Bundle data = new Bundle();
data.putString(SlideshowPage.KEY_SET_PATH, mMediaSet.getPath().toString());
+ data.putString(SlideshowPage.KEY_ITEM_PATH, path.toString());
data.putInt(SlideshowPage.KEY_PHOTO_INDEX, currentIndex);
data.putBoolean(SlideshowPage.KEY_REPEAT, true);
mActivity.getStateManager().startStateForResult(