diff options
author | John Reck <jreck@google.com> | 2012-10-17 15:05:24 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-10-17 15:05:24 -0700 |
commit | fb0051a8d4bdc027e3b5fdf895718199ca24e133 (patch) | |
tree | ecc2078c3e29cd2eab7bdc522553d3c97f036448 /src/com/android/gallery3d/ui | |
parent | d4f457e0133bac5e3b172a1261a36ff62c39953c (diff) | |
download | android_packages_apps_Snap-fb0051a8d4bdc027e3b5fdf895718199ca24e133.tar.gz android_packages_apps_Snap-fb0051a8d4bdc027e3b5fdf895718199ca24e133.tar.bz2 android_packages_apps_Snap-fb0051a8d4bdc027e3b5fdf895718199ca24e133.zip |
Only fade out if texture creation succeeded
Bug: 7366597
Change-Id: Id28970fe263d975dcd48e45fd716199bc40f64d3
Diffstat (limited to 'src/com/android/gallery3d/ui')
-rw-r--r-- | src/com/android/gallery3d/ui/PreparePageFadeoutTexture.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/ui/PreparePageFadeoutTexture.java b/src/com/android/gallery3d/ui/PreparePageFadeoutTexture.java index 7cab753c3..5152fc9bb 100644 --- a/src/com/android/gallery3d/ui/PreparePageFadeoutTexture.java +++ b/src/com/android/gallery3d/ui/PreparePageFadeoutTexture.java @@ -43,8 +43,12 @@ public class PreparePageFadeoutTexture implements OnGLIdleListener { return false; } - public static void prepareFadeOutTexture(AbstractGalleryActivity activity, + public static boolean prepareFadeOutTexture(AbstractGalleryActivity activity, GLView rootPane) { + if (rootPane.getWidth() == 0 || rootPane.getHeight() == 0) { + // The view hasn't been measured yet, just abort the animation + return false; + } GLRoot root = activity.getGLRoot(); PreparePageFadeoutTexture task = new PreparePageFadeoutTexture(rootPane); RawTexture texture = null; @@ -56,8 +60,10 @@ public class PreparePageFadeoutTexture implements OnGLIdleListener { root.lockRenderThread(); } - if (texture != null) { - activity.getTransitionStore().put(KEY_FADE_TEXTURE, texture); + if (texture == null) { + return false; } + activity.getTransitionStore().put(KEY_FADE_TEXTURE, texture); + return true; } } |