OSDN Git Service

Fix scrim flashing when no security is set.
authorJorim Jaggi <jjaggi@google.com>
Mon, 30 Jun 2014 21:53:39 +0000 (23:53 +0200)
committerJorim Jaggi <jjaggi@google.com>
Tue, 1 Jul 2014 13:49:21 +0000 (15:49 +0200)
Change-Id: Iccd07c39b57c7bcf3d4d26a00a46926df56eddbc

packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java

index 977bb63..5b47749 100644 (file)
@@ -282,7 +282,7 @@ public abstract class PanelView extends FrameLayout {
                         onTrackingStarted();
                     }
                 }
-                final float newHeight = h + mInitialOffsetOnTouch;
+                final float newHeight = Math.max(0, h + mInitialOffsetOnTouch);
                 if (newHeight > mPeekHeight) {
                     if (mPeekAnimator != null) {
                         mPeekAnimator.cancel();
@@ -565,6 +565,7 @@ public abstract class PanelView extends FrameLayout {
             }
         }
 
+        mExpandedHeight = Math.max(0, mExpandedHeight);
         onHeightUpdated(mExpandedHeight);
         mExpandedFraction = Math.min(1f, fhWithoutOverExpansion == 0
                 ? 0
index bf63f7f..2e61b3e 100644 (file)
@@ -94,8 +94,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener {
     }
 
     public void setPanelExpansion(float fraction) {
-        mFraction = fraction;
-        scheduleUpdate();
+        if (mFraction != fraction) {
+            mFraction = fraction;
+            scheduleUpdate();
+        }
     }
 
     public void setBouncerShowing(boolean showing) {