summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/AlbumPage.java
diff options
context:
space:
mode:
authorBobby Georgescu <georgescu@google.com>2012-10-18 14:02:16 -0700
committerBobby Georgescu <georgescu@google.com>2012-10-18 15:25:15 -0700
commit26e119cebe732582df086ff56ec564d2989042fd (patch)
tree636a9af5eff56af6c5f11b4cd99b56ccbb6bbee6 /src/com/android/gallery3d/app/AlbumPage.java
parenteb4a9359eaf8a717d6bda5df3d1831cf8f547423 (diff)
downloadandroid_packages_apps_Gallery2-26e119cebe732582df086ff56ec564d2989042fd.tar.gz
android_packages_apps_Gallery2-26e119cebe732582df086ff56ec564d2989042fd.tar.bz2
android_packages_apps_Gallery2-26e119cebe732582df086ff56ec564d2989042fd.zip
Various transition tweaks/fixes in Gallery
Bug: 7376109 -Add new animation preset for photos based on UX feedback -Fix showing of highlight when tapping album grid photo -Move StateTransition enum to StateTransitionAnimation.State Change-Id: I2ce57580fa6c5f34d9545561515031899eb41eb2
Diffstat (limited to 'src/com/android/gallery3d/app/AlbumPage.java')
-rw-r--r--src/com/android/gallery3d/app/AlbumPage.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java
index 4cf73a886..f1e149771 100644
--- a/src/com/android/gallery3d/app/AlbumPage.java
+++ b/src/com/android/gallery3d/app/AlbumPage.java
@@ -22,6 +22,8 @@ import android.content.Intent;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
import android.os.Vibrator;
import android.provider.MediaStore;
import android.view.Menu;
@@ -43,6 +45,7 @@ import com.android.gallery3d.ui.ActionModeHandler.ActionModeListener;
import com.android.gallery3d.ui.AlbumSlotRenderer;
import com.android.gallery3d.ui.DetailsHelper;
import com.android.gallery3d.ui.DetailsHelper.CloseListener;
+import com.android.gallery3d.ui.FadeTexture;
import com.android.gallery3d.ui.GLCanvas;
import com.android.gallery3d.ui.GLRoot;
import com.android.gallery3d.ui.GLView;
@@ -50,6 +53,7 @@ import com.android.gallery3d.ui.PhotoFallbackEffect;
import com.android.gallery3d.ui.RelativePosition;
import com.android.gallery3d.ui.SelectionManager;
import com.android.gallery3d.ui.SlotView;
+import com.android.gallery3d.ui.SynchronizedHandler;
import com.android.gallery3d.util.Future;
import com.android.gallery3d.util.GalleryUtils;
import com.android.gallery3d.util.MediaSetUtils;
@@ -105,6 +109,9 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
private boolean mInitialSynced = false;
private RelativePosition mOpenCenter = new RelativePosition();
+ private Handler mHandler;
+ private static final int MSG_PICK_PHOTO = 0;
+
private PhotoFallbackEffect mResumeEffect;
private PhotoFallbackEffect.PositionProvider mPositionProvider =
new PhotoFallbackEffect.PositionProvider() {
@@ -248,8 +255,9 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
} else {
// Render transition in pressed state
mAlbumView.setPressedIndex(slotIndex);
-
- pickPhoto(slotIndex);
+ mAlbumView.setPressedUp();
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_PICK_PHOTO, slotIndex, 0),
+ FadeTexture.DURATION);
}
}
@@ -370,6 +378,20 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
mLaunchedFromPhotoPage =
mActivity.getStateManager().hasStateClass(PhotoPage.class);
mInCameraApp = data.getBoolean(PhotoPage.KEY_APP_BRIDGE, false);
+
+ mHandler = new SynchronizedHandler(mActivity.getGLRoot()) {
+ @Override
+ public void handleMessage(Message message) {
+ switch (message.what) {
+ case MSG_PICK_PHOTO: {
+ pickPhoto(message.arg1);
+ break;
+ }
+ default:
+ throw new AssertionError(message.what);
+ }
+ }
+ };
}
@Override