summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorGeoff Mendal <mendal@google.com>2014-06-16 09:06:45 -0700
committerGeoff Mendal <mendal@google.com>2014-06-16 09:06:45 -0700
commit803c5eb17d083417037942f4e84296401701f767 (patch)
treeb022409f6587de2237f9496bf86dcc2886b4326a /packages
parent5d140e4b1b1d43c742a7d67dd5f9d394c846945f (diff)
parent587e9e183117609e21653ee53dfe80c22817d89d (diff)
downloadframeworks_base-803c5eb17d083417037942f4e84296401701f767.zip
frameworks_base-803c5eb17d083417037942f4e84296401701f767.tar.gz
frameworks_base-803c5eb17d083417037942f4e84296401701f767.tar.bz2
Merge commit 'fd7ef123c01718e44c13ed638b86a7483ae2d9c9'
Conflicts: packages/SystemUI/res/values/dimens.xml
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/res/values/dimens.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java70
4 files changed, 8 insertions, 83 deletions
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 5ffe3b3..7b5399e 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -330,6 +330,4 @@
phone hints. -->
<dimen name="edge_tap_area_width">48dp</dimen>
- <!-- the distance the panel moves up when starting the up motion on Keyguard -->
- <dimen name="keyguard_panel_move_up_distance">100dp</dimen>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
index db85b14..6a83a5e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
@@ -88,15 +88,13 @@ public class KeyguardClockPositionAlgorithm {
public void run(Result result) {
int y = getClockY() - mKeyguardStatusHeight/2;
- float topAdjustment = getTopExpansionAdjustment();
+ float clockAdjustment = getClockYExpansionAdjustment();
float topPaddingAdjMultiplier = getTopPaddingAdjMultiplier();
- result.stackScrollerPaddingAdjustment = (int) (topAdjustment*topPaddingAdjMultiplier);
+ result.stackScrollerPaddingAdjustment = (int) (clockAdjustment*topPaddingAdjMultiplier);
int clockNotificationsPadding = getClockNotificationsPadding()
+ result.stackScrollerPaddingAdjustment;
int padding = y + clockNotificationsPadding;
- if (mNotificationCount == 0) {
- y += topAdjustment;
- }
+ y += clockAdjustment;
result.clockY = y;
result.stackScrollerPadding = mKeyguardStatusHeight + padding;
result.clockAlpha = getClockAlpha(result.stackScrollerPadding
@@ -119,8 +117,8 @@ public class KeyguardClockPositionAlgorithm {
return (int) (getClockYFraction() * mHeight);
}
- private float getTopExpansionAdjustment() {
- float rubberbandFactor = getTopExpansionRubberbandFactor();
+ private float getClockYExpansionAdjustment() {
+ float rubberbandFactor = getClockYExpansionRubberbandFactor();
float value = (rubberbandFactor * (mMaxPanelHeight - mExpandedHeight));
float t = value / mMaxPanelHeight;
float slowedDownValue = -sSlowDownInterpolator.getInterpolation(t) * SLOW_DOWN_FACTOR
@@ -132,7 +130,7 @@ public class KeyguardClockPositionAlgorithm {
}
}
- private float getTopExpansionRubberbandFactor() {
+ private float getClockYExpansionRubberbandFactor() {
float t = getNotificationAmountT();
t = Math.min(t, 1.0f);
t = (float) Math.pow(t, 0.3f);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 5c686fc..eb8bce0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -696,11 +696,6 @@ public class NotificationPanelView extends PanelView implements
}
@Override
- protected boolean hasNotifications() {
- return mNotificationStackScroller.getNotGoneChildCount() > 0;
- }
-
- @Override
protected int getMaxPanelHeight() {
// TODO: Figure out transition for collapsing when QS is open, adjust height here.
int emptyBottomMargin = mNotificationStackScroller.getEmptyBottomMargin();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index 08305dc..1f3098d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -30,8 +30,6 @@ import android.view.ViewConfiguration;
import android.view.ViewTreeObserver;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
-import android.view.animation.LinearInterpolator;
-import android.view.animation.PathInterpolator;
import android.widget.FrameLayout;
import com.android.systemui.R;
@@ -45,8 +43,6 @@ public abstract class PanelView extends FrameLayout {
public static final boolean DEBUG = PanelBar.DEBUG;
public static final String TAG = PanelView.class.getSimpleName();
- private static final long KEYGUARD_MOVE_UP_LENGTH = 300;
-
private final void logf(String fmt, Object... args) {
Log.v(TAG, (mViewName != null ? (mViewName + ": ") : "") + String.format(fmt, args));
}
@@ -66,9 +62,6 @@ public abstract class PanelView extends FrameLayout {
protected int mTouchSlop;
protected boolean mHintAnimationRunning;
private boolean mOverExpandedBeforeFling;
- private boolean mKeyguardMovingUp;
- private int mKeyguardMoveUpDistance;
- private float mKeyguardFingerHeight;
private ValueAnimator mHeightAnimator;
private ObjectAnimator mPeekAnimator;
@@ -89,8 +82,6 @@ public abstract class PanelView extends FrameLayout {
private Interpolator mLinearOutSlowInInterpolator;
private Interpolator mBounceInterpolator;
- private Interpolator mKeyguardMoveUpInterpolator;
- private final Interpolator mLinearInterpolator = new LinearInterpolator();
protected void onExpandingFinished() {
mBar.onExpandingFinished();
@@ -118,7 +109,6 @@ public abstract class PanelView extends FrameLayout {
mLinearOutSlowInInterpolator =
AnimationUtils.loadInterpolator(context, android.R.interpolator.fast_out_slow_in);
mBounceInterpolator = new BounceInterpolator();
- mKeyguardMoveUpInterpolator = new PathInterpolator(0.6f, 0f, 0.4f, 1f);
}
protected void loadDimens() {
@@ -130,8 +120,6 @@ public abstract class PanelView extends FrameLayout {
mTouchSlop = configuration.getScaledTouchSlop();
mHintDistance = res.getDimension(R.dimen.hint_move_distance);
mEdgeTapAreaWidth = res.getDimensionPixelSize(R.dimen.edge_tap_area_width);
- mKeyguardMoveUpDistance =
- res.getDimensionPixelSize(R.dimen.keyguard_panel_move_up_distance);
}
private void trackMovement(MotionEvent event) {
@@ -229,13 +217,8 @@ public abstract class PanelView extends FrameLayout {
mJustPeeked = false;
}
if (!mJustPeeked && (!waitForTouchSlop || mTracking)) {
- if (mStatusBar.getBarState() == StatusBarState.KEYGUARD &&
- !hasNotifications()) {
- setExpandedHeightKeyguard(newHeight);
- } else {
- setExpandedHeightInternal(newHeight);
- mBar.panelExpansionChanged(PanelView.this, mExpandedFraction);
- }
+ setExpandedHeightInternal(newHeight);
+ mBar.panelExpansionChanged(PanelView.this, mExpandedFraction);
}
trackMovement(event);
@@ -264,56 +247,10 @@ public abstract class PanelView extends FrameLayout {
return !waitForTouchSlop || mTracking;
}
- protected abstract boolean hasNotifications();
-
- private void setExpandedHeightKeyguard(float newHeight) {
- mKeyguardFingerHeight = newHeight;
- if (newHeight < getMaxPanelHeight() && !mKeyguardMovingUp) {
- mKeyguardMovingUp = true;
- ValueAnimator anim = createHeightAnimator(
- getMaxPanelHeight() - mKeyguardMoveUpDistance);
- anim.setDuration(KEYGUARD_MOVE_UP_LENGTH);
- anim.setInterpolator(mKeyguardMoveUpInterpolator);
- anim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mHeightAnimator = null;
- }
- });
- mHeightAnimator = anim;
- anim.start();
- postOnAnimationDelayed(new Runnable() {
- @Override
- public void run() {
- if (mKeyguardFingerHeight < mExpandedHeight && mHeightAnimator != null
- && mKeyguardMovingUp) {
- mHeightAnimator.cancel();
- float target = getMaxPanelHeight() - 1.75f * mKeyguardMoveUpDistance;
- float diff = mExpandedHeight - target;
- ValueAnimator anim = createHeightAnimator(target);
- float velocity = 2.5f * mKeyguardMoveUpDistance /
- (KEYGUARD_MOVE_UP_LENGTH / 1000f);
- anim.setInterpolator(mLinearInterpolator);
- anim.setDuration(Math.max(0, (long) (diff / velocity * 1000f)));
- anim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mHeightAnimator = null;
- }
- });
- mHeightAnimator = anim;
- anim.start();
- }
- }
- }, KEYGUARD_MOVE_UP_LENGTH / 2);
- }
- }
-
protected abstract boolean hasConflictingGestures();
protected void onTrackingStopped(boolean expand) {
mTracking = false;
- mKeyguardMovingUp = false;
mBar.onTrackingStopped(PanelView.this, expand);
}
@@ -444,9 +381,6 @@ public abstract class PanelView extends FrameLayout {
protected void fling(float vel, boolean expand) {
cancelPeek();
- if (mHeightAnimator != null) {
- mHeightAnimator.cancel();
- }
float target = expand ? getMaxPanelHeight() : 0.0f;
if (target == mExpandedHeight || getOverExpansionAmount() > 0f && expand) {
onExpandingFinished();