OSDN Git Service

fix for a regression introduced in ag/534531
authorSpike Sprague <spikuru@google.com>
Fri, 29 Aug 2014 00:41:09 +0000 (17:41 -0700)
committerSpike Sprague <spikuru@google.com>
Fri, 29 Aug 2014 00:44:51 +0000 (00:44 +0000)
that CL kept the swipe-away-from-filmstip
preview background from alpha-animating correctly.

this CL fixes that and provides an alternate solution
to bug 17301367

Change-Id: I04ba363a55dd9485d13e2d243fd1fb84df1d31e5

src/com/android/camera/app/FilmstripBottomPanel.java
src/com/android/camera/widget/FilmstripLayout.java

index 661e50f..f978856 100644 (file)
@@ -269,16 +269,17 @@ class FilmstripBottomPanel implements CameraAppUI.BottomPanel {
     }
 
     public void show() {
-        int offset = mLayout.getHeight();
-        mLayout.setTranslationY(offset);
-        mLayout.animate().translationY(0).setDuration(ANIM_DURATION)
-                .setInterpolator(Gusterpolator.INSTANCE);
+        if (mLayout.getTranslationY() > 0) {
+            mLayout.animate().translationY(0).setDuration(ANIM_DURATION)
+                    .setInterpolator(Gusterpolator.INSTANCE);
+        }
     }
 
     public void hide() {
         int offset = mLayout.getHeight();
-        mLayout.setTranslationY(0);
-        mLayout.animate().translationY(offset).setDuration(ANIM_DURATION)
-                .setInterpolator(Gusterpolator.INSTANCE);
+        if (mLayout.getTranslationY() < offset) {
+            mLayout.animate().translationY(offset).setDuration(ANIM_DURATION)
+                    .setInterpolator(Gusterpolator.INSTANCE);
+        }
     }
 }
index 2e7819a..c943b7e 100644 (file)
@@ -327,6 +327,7 @@ public class FilmstripLayout extends FrameLayout implements FilmstripContentPane
             mSwipeTrend = (((int) dx) >> 1) + (mSwipeTrend >> 1);
             if (dx < 0 && mFilmstripContentLayout.getTranslationX() == 0) {
                 mBackgroundDrawable.setOffset(0);
+                FilmstripLayout.this.onSwipeOutBegin();
             }
 
             // When we start translating the filmstrip in, we want the left edge of the