Fixes an issue where the notification header could be invisible
It's not actually necessary to set the visibility of the notification header since it is actually in the ChildrenContainer which already handles the visiblity. This existed from legacy times where it was outside of the viewgroup. When animating the headers, this could actually lead to blank headers. Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java Change-Id: I7763b47340a347ed44fc9ce34a98f74c7e55ef8d Fixes: 35993698
This commit is contained in:
@@ -1268,7 +1268,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
|
||||
if (mChildrenContainer != null) {
|
||||
mChildrenContainer.setVisibility(!mShowingPublic && mIsSummaryWithChildren ? VISIBLE
|
||||
: INVISIBLE);
|
||||
mChildrenContainer.setHeaderVisible(!mShowingPublic && mIsSummaryWithChildren);
|
||||
}
|
||||
// The limits might have changed if the view suddenly became a group or vice versa
|
||||
updateLimits();
|
||||
|
||||
@@ -89,7 +89,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
private ViewState mHeaderViewState;
|
||||
private int mClipBottomAmount;
|
||||
private boolean mIsLowPriority;
|
||||
private boolean mHeaderVisible = true;
|
||||
private OnClickListener mHeaderClickListener;
|
||||
private boolean mShowingNormalHeader;
|
||||
|
||||
@@ -794,11 +793,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
return mNotificationHeaderLowPriority;
|
||||
}
|
||||
|
||||
public void setHeaderVisible(boolean visible) {
|
||||
mHeaderVisible = visible;
|
||||
updateHeaderVisibility(false /* animate */);
|
||||
}
|
||||
|
||||
private void updateHeaderVisibility(boolean animate) {
|
||||
NotificationHeaderView visibleHeader = mNotificationHeader;
|
||||
NotificationHeaderView hiddenHeader = mNotificationHeaderLowPriority;
|
||||
@@ -809,7 +803,7 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
normalHeaderVisible = false;
|
||||
}
|
||||
if (animate) {
|
||||
if (mHeaderVisible && visibleHeader != null && hiddenHeader != null
|
||||
if (visibleHeader != null && hiddenHeader != null
|
||||
&& mShowingNormalHeader != normalHeaderVisible) {
|
||||
hiddenHeader.setVisibility(VISIBLE);
|
||||
visibleHeader.setVisibility(VISIBLE);
|
||||
@@ -825,7 +819,7 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
if (!animate) {
|
||||
if (visibleHeader != null) {
|
||||
getWrapperForView(visibleHeader).setVisible(true);
|
||||
visibleHeader.setVisibility(mHeaderVisible ? VISIBLE : INVISIBLE);
|
||||
visibleHeader.setVisibility(VISIBLE);
|
||||
}
|
||||
if (hiddenHeader != null) {
|
||||
getWrapperForView(hiddenHeader).setVisible(false);
|
||||
@@ -855,7 +849,7 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
|
||||
|
||||
private void updateHeaderTransformation() {
|
||||
if (mUserLocked && mHeaderVisible && showingAsLowPriority()) {
|
||||
if (mUserLocked && showingAsLowPriority()) {
|
||||
float fraction = getGroupExpandFraction();
|
||||
mNotificationHeaderWrapper.transformFrom(mNotificationHeaderWrapperLowPriority,
|
||||
fraction);
|
||||
|
||||
@@ -104,4 +104,15 @@ public class ExpandableNotificationRowTest {
|
||||
Assert.assertFalse(mRow.isShowingIcon());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotificationHeaderVisibleWhenAnimating() {
|
||||
mRow.setSensitive(true, true);
|
||||
mRow.addChildNotification(createNotification());
|
||||
mRow.addChildNotification(createNotification());
|
||||
mRow.setHideSensitive(true, false, 0, 0);
|
||||
mRow.setHideSensitive(false, true, 0, 0);
|
||||
Assert.assertTrue(
|
||||
mRow.getChildrenContainer().getVisibleHeader().getVisibility() == View.VISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user