Loading packages/SystemUI/src/com/android/systemui/keyguard/shared/model/KeyguardBlueprint.kt +4 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ interface KeyguardBlueprint { rebuildSections: List<KeyguardSection> = listOf(), bindData: Boolean = true ) { rebuildSections.forEach { it.onRebuildBegin() } val prevSections = previousBlueprint?.sections ?: listOf() val skipSections = sections.intersect(prevSections).subtract(rebuildSections) prevSections.subtract(skipSections).forEach { it.removeViews(constraintLayout) } Loading @@ -49,6 +50,7 @@ interface KeyguardBlueprint { it.bindData(constraintLayout) } } rebuildSections.forEach { it.onRebuildEnd() } } /** Rebuilds views for the target sections, or all of them if unspecified. */ Loading @@ -61,6 +63,7 @@ interface KeyguardBlueprint { return } rebuildSections.forEach { it.onRebuildBegin() } rebuildSections.forEach { it.removeViews(constraintLayout) } rebuildSections.forEach { it.addViews(constraintLayout) Loading @@ -68,6 +71,7 @@ interface KeyguardBlueprint { it.bindData(constraintLayout) } } rebuildSections.forEach { it.onRebuildEnd() } } fun applyConstraints(constraintSet: ConstraintSet) { Loading packages/SystemUI/src/com/android/systemui/keyguard/shared/model/KeyguardSection.kt +6 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,12 @@ abstract class KeyguardSection { /** Removes views and does any data binding destruction. */ abstract fun removeViews(constraintLayout: ConstraintLayout) /* Notifies the section is being rebuilt */ open fun onRebuildBegin() {} /* Notifies the secion that the rebuild is complete */ open fun onRebuildEnd() {} /** * Defines equality as same class. * Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSection.kt +8 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,14 @@ constructor( private var smartspaceVisibilityListener: OnGlobalLayoutListener? = null private var pastVisibility: Int = -1 override fun onRebuildBegin() { smartspaceController.suppressDisconnects = true } override fun onRebuildEnd() { smartspaceController.suppressDisconnects = false } override fun addViews(constraintLayout: ConstraintLayout) { if (!MigrateClocksToBlueprint.isEnabled) return if (!keyguardSmartspaceViewModel.isSmartspaceEnabled) return Loading packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt +7 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,12 @@ constructor( private var managedUserHandle: UserHandle? = null private var mSplitShadeEnabled = false var suppressDisconnects = false set(value) { field = value disconnect() } // TODO(b/202758428): refactor so that we can test color updates via region samping, similar to // how we test color updates when theme changes (See testThemeChangeUpdatesTextColor). Loading Loading @@ -522,6 +528,7 @@ constructor( */ fun disconnect() { if (!smartspaceViews.isEmpty()) return if (suppressDisconnects) return execution.assertIsMainThread() Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/shared/model/KeyguardBlueprint.kt +4 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ interface KeyguardBlueprint { rebuildSections: List<KeyguardSection> = listOf(), bindData: Boolean = true ) { rebuildSections.forEach { it.onRebuildBegin() } val prevSections = previousBlueprint?.sections ?: listOf() val skipSections = sections.intersect(prevSections).subtract(rebuildSections) prevSections.subtract(skipSections).forEach { it.removeViews(constraintLayout) } Loading @@ -49,6 +50,7 @@ interface KeyguardBlueprint { it.bindData(constraintLayout) } } rebuildSections.forEach { it.onRebuildEnd() } } /** Rebuilds views for the target sections, or all of them if unspecified. */ Loading @@ -61,6 +63,7 @@ interface KeyguardBlueprint { return } rebuildSections.forEach { it.onRebuildBegin() } rebuildSections.forEach { it.removeViews(constraintLayout) } rebuildSections.forEach { it.addViews(constraintLayout) Loading @@ -68,6 +71,7 @@ interface KeyguardBlueprint { it.bindData(constraintLayout) } } rebuildSections.forEach { it.onRebuildEnd() } } fun applyConstraints(constraintSet: ConstraintSet) { Loading
packages/SystemUI/src/com/android/systemui/keyguard/shared/model/KeyguardSection.kt +6 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,12 @@ abstract class KeyguardSection { /** Removes views and does any data binding destruction. */ abstract fun removeViews(constraintLayout: ConstraintLayout) /* Notifies the section is being rebuilt */ open fun onRebuildBegin() {} /* Notifies the secion that the rebuild is complete */ open fun onRebuildEnd() {} /** * Defines equality as same class. * Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSection.kt +8 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,14 @@ constructor( private var smartspaceVisibilityListener: OnGlobalLayoutListener? = null private var pastVisibility: Int = -1 override fun onRebuildBegin() { smartspaceController.suppressDisconnects = true } override fun onRebuildEnd() { smartspaceController.suppressDisconnects = false } override fun addViews(constraintLayout: ConstraintLayout) { if (!MigrateClocksToBlueprint.isEnabled) return if (!keyguardSmartspaceViewModel.isSmartspaceEnabled) return Loading
packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt +7 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,12 @@ constructor( private var managedUserHandle: UserHandle? = null private var mSplitShadeEnabled = false var suppressDisconnects = false set(value) { field = value disconnect() } // TODO(b/202758428): refactor so that we can test color updates via region samping, similar to // how we test color updates when theme changes (See testThemeChangeUpdatesTextColor). Loading Loading @@ -522,6 +528,7 @@ constructor( */ fun disconnect() { if (!smartspaceViews.isEmpty()) return if (suppressDisconnects) return execution.assertIsMainThread() Loading