Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardClockViewBinder.kt +1 −9 Original line number Diff line number Diff line Loading @@ -32,8 +32,6 @@ import com.android.systemui.plugins.clocks.ClockController import com.android.systemui.res.R import kotlinx.coroutines.launch private val TAG = KeyguardClockViewBinder::class.simpleName object KeyguardClockViewBinder { @JvmStatic fun bind( Loading Loading @@ -74,12 +72,6 @@ object KeyguardClockViewBinder { applyConstraints(clockSection, keyguardRootView, true) } } launch { if (!migrateClocksToBlueprint()) return@launch viewModel.hasCustomWeatherDataDisplay.collect { applyConstraints(clockSection, keyguardRootView, true) } } } } } Loading Loading @@ -132,7 +124,7 @@ object KeyguardClockViewBinder { fun applyConstraints( clockSection: ClockSection, rootView: ConstraintLayout, animated: Boolean animated: Boolean, ) { val constraintSet = ConstraintSet().apply { clone(rootView) } clockSection.applyConstraints(constraintSet) Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt +58 −4 Original line number Diff line number Diff line Loading @@ -16,13 +16,19 @@ package com.android.systemui.keyguard.ui.binder import android.transition.TransitionManager import android.view.View import androidx.constraintlayout.helper.widget.Layer import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.android.systemui.keyguard.ui.view.layout.sections.SmartspaceSection import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.res.R import kotlinx.coroutines.launch object KeyguardSmartspaceViewBinder { @JvmStatic Loading @@ -30,15 +36,63 @@ object KeyguardSmartspaceViewBinder { smartspaceSection: SmartspaceSection, keyguardRootView: ConstraintLayout, clockViewModel: KeyguardClockViewModel, smartspaceViewModel: KeyguardSmartspaceViewModel, ) { keyguardRootView.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.STARTED) { clockViewModel.hasCustomWeatherDataDisplay.collect { launch { clockViewModel.hasCustomWeatherDataDisplay.collect { hasCustomWeatherDataDisplay -> if (hasCustomWeatherDataDisplay) { removeDateWeatherToBurnInLayer(keyguardRootView, smartspaceViewModel) } else { addDateWeatherToBurnInLayer(keyguardRootView, smartspaceViewModel) } clockViewModel.burnInLayer?.updatePostLayout(keyguardRootView) val constraintSet = ConstraintSet().apply { clone(keyguardRootView) } smartspaceSection.applyConstraints(constraintSet) TransitionManager.beginDelayedTransition(keyguardRootView) constraintSet.applyTo(keyguardRootView) } } } } } private fun addDateWeatherToBurnInLayer( constraintLayout: ConstraintLayout, smartspaceViewModel: KeyguardSmartspaceViewModel ) { val burnInLayer = constraintLayout.requireViewById<Layer>(R.id.burn_in_layer) burnInLayer.apply { if ( smartspaceViewModel.isSmartspaceEnabled && smartspaceViewModel.isDateWeatherDecoupled ) { val dateView = constraintLayout.requireViewById<View>(smartspaceViewModel.dateId) val weatherView = constraintLayout.requireViewById<View>(smartspaceViewModel.weatherId) addView(weatherView) addView(dateView) } } } private fun removeDateWeatherToBurnInLayer( constraintLayout: ConstraintLayout, smartspaceViewModel: KeyguardSmartspaceViewModel ) { val burnInLayer = constraintLayout.requireViewById<Layer>(R.id.burn_in_layer) burnInLayer.apply { if ( smartspaceViewModel.isSmartspaceEnabled && smartspaceViewModel.isDateWeatherDecoupled ) { val dateView = smartspaceViewModel.dateView val weatherView = smartspaceViewModel.weatherView removeView(weatherView) removeView(dateView) } } } } packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/blueprints/SplitShadeKeyguardBlueprint.kt +6 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ import com.android.systemui.keyguard.ui.view.layout.sections.DefaultShortcutsSec import com.android.systemui.keyguard.ui.view.layout.sections.DefaultStatusBarSection import com.android.systemui.keyguard.ui.view.layout.sections.DefaultStatusViewSection import com.android.systemui.keyguard.ui.view.layout.sections.KeyguardSectionsModule import com.android.systemui.keyguard.ui.view.layout.sections.SmartspaceSection import com.android.systemui.keyguard.ui.view.layout.sections.SplitShadeClockSection import com.android.systemui.keyguard.ui.view.layout.sections.SplitShadeGuidelines import com.android.systemui.keyguard.ui.view.layout.sections.SplitShadeNotificationStackScrollLayoutSection import com.android.systemui.util.kotlin.getOrNull Loading Loading @@ -59,6 +61,8 @@ constructor( aodNotificationIconsSection: AodNotificationIconsSection, aodBurnInSection: AodBurnInSection, communalTutorialIndicatorSection: CommunalTutorialIndicatorSection, smartspaceSection: SmartspaceSection, clockSection: SplitShadeClockSection, ) : KeyguardBlueprint { override val id: String = ID Loading @@ -73,8 +77,10 @@ constructor( splitShadeNotificationStackScrollLayoutSection, splitShadeGuidelines, aodNotificationIconsSection, smartspaceSection, aodBurnInSection, communalTutorialIndicatorSection, clockSection, defaultDeviceEntrySection, // Add LAST: Intentionally has z-order above other views. ) Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodBurnInSection.kt +2 −10 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import androidx.constraintlayout.helper.widget.Layer import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import com.android.systemui.Flags.migrateClocksToBlueprint import com.android.systemui.flags.FeatureFlagsClassic import com.android.systemui.keyguard.shared.KeyguardShadeMigrationNssl import com.android.systemui.keyguard.shared.model.KeyguardSection import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel Loading @@ -38,7 +37,6 @@ constructor( private val context: Context, private val clockViewModel: KeyguardClockViewModel, private val smartspaceViewModel: KeyguardSmartspaceViewModel, private val featureFlags: FeatureFlagsClassic, ) : KeyguardSection() { lateinit var burnInLayer: Layer Loading @@ -59,6 +57,8 @@ constructor( } } if (migrateClocksToBlueprint()) { // weather and date parts won't be added here, cause their visibility doesn't align // with others in burnInLayer addSmartspaceViews(constraintLayout) } constraintLayout.addView(burnInLayer) Loading Loading @@ -89,14 +89,6 @@ constructor( val smartspaceView = constraintLayout.requireViewById<View>(smartspaceViewModel.smartspaceViewId) addView(smartspaceView) if (smartspaceViewModel.isDateWeatherDecoupled) { val dateView = constraintLayout.requireViewById<View>(smartspaceViewModel.dateId) val weatherView = constraintLayout.requireViewById<View>(smartspaceViewModel.weatherId) addView(weatherView) addView(dateView) } } } } Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt +2 −10 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import androidx.constraintlayout.widget.ConstraintSet.START import androidx.constraintlayout.widget.ConstraintSet.TOP import com.android.systemui.Flags.migrateClocksToBlueprint import com.android.systemui.common.ui.ConfigurationState import com.android.systemui.flags.FeatureFlagsClassic import com.android.systemui.keyguard.shared.KeyguardShadeMigrationNssl import com.android.systemui.keyguard.shared.model.KeyguardSection import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel Loading @@ -49,7 +48,6 @@ class AodNotificationIconsSection constructor( private val context: Context, private val configurationState: ConfigurationState, private val featureFlags: FeatureFlagsClassic, private val iconBindingFailureTracker: StatusBarIconViewBindingFailureTracker, private val nicAodViewModel: NotificationIconContainerAlwaysOnDisplayViewModel, private val nicAodIconViewStore: AlwaysOnDisplayNotificationIconViewStore, Loading Loading @@ -119,14 +117,8 @@ constructor( } constraintSet.apply { if (migrateClocksToBlueprint()) { connect( nicId, TOP, smartspaceViewModel.smartspaceViewId, topAlignment, bottomMargin ) setGoneMargin(nicId, topAlignment, bottomMargin) connect(nicId, TOP, smartspaceViewModel.smartspaceViewId, BOTTOM, bottomMargin) setGoneMargin(nicId, BOTTOM, bottomMargin) } else { connect(nicId, TOP, R.id.keyguard_status_view, topAlignment, bottomMargin) } Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardClockViewBinder.kt +1 −9 Original line number Diff line number Diff line Loading @@ -32,8 +32,6 @@ import com.android.systemui.plugins.clocks.ClockController import com.android.systemui.res.R import kotlinx.coroutines.launch private val TAG = KeyguardClockViewBinder::class.simpleName object KeyguardClockViewBinder { @JvmStatic fun bind( Loading Loading @@ -74,12 +72,6 @@ object KeyguardClockViewBinder { applyConstraints(clockSection, keyguardRootView, true) } } launch { if (!migrateClocksToBlueprint()) return@launch viewModel.hasCustomWeatherDataDisplay.collect { applyConstraints(clockSection, keyguardRootView, true) } } } } } Loading Loading @@ -132,7 +124,7 @@ object KeyguardClockViewBinder { fun applyConstraints( clockSection: ClockSection, rootView: ConstraintLayout, animated: Boolean animated: Boolean, ) { val constraintSet = ConstraintSet().apply { clone(rootView) } clockSection.applyConstraints(constraintSet) Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt +58 −4 Original line number Diff line number Diff line Loading @@ -16,13 +16,19 @@ package com.android.systemui.keyguard.ui.binder import android.transition.TransitionManager import android.view.View import androidx.constraintlayout.helper.widget.Layer import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.android.systemui.keyguard.ui.view.layout.sections.SmartspaceSection import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.res.R import kotlinx.coroutines.launch object KeyguardSmartspaceViewBinder { @JvmStatic Loading @@ -30,15 +36,63 @@ object KeyguardSmartspaceViewBinder { smartspaceSection: SmartspaceSection, keyguardRootView: ConstraintLayout, clockViewModel: KeyguardClockViewModel, smartspaceViewModel: KeyguardSmartspaceViewModel, ) { keyguardRootView.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.STARTED) { clockViewModel.hasCustomWeatherDataDisplay.collect { launch { clockViewModel.hasCustomWeatherDataDisplay.collect { hasCustomWeatherDataDisplay -> if (hasCustomWeatherDataDisplay) { removeDateWeatherToBurnInLayer(keyguardRootView, smartspaceViewModel) } else { addDateWeatherToBurnInLayer(keyguardRootView, smartspaceViewModel) } clockViewModel.burnInLayer?.updatePostLayout(keyguardRootView) val constraintSet = ConstraintSet().apply { clone(keyguardRootView) } smartspaceSection.applyConstraints(constraintSet) TransitionManager.beginDelayedTransition(keyguardRootView) constraintSet.applyTo(keyguardRootView) } } } } } private fun addDateWeatherToBurnInLayer( constraintLayout: ConstraintLayout, smartspaceViewModel: KeyguardSmartspaceViewModel ) { val burnInLayer = constraintLayout.requireViewById<Layer>(R.id.burn_in_layer) burnInLayer.apply { if ( smartspaceViewModel.isSmartspaceEnabled && smartspaceViewModel.isDateWeatherDecoupled ) { val dateView = constraintLayout.requireViewById<View>(smartspaceViewModel.dateId) val weatherView = constraintLayout.requireViewById<View>(smartspaceViewModel.weatherId) addView(weatherView) addView(dateView) } } } private fun removeDateWeatherToBurnInLayer( constraintLayout: ConstraintLayout, smartspaceViewModel: KeyguardSmartspaceViewModel ) { val burnInLayer = constraintLayout.requireViewById<Layer>(R.id.burn_in_layer) burnInLayer.apply { if ( smartspaceViewModel.isSmartspaceEnabled && smartspaceViewModel.isDateWeatherDecoupled ) { val dateView = smartspaceViewModel.dateView val weatherView = smartspaceViewModel.weatherView removeView(weatherView) removeView(dateView) } } } }
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/blueprints/SplitShadeKeyguardBlueprint.kt +6 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ import com.android.systemui.keyguard.ui.view.layout.sections.DefaultShortcutsSec import com.android.systemui.keyguard.ui.view.layout.sections.DefaultStatusBarSection import com.android.systemui.keyguard.ui.view.layout.sections.DefaultStatusViewSection import com.android.systemui.keyguard.ui.view.layout.sections.KeyguardSectionsModule import com.android.systemui.keyguard.ui.view.layout.sections.SmartspaceSection import com.android.systemui.keyguard.ui.view.layout.sections.SplitShadeClockSection import com.android.systemui.keyguard.ui.view.layout.sections.SplitShadeGuidelines import com.android.systemui.keyguard.ui.view.layout.sections.SplitShadeNotificationStackScrollLayoutSection import com.android.systemui.util.kotlin.getOrNull Loading Loading @@ -59,6 +61,8 @@ constructor( aodNotificationIconsSection: AodNotificationIconsSection, aodBurnInSection: AodBurnInSection, communalTutorialIndicatorSection: CommunalTutorialIndicatorSection, smartspaceSection: SmartspaceSection, clockSection: SplitShadeClockSection, ) : KeyguardBlueprint { override val id: String = ID Loading @@ -73,8 +77,10 @@ constructor( splitShadeNotificationStackScrollLayoutSection, splitShadeGuidelines, aodNotificationIconsSection, smartspaceSection, aodBurnInSection, communalTutorialIndicatorSection, clockSection, defaultDeviceEntrySection, // Add LAST: Intentionally has z-order above other views. ) Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodBurnInSection.kt +2 −10 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import androidx.constraintlayout.helper.widget.Layer import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import com.android.systemui.Flags.migrateClocksToBlueprint import com.android.systemui.flags.FeatureFlagsClassic import com.android.systemui.keyguard.shared.KeyguardShadeMigrationNssl import com.android.systemui.keyguard.shared.model.KeyguardSection import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel Loading @@ -38,7 +37,6 @@ constructor( private val context: Context, private val clockViewModel: KeyguardClockViewModel, private val smartspaceViewModel: KeyguardSmartspaceViewModel, private val featureFlags: FeatureFlagsClassic, ) : KeyguardSection() { lateinit var burnInLayer: Layer Loading @@ -59,6 +57,8 @@ constructor( } } if (migrateClocksToBlueprint()) { // weather and date parts won't be added here, cause their visibility doesn't align // with others in burnInLayer addSmartspaceViews(constraintLayout) } constraintLayout.addView(burnInLayer) Loading Loading @@ -89,14 +89,6 @@ constructor( val smartspaceView = constraintLayout.requireViewById<View>(smartspaceViewModel.smartspaceViewId) addView(smartspaceView) if (smartspaceViewModel.isDateWeatherDecoupled) { val dateView = constraintLayout.requireViewById<View>(smartspaceViewModel.dateId) val weatherView = constraintLayout.requireViewById<View>(smartspaceViewModel.weatherId) addView(weatherView) addView(dateView) } } } } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/AodNotificationIconsSection.kt +2 −10 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import androidx.constraintlayout.widget.ConstraintSet.START import androidx.constraintlayout.widget.ConstraintSet.TOP import com.android.systemui.Flags.migrateClocksToBlueprint import com.android.systemui.common.ui.ConfigurationState import com.android.systemui.flags.FeatureFlagsClassic import com.android.systemui.keyguard.shared.KeyguardShadeMigrationNssl import com.android.systemui.keyguard.shared.model.KeyguardSection import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel Loading @@ -49,7 +48,6 @@ class AodNotificationIconsSection constructor( private val context: Context, private val configurationState: ConfigurationState, private val featureFlags: FeatureFlagsClassic, private val iconBindingFailureTracker: StatusBarIconViewBindingFailureTracker, private val nicAodViewModel: NotificationIconContainerAlwaysOnDisplayViewModel, private val nicAodIconViewStore: AlwaysOnDisplayNotificationIconViewStore, Loading Loading @@ -119,14 +117,8 @@ constructor( } constraintSet.apply { if (migrateClocksToBlueprint()) { connect( nicId, TOP, smartspaceViewModel.smartspaceViewId, topAlignment, bottomMargin ) setGoneMargin(nicId, topAlignment, bottomMargin) connect(nicId, TOP, smartspaceViewModel.smartspaceViewId, BOTTOM, bottomMargin) setGoneMargin(nicId, BOTTOM, bottomMargin) } else { connect(nicId, TOP, R.id.keyguard_status_view, topAlignment, bottomMargin) } Loading