diff options
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 8 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java | 28 |
2 files changed, 24 insertions, 12 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 90b63f4..4e3a900 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -71,7 +71,6 @@ import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.statusbar.StatusBarIconList; import com.android.internal.util.LegacyNotificationUtil; -import com.android.internal.widget.SizeAdaptiveLayout; import com.android.systemui.R; import com.android.systemui.RecentsComponent; import com.android.systemui.SearchPanelView; @@ -1061,11 +1060,12 @@ public abstract class BaseStatusBar extends SystemUI implements for (int i = n-1; i >= 0; i--) { NotificationData.Entry entry = mNotificationData.get(i); if (mOnKeyguard) { - entry.row.setSystemExpanded(false); + entry.row.setExpansionDisabled(true); } else { + entry.row.setExpansionDisabled(false); if (!entry.row.isUserLocked()) { boolean top = (i == n-1); - entry.row.setSystemExpanded(top || entry.row.isUserExpanded()); + entry.row.setSystemExpanded(top); } } entry.row.setDimmed(mOnKeyguard); @@ -1278,8 +1278,8 @@ public abstract class BaseStatusBar extends SystemUI implements final boolean userChangedExpansion = oldEntry.row.hasUserChangedExpansion(); if (userChangedExpansion) { boolean userExpanded = oldEntry.row.isUserExpanded(); - newEntry.row.applyExpansionToLayout(userExpanded); newEntry.row.setUserExpanded(userExpanded); + newEntry.row.applyExpansionToLayout(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index b813e65..61aad6f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -17,9 +17,7 @@ package com.android.systemui.statusbar; import android.content.Context; -import android.graphics.Canvas; import android.util.AttributeSet; -import android.util.Log; import android.view.View; import android.view.accessibility.AccessibilityEvent; @@ -45,6 +43,12 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { * user expansion. */ private boolean mIsSystemExpanded; + + /** + * Whether the notification expansion is disabled. This is the case on Keyguard. + */ + private boolean mExpansionDisabled; + private NotificationContentView mPublicLayout; private NotificationContentView mPrivateLayout; private int mMaxExpandHeight; @@ -133,15 +137,22 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { */ public void setSystemExpanded(boolean expand) { mIsSystemExpanded = expand; - applyExpansionToLayout(expand); + applyExpansionToLayout(); + } + + /** + * @param expansionDisabled whether to prevent notification expansion + */ + public void setExpansionDisabled(boolean expansionDisabled) { + mExpansionDisabled = expansionDisabled; + applyExpansionToLayout(); } /** * Apply an expansion state to the layout. - * - * @param expand should the layout be in the expanded state */ - public void applyExpansionToLayout(boolean expand) { + public void applyExpansionToLayout() { + boolean expand = isExpanded(); if (expand && mExpandable) { setActualHeight(mMaxExpandHeight); } else { @@ -177,7 +188,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { * @return whether the view state is currently expanded. */ private boolean isExpanded() { - return !hasUserChangedExpansion() && isSystemExpanded() || isUserExpanded(); + return !mExpansionDisabled + && (!hasUserChangedExpansion() && isSystemExpanded() || isUserExpanded()); } @Override @@ -186,7 +198,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { boolean updateExpandHeight = mMaxExpandHeight == 0; mMaxExpandHeight = mPrivateLayout.getMaxHeight(); if (updateExpandHeight) { - applyExpansionToLayout(isExpanded()); + applyExpansionToLayout(); } } |