summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/PhotoView.java
diff options
context:
space:
mode:
authorBobby Georgescu <georgescu@google.com>2012-09-06 17:14:02 -0700
committerBobby Georgescu <georgescu@google.com>2012-09-09 00:15:48 -0700
commit6e3cdcf8604dd202b9de08e0942d40d8cbbd26f5 (patch)
treef7efb788e566c54a1b7668d6a5fb6b4a8b4cdf22 /src/com/android/gallery3d/ui/PhotoView.java
parentb05d8805d94dc3d60a0e1b966cf2c0cd58109938 (diff)
downloadandroid_packages_apps_Snap-6e3cdcf8604dd202b9de08e0942d40d8cbbd26f5.tar.gz
android_packages_apps_Snap-6e3cdcf8604dd202b9de08e0942d40d8cbbd26f5.tar.bz2
android_packages_apps_Snap-6e3cdcf8604dd202b9de08e0942d40d8cbbd26f5.zip
Reskin: switching between filmstrip and grid in album
Bug: 7050303 Bug: 6541425 Allows switching between the filmstrip and the grid views within albums and launches camera roll in filmstrip mode by default. Also fixes animation issue when animating from full-screen to grid view. Change-Id: I2a37b92c129cc090fd807973f7e3e82fed207cd3
Diffstat (limited to 'src/com/android/gallery3d/ui/PhotoView.java')
-rw-r--r--src/com/android/gallery3d/ui/PhotoView.java24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java
index 0952cfc81..934638870 100644
--- a/src/com/android/gallery3d/ui/PhotoView.java
+++ b/src/com/android/gallery3d/ui/PhotoView.java
@@ -124,6 +124,7 @@ public class PhotoView extends GLView {
public void onDeleteImage(Path path, int offset);
public void onUndoDeleteImage();
public void onCommitDeleteImage();
+ public void onFilmModeChanged(boolean enabled);
}
// The rules about orientation locking:
@@ -624,7 +625,7 @@ public class PhotoView extends GLView {
if (mWasCameraCenter && mIsCamera && !isCenter && !mFilmMode) {
// Temporary disabled to de-emphasize filmstrip.
- // setFilmMode(true);
+ setFilmMode(true);
} else if (!mWasCameraCenter && isCameraCenter && mFilmMode) {
setFilmMode(false);
}
@@ -1267,18 +1268,22 @@ public class PhotoView extends GLView {
mGestureListener.setSwipingEnabled(enabled);
}
- private void setFilmMode(boolean enabled) {
+ public void setFilmMode(boolean enabled) {
if (mFilmMode == enabled) return;
mFilmMode = enabled;
mPositionController.setFilmMode(mFilmMode);
mModel.setNeedFullImage(!enabled);
mModel.setFocusHintDirection(
mFilmMode ? Model.FOCUS_HINT_PREVIOUS : Model.FOCUS_HINT_NEXT);
- mListener.onActionBarAllowed(!enabled);
-
- // Move into camera in page mode, lock
- if (!enabled && mPictures.get(0).isCamera()) {
- mListener.lockOrientation();
+ mListener.onFilmModeChanged(enabled);
+ boolean isCamera = mPictures.get(0).isCamera();
+ if (isCamera) {
+ // Move into camera in page mode, lock
+ if (!enabled) mListener.lockOrientation();
+ mListener.onActionBarAllowed(false);
+ } else {
+ mListener.onActionBarAllowed(true);
+ if (enabled) mListener.onActionBarWanted();
}
}
@@ -1306,6 +1311,7 @@ public class PhotoView extends GLView {
// move to the camera preview and show controls after resume
public void resetToFirstPicture() {
mModel.moveTo(0);
+ mListener.onActionBarAllowed(false);
setFilmMode(false);
}
@@ -1567,6 +1573,10 @@ public class PhotoView extends GLView {
// Focus switching
////////////////////////////////////////////////////////////////////////////
+ public void switchToImage(int index) {
+ mModel.moveTo(index);
+ }
+
private void switchToNextImage() {
mModel.moveTo(mModel.getCurrentIndex() + 1);
}