summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-04-28 15:20:04 +0200
committerJorim Jaggi <jjaggi@google.com>2014-04-28 20:59:26 +0200
commitfe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9 (patch)
tree4e4b19a043323baae0b45dfbad7126064873b2f2 /packages/SystemUI/src/com/android/systemui/ExpandHelper.java
parentdf2258be5bd9df4f9a31c4389e8b07b996d26f0b (diff)
downloadframeworks_base-fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9.zip
frameworks_base-fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9.tar.gz
frameworks_base-fe40f7d13bfc1faa35c9a131ce4be5104cb8f6b9.tar.bz2
Flatten notification hiearchy and remove glow.
Currently, the padding and the glow was inside the individual notification. This no longer works if we want to adjust the padding dynamically whether we are on Keyguard or not. This change moves the padding outside of the individual notifications, and as a side effect, removes the glow. The glow wasn't really visible with the new layout, so it's not a breaking change. We have to discuss with UX first what the new "glow" solution is going to be. Change-Id: Iac16892cb3b7bb1de3001954b1428796b07950c1
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/ExpandHelper.java')
-rw-r--r--packages/SystemUI/src/com/android/systemui/ExpandHelper.java65
1 files changed, 1 insertions, 64 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
index 8dd3f8d..c585a5b 100644
--- a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
@@ -19,7 +19,6 @@ package com.android.systemui;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
-import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.media.AudioManager;
@@ -81,8 +80,6 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
private boolean mHasPopped;
private View mEventSource;
private View mCurrView;
- private View mCurrViewTopGlow;
- private View mCurrViewBottomGlow;
private float mOldHeight;
private float mNaturalHeight;
private float mInitialTouchFocusY;
@@ -99,9 +96,6 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
private ScaleGestureDetector mSGD;
private ViewScaler mScaler;
private ObjectAnimator mScaleAnimation;
- private AnimatorSet mGlowAnimationSet;
- private ObjectAnimator mGlowTopAnimation;
- private ObjectAnimator mGlowBottomAnimation;
private Vibrator mVibrator;
private int mSmallSize;
@@ -223,14 +217,6 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
}
};
- mGlowTopAnimation = ObjectAnimator.ofFloat(null, "alpha", 0f);
- mGlowTopAnimation.addListener(glowVisibilityController);
- mGlowBottomAnimation = ObjectAnimator.ofFloat(null, "alpha", 0f);
- mGlowBottomAnimation.addListener(glowVisibilityController);
- mGlowAnimationSet = new AnimatorSet();
- mGlowAnimationSet.play(mGlowTopAnimation).with(mGlowBottomAnimation);
- mGlowAnimationSet.setDuration(GLOW_DURATION);
-
final ViewConfiguration configuration = ViewConfiguration.get(mContext);
mTouchSlop = configuration.getScaledTouchSlop();
@@ -251,7 +237,6 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
float newHeight = clamp(target);
mScaler.setHeight(newHeight);
- setGlow(calculateGlow(target, newHeight));
mLastFocusY = mSGD.getFocusY();
mLastSpanY = mSGD.getCurrentSpan();
}
@@ -322,37 +307,6 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
return (GLOW_BASE + strength * (1f - GLOW_BASE));
}
- public void setGlow(float glow) {
- if (!mGlowAnimationSet.isRunning() || glow == 0f) {
- if (mGlowAnimationSet.isRunning()) {
- mGlowAnimationSet.end();
- }
- if (mCurrViewTopGlow != null && mCurrViewBottomGlow != null) {
- if (glow == 0f || mCurrViewTopGlow.getAlpha() == 0f) {
- // animate glow in and out
- mGlowTopAnimation.setTarget(mCurrViewTopGlow);
- mGlowBottomAnimation.setTarget(mCurrViewBottomGlow);
- mGlowTopAnimation.setFloatValues(glow);
- mGlowBottomAnimation.setFloatValues(glow);
- mGlowAnimationSet.setupStartValues();
- mGlowAnimationSet.start();
- } else {
- // set it explicitly in reponse to touches.
- mCurrViewTopGlow.setAlpha(glow);
- mCurrViewBottomGlow.setAlpha(glow);
- handleGlowVisibility();
- }
- }
- }
- }
-
- private void handleGlowVisibility() {
- mCurrViewTopGlow.setVisibility(mCurrViewTopGlow.getAlpha() <= 0.0f ?
- View.INVISIBLE : View.VISIBLE);
- mCurrViewBottomGlow.setVisibility(mCurrViewBottomGlow.getAlpha() <= 0.0f ?
- View.INVISIBLE : View.VISIBLE);
- }
-
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
final int action = ev.getAction();
@@ -466,9 +420,6 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
if (mHasPopped) {
mScaler.setHeight(newHeight);
- setGlow(GLOW_BASE);
- } else {
- setGlow(calculateGlow(4f * pull, 0f));
}
final int x = (int) mSGD.getFocusX();
@@ -517,7 +468,6 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
if (DEBUG) Log.d(TAG, "scale type " + expandType + " beginning on view: " + v);
mCallback.setUserLockedChild(v, true);
setView(v);
- setGlow(GLOW_BASE);
mScaler.setView(v);
mOldHeight = mScaler.getHeight();
if (mCallback.canChildBeExpanded(v)) {
@@ -549,7 +499,6 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
if (mScaleAnimation.isRunning()) {
mScaleAnimation.cancel();
}
- setGlow(0f);
mCallback.setUserExpandedChild(mCurrView, h == mNaturalHeight);
if (targetHeight != currentHeight) {
mScaleAnimation.setFloatValues(targetHeight);
@@ -571,23 +520,11 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
private void clearView() {
mCurrView = null;
- mCurrViewTopGlow = null;
- mCurrViewBottomGlow = null;
+
}
private void setView(View v) {
mCurrView = v;
- if (v instanceof ViewGroup) {
- ViewGroup g = (ViewGroup) v;
- mCurrViewTopGlow = g.findViewById(R.id.top_glow);
- mCurrViewBottomGlow = g.findViewById(R.id.bottom_glow);
- if (DEBUG) {
- String debugLog = "Looking for glows: " +
- (mCurrViewTopGlow != null ? "found top " : "didn't find top") +
- (mCurrViewBottomGlow != null ? "found bottom " : "didn't find bottom");
- Log.v(TAG, debugLog);
- }
- }
}
@Override