diff options
| author | 2022-01-22 02:37:30 +0000 | |
|---|---|---|
| committer | 2022-01-22 02:53:26 +0000 | |
| commit | 994e28169cb4cf66f59f4f9844af18db017de920 (patch) | |
| tree | fca638bf95e5046096f9bc0fd4fc7b520c8fc35a | |
| parent | feb567fa9e2d5886ed498adeb2483c9ada2a03cb (diff) | |
New Pipeline: Call SectionHeaderView.isContentVisible=true when added.
This was called by NotificationSectionsManager in the old pipeline, whenever that manager added the view.
I added a hook to the new pipeline's NodeController interface and had SectionHeaderController call it there.
Fixes: 211161592
Test: manual testing with the repro steps
Change-Id: Ie7f10ac584b79c9e656e1f5d5cbf1f974a57c57f
5 files changed, 43 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NodeController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NodeController.kt index 289dacbca69e..26ba12c97575 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NodeController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NodeController.kt @@ -41,17 +41,29 @@ interface NodeController { fun getChildCount(): Int = 0 + /** Called to add a child to this view */ fun addChildAt(child: NodeController, index: Int) { throw RuntimeException("Not supported") } + /** Called to move one of this view's current children to a new position */ fun moveChildTo(child: NodeController, index: Int) { throw RuntimeException("Not supported") } + /** Called to remove one of this view's current children */ fun removeChild(child: NodeController, isTransfer: Boolean) { throw RuntimeException("Not supported") } + + /** Called when this view has been added */ + fun onViewAdded() {} + + /** Called when this view has been moved */ + fun onViewMoved() {} + + /** Called when this view has been removed */ + fun onViewRemoved() {} } /** diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/SectionHeaderController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/SectionHeaderController.kt index 4e9017e05ecd..2c9508e84aef 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/SectionHeaderController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/SectionHeaderController.kt @@ -94,6 +94,10 @@ internal class SectionHeaderNodeControllerImpl @Inject constructor( _view?.setOnClearAllClickListener(listener) } + override fun onViewAdded() { + headerView?.isContentVisible = true + } + override val view: View get() = _view!! }
\ No newline at end of file diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDiffer.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDiffer.kt index 6d4ae4b1a869..28cd28594c3e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDiffer.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDiffer.kt @@ -215,13 +215,16 @@ private class ShadeNode( fun addChildAt(child: ShadeNode, index: Int) { controller.addChildAt(child.controller, index) + child.controller.onViewAdded() } fun moveChildTo(child: ShadeNode, index: Int) { controller.moveChildTo(child.controller, index) + child.controller.onViewMoved() } fun removeChild(child: ShadeNode, isTransfer: Boolean) { controller.removeChild(child.controller, isTransfer) + child.controller.onViewRemoved() } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java index b28fb58967bd..46efef66de43 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java @@ -268,6 +268,18 @@ public class ExpandableNotificationRowController implements NotifViewController } @Override + public void onViewAdded() { + } + + @Override + public void onViewMoved() { + } + + @Override + public void onViewRemoved() { + } + + @Override public int getChildCount() { final List<ExpandableNotificationRow> mChildren = mView.getAttachedChildren(); return mChildren != null ? mChildren.size() : 0; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferTest.java index bbe92f67ca2e..15ff5551703b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferTest.java @@ -274,6 +274,18 @@ public class ShadeViewDifferTest extends SysuiTestCase { public void removeChild(@NonNull NodeController child, boolean isTransfer) { view.removeView(child.getView()); } + + @Override + public void onViewAdded() { + } + + @Override + public void onViewMoved() { + } + + @Override + public void onViewRemoved() { + } } private static class SpecBuilder { |