diff options
| author | 2020-08-18 13:30:24 +0000 | |
|---|---|---|
| committer | 2020-08-18 13:30:24 +0000 | |
| commit | 708da23c6f6923f77cef817a2aea5aa49fa44fce (patch) | |
| tree | 6831028b488c57eaca576fccb5458b16e0e5b9d0 | |
| parent | 519293857a62e0883b82d9333408eedc5eaa8be3 (diff) | |
| parent | c0e6ccb8f06eb23ca3ece6b2d8ed4cf3716a3ff0 (diff) | |
Merge "Don't require root controllers to have associated views"
2 files changed, 15 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/RootNodeController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/RootNodeController.kt index e8124944bcb0..a1800ed12125 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/RootNodeController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/RootNodeController.kt @@ -25,10 +25,10 @@ import com.android.systemui.statusbar.notification.stack.NotificationListContain * we should just modify NLC to implement the NodeController interface. */ class RootNodeController( - private val listContainer: NotificationListContainer + private val listContainer: NotificationListContainer, + override val view: View ) : NodeController { override val nodeLabel: String = "<root>" - override val view: View = listContainer as View override fun getChildAt(index: Int): View? { return listContainer.getContainerChildAt(index) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewManager.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewManager.kt index 118ff4a9fbb7..3c35b7bd8472 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewManager.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewManager.kt @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.notification.collection.render +import android.content.Context +import android.view.View import com.android.systemui.statusbar.notification.collection.GroupEntry import com.android.systemui.statusbar.notification.collection.ListEntry import com.android.systemui.statusbar.notification.collection.NotificationEntry @@ -30,12 +32,15 @@ import javax.inject.Inject * currently populate the notification shade. */ class ShadeViewManager constructor( + context: Context, listContainer: NotificationListContainer, logger: ShadeViewDifferLogger, private val viewBarn: NotifViewBarn, private val notificationIconAreaController: NotificationIconAreaController ) { - private val rootController = RootNodeController(listContainer) + // We pass a shim view here because the listContainer may not actually have a view associated + // with it and the differ never actually cares about the root node's view. + private val rootController = RootNodeController(listContainer, View(context)) private val viewDiffer = ShadeViewDiffer(rootController, logger) fun attach(listBuilder: ShadeListBuilder) { @@ -82,11 +87,17 @@ class ShadeViewManager constructor( } class ShadeViewManagerFactory @Inject constructor( + private val context: Context, private val logger: ShadeViewDifferLogger, private val viewBarn: NotifViewBarn, private val notificationIconAreaController: NotificationIconAreaController ) { fun create(listContainer: NotificationListContainer): ShadeViewManager { - return ShadeViewManager(listContainer, logger, viewBarn, notificationIconAreaController) + return ShadeViewManager( + context, + listContainer, + logger, + viewBarn, + notificationIconAreaController) } } |