summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/statusbar/stack
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-08-05 16:22:30 +0200
committerJorim Jaggi <jjaggi@google.com>2014-08-05 16:38:02 +0200
commita2052ea218386877e6d5d2136483a62b2b31f774 (patch)
tree4b933b155795ab6abb280b9aff74438ea91074d9 /packages/SystemUI/src/com/android/systemui/statusbar/stack
parentf479792e05485a536c3fa68db9d8a71f34591b78 (diff)
downloadframeworks_base-a2052ea218386877e6d5d2136483a62b2b31f774.zip
frameworks_base-a2052ea218386877e6d5d2136483a62b2b31f774.tar.gz
frameworks_base-a2052ea218386877e6d5d2136483a62b2b31f774.tar.bz2
Empty notification shade state.
Bug: 16483230 Change-Id: I7953a7954cae12124146f462ed8c0dc44769a38f
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar/stack')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java38
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java6
2 files changed, 44 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index 943ee21..fcca5fa 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -36,6 +36,7 @@ import com.android.systemui.R;
import com.android.systemui.SwipeHelper;
import com.android.systemui.statusbar.ActivatableNotificationView;
import com.android.systemui.statusbar.DismissView;
+import com.android.systemui.statusbar.EmptyShadeView;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.ExpandableView;
import com.android.systemui.statusbar.SpeedBumpView;
@@ -145,6 +146,7 @@ public class NotificationStackScrollLayout extends ViewGroup
private boolean mExpandedInThisMotion;
private boolean mScrollingEnabled;
private DismissView mDismissView;
+ private EmptyShadeView mEmptyShadeView;
private boolean mDismissAllInProgress;
/**
@@ -1222,6 +1224,9 @@ public class NotificationStackScrollLayout extends ViewGroup
if (mDismissView.willBeGone()) {
count--;
}
+ if (mEmptyShadeView.willBeGone()) {
+ count--;
+ }
return count;
}
@@ -1985,6 +1990,7 @@ public class NotificationStackScrollLayout extends ViewGroup
public void goToFullShade(long delay) {
updateSpeedBump(true /* visibility */);
mDismissView.setInvisible();
+ mEmptyShadeView.setInvisible();
mGoToFullShadeNeedsAnimation = true;
mGoToFullShadeDelay = delay;
mNeedsAnimation = true;
@@ -2039,6 +2045,38 @@ public class NotificationStackScrollLayout extends ViewGroup
addView(mDismissView);
}
+ public void setEmptyShadeView(EmptyShadeView emptyShadeView) {
+ mEmptyShadeView = emptyShadeView;
+ addView(mEmptyShadeView);
+ }
+
+ public void updateEmptyShadeView(boolean visible) {
+ int oldVisibility = mEmptyShadeView.willBeGone() ? GONE : mEmptyShadeView.getVisibility();
+ int newVisibility = visible ? VISIBLE : GONE;
+ if (oldVisibility != newVisibility) {
+ if (oldVisibility == GONE) {
+ if (mEmptyShadeView.willBeGone()) {
+ mEmptyShadeView.cancelAnimation();
+ } else {
+ mEmptyShadeView.setInvisible();
+ mEmptyShadeView.setVisibility(newVisibility);
+ }
+ mEmptyShadeView.setWillBeGone(false);
+ updateContentHeight();
+ } else {
+ mEmptyShadeView.setWillBeGone(true);
+ mEmptyShadeView.performVisibilityAnimation(false, new Runnable() {
+ @Override
+ public void run() {
+ mEmptyShadeView.setVisibility(GONE);
+ mEmptyShadeView.setWillBeGone(false);
+ updateContentHeight();
+ }
+ });
+ }
+ }
+ }
+
public void updateDismissView(boolean visible) {
int oldVisibility = mDismissView.willBeGone() ? GONE : mDismissView.getVisibility();
int newVisibility = visible ? VISIBLE : GONE;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java
index a174952..f7a2824 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java
@@ -23,6 +23,7 @@ import android.view.ViewGroup;
import com.android.systemui.R;
import com.android.systemui.statusbar.DismissView;
+import com.android.systemui.statusbar.EmptyShadeView;
import com.android.systemui.statusbar.ExpandableView;
import com.android.systemui.statusbar.SpeedBumpView;
@@ -180,6 +181,11 @@ public class StackScrollState {
DismissView dismissView = (DismissView) child;
boolean visible = state.topOverLap < mClearAllTopPadding;
dismissView.performVisibilityAnimation(visible && !dismissView.willBeGone());
+ } else if (child instanceof EmptyShadeView) {
+ EmptyShadeView emptyShadeView = (EmptyShadeView) child;
+ boolean visible = state.topOverLap <= 0;
+ emptyShadeView.performVisibilityAnimation(
+ visible && !emptyShadeView.willBeGone());
}
}
}