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

Commit 2f7e2ab2 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[RONs] Setup AOD Skeleton View when added

AOD Skeleton View remains visible on the screen since view is initialized sometime after VM state is bound. This CL sets the last View State for AOD Skeleton View visibility when it is added to View Tree.

Fixes: 419762883
Flag: android.app.ui_rich_ongoing
Test: Post a RON when AOD is not enabled. Check the lockscreen. Check before/after Screenshots
Change-Id: I83602d86d3b310f2c1ae1ee12326c8010840f6ee
parent 0691294b
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -379,12 +379,25 @@ object KeyguardRootViewBinder {
                )
            )

        // Ensure the view reflects the final state after items are added.
        fun onViewAdded(id: Int, view: View) {
            when (id) {
                aodPromotedNotificationId ->
                    view.setAodPromotedNotifIsVisible(viewModel.isAodPromotedNotifVisible.value)
                aodNotificationIconContainerId ->
                    view.setAodNotifIconContainerIsVisible(
                        viewModel.isNotifIconContainerVisible.value
                    )
            }
        }

        // Views will be added or removed after the call to bind(). This is needed to avoid many
        // calls to findViewById
        view.setOnHierarchyChangeListener(
            object : OnHierarchyChangeListener {
                override fun onChildViewAdded(parent: View, child: View) {
                    childViews.put(child.id, child)
                    onViewAdded(child.id, child)
                }

                override fun onChildViewRemoved(parent: View, child: View) {