Made sure that the ambient single line view remains invisible

The single line views are visible by default when they are inflated
and not all calls to it actually ensure that the visibility is
updated. We therefore make sure that the view is appropriately
hidden.

Change-Id: Ied7641347d910fff5c8f1f0b38d349e7f3b56b76
Fixes: 77290485
Test: add second notification to group, observe no overlapping text
This commit is contained in:
Selim Cinek
2018-05-15 11:17:07 -07:00
parent 150bafd217
commit c5926c3602

View File

@@ -1196,8 +1196,13 @@ public class NotificationContentView extends FrameLayout {
}
private void updateSingleLineView() {
if (mIsChildInGroup) {
boolean isNewView = mSingleLineView == null;
mSingleLineView = mHybridGroupManager.bindFromNotification(
mSingleLineView, mStatusBarNotification.getNotification());
if (isNewView) {
updateViewVisibility(mVisibleType, VISIBLE_TYPE_SINGLELINE,
mSingleLineView, mSingleLineView);
}
} else if (mSingleLineView != null) {
removeView(mSingleLineView);
mSingleLineView = null;
@@ -1206,8 +1211,13 @@ public class NotificationContentView extends FrameLayout {
private void updateAmbientSingleLineView() {
if (mIsChildInGroup) {
boolean isNewView = mAmbientSingleLineChild == null;
mAmbientSingleLineChild = mHybridGroupManager.bindAmbientFromNotification(
mAmbientSingleLineChild, mStatusBarNotification.getNotification());
if (isNewView) {
updateViewVisibility(mVisibleType, VISIBLE_TYPE_AMBIENT_SINGLELINE,
mAmbientSingleLineChild, mAmbientSingleLineChild);
}
} else if (mAmbientSingleLineChild != null) {
removeView(mAmbientSingleLineChild);
mAmbientSingleLineChild = null;