summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Obregon <robregon@ti.com>2010-11-18 13:49:27 -0600
committerRodrigo Obregon <robregon@ti.com>2010-11-18 19:09:04 -0600
commitf3a57d42104c5df77624d38813747b1279525d50 (patch)
treea2c5e1d87fdcd12843db369a5ebda297bb6fb0a2
parentd366b3eafb111d2cc7ef97f9bd2ed330ce90ed06 (diff)
downloadGallery3D-f3a57d42104c5df77624d38813747b1279525d50.tar.gz
Gallery3D: Add depth component to icon animation
When the Gallery application positions the thumbnails in a GridView, they are placed in the same z-plane. When a configuration change occurs the icons present a z-fighting visual artifact. This patch adds a z component to the thumbnails when they are animated as to mitigate this effect. This is specially noticeable in a GPU architecture using deferred rendering. Change-Id: If78232058b71d482cde0dbb55a038ded9fdbdf76 Signed-off-by: Rodrigo Obregon <robregon@ti.com>
-rw-r--r--src/com/cooliris/media/GridLayer.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/cooliris/media/GridLayer.java b/src/com/cooliris/media/GridLayer.java
index 74aff5d..1bf7ebc 100644
--- a/src/com/cooliris/media/GridLayer.java
+++ b/src/com/cooliris/media/GridLayer.java
@@ -82,6 +82,7 @@ public final class GridLayer extends RootLayer implements MediaFeed.Listener, Ti
private final LayoutInterface mLayoutInterface;
private static final LayoutInterface sfullScreenLayoutInterface = new GridLayoutInterface(1);
+ private static final float DEPTH_POSITION = 0.5f;
private MediaFeed mMediaFeed;
private boolean mInAlbum = false;
@@ -678,6 +679,14 @@ public final class GridLayer extends RootLayer implements MediaFeed.Listener, Ti
displayItem.set(position, j, false);
displayItem.commit();
} else {
+ boolean isTouchPressed = mInputProcessor.touchPressed();
+ boolean isBarDragged = mHud.getTimeBar().isDragged();
+ if (mState == STATE_GRID_VIEW
+ && !isTouchPressed
+ && !isBarDragged) {
+ displayItem.mAnimatedPosition.add(
+ 0.0f, 0.0f, i * DEPTH_POSITION);
+ }
displayList.setPositionAndStackIndex(displayItem, position, j, true);
}
displayItems[baseIndex + j] = displayItem;