summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/RootNodeController.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewManager.kt15
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)
}
}