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
This commit is contained in:
Jeff DeCew
2022-01-22 02:37:30 +00:00
parent feb567fa9e
commit 994e28169c
5 changed files with 43 additions and 0 deletions

View File

@@ -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() {}
}
/**

View File

@@ -94,6 +94,10 @@ internal class SectionHeaderNodeControllerImpl @Inject constructor(
_view?.setOnClearAllClickListener(listener)
}
override fun onViewAdded() {
headerView?.isContentVisible = true
}
override val view: View
get() = _view!!
}

View File

@@ -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()
}
}

View File

@@ -267,6 +267,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();

View File

@@ -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 {