Empty notification shade state.
Bug: 16483230
Change-Id: I7953a7954cae12124146f462ed8c0dc44769a38f
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 53c4740..98bb591 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -147,6 +147,8 @@
private boolean mHeaderAnimatingIn;
private ObjectAnimator mQsContainerAnimator;
+ private boolean mShadeEmpty;
+
public NotificationPanelView(Context context, AttributeSet attrs) {
super(context, attrs);
mSystemIconsCopy = new MirrorView(context);
@@ -879,6 +881,7 @@
mQsContainer.setVisibility(
mKeyguardShowing && !expandVisually ? View.INVISIBLE : View.VISIBLE);
mScrollView.setTouchEnabled(mQsExpanded);
+ updateEmptyShadeView();
}
private void setQsExpansion(float height) {
@@ -1615,4 +1618,15 @@
}
updateKeyguardStatusBarVisibility();
}
+
+ public void setShadeEmpty(boolean shadeEmpty) {
+ mShadeEmpty = shadeEmpty;
+ updateEmptyShadeView();
+ }
+
+ private void updateEmptyShadeView() {
+
+ // Hide "No notifications" in QS.
+ mNotificationStackScroller.updateEmptyShadeView(mShadeEmpty && !mQsExpanded);
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 8dfed92..ae7d500 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -119,6 +119,7 @@
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.DismissView;
import com.android.systemui.statusbar.DragDownHelper;
+import com.android.systemui.statusbar.EmptyShadeView;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.GestureRecorder;
import com.android.systemui.statusbar.KeyguardIndicationController;
@@ -696,6 +697,9 @@
}
});
mStackScroller.setDismissView(mDismissView);
+ mEmptyShadeView = (EmptyShadeView) LayoutInflater.from(mContext).inflate(
+ R.layout.status_bar_no_notifications, mStackScroller, false);
+ mStackScroller.setEmptyShadeView(mEmptyShadeView);
mExpandedContents = mStackScroller;
mScrimController = new ScrimController(mStatusBarWindow.findViewById(R.id.scrim_behind),
@@ -1420,6 +1424,7 @@
updateRowStates();
updateSpeedbump();
updateClearAll();
+ updateEmptyShadeView();
mNotificationPanel.setQsExpansionEnabled(isDeviceProvisioned() && mUserSetup);
mShadeUpdates.check();
@@ -1432,6 +1437,13 @@
mStackScroller.updateDismissView(showDismissView);
}
+ private void updateEmptyShadeView() {
+ boolean showEmptyShade =
+ mState != StatusBarState.KEYGUARD &&
+ mNotificationData.getActiveNotifications().size() == 0;
+ mNotificationPanel.setShadeEmpty(showEmptyShade);
+ }
+
private void updateSpeedbump() {
int speedbumpIndex = -1;
int currentIndex = 0;