Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d389c0f3 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "Recalculate max notifs on media change" into main

parents bae19a90 03f9b7bf
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -75,6 +75,24 @@ object SharedNotificationContainerBinder {
                }
            }

        // Required to capture keyguard media changes and ensure the notification count is correct
        val layoutChangeListener =
            object : View.OnLayoutChangeListener {
                override fun onLayoutChange(
                    view: View,
                    left: Int,
                    top: Int,
                    right: Int,
                    bottom: Int,
                    oldLeft: Int,
                    oldTop: Int,
                    oldRight: Int,
                    oldBottom: Int
                ) {
                    viewModel.notificationStackChanged()
                }
            }

        val burnInParams = MutableStateFlow(BurnInParameters())
        val viewState =
            ViewStateAccessor(
@@ -170,6 +188,7 @@ object SharedNotificationContainerBinder {
            }
            insets
        }
        view.addOnLayoutChangeListener(layoutChangeListener)

        return object : DisposableHandle {
            override fun dispose() {
@@ -177,6 +196,7 @@ object SharedNotificationContainerBinder {
                disposableHandleMainImmediate.dispose()
                controller.setOnHeightChangedRunnable(null)
                view.setOnApplyWindowInsetsListener(null)
                view.removeOnLayoutChangeListener(layoutChangeListener)
            }
        }
    }