Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt +18 −13 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.res.R import com.android.systemui.shared.R as sharedR import kotlinx.coroutines.DisposableHandle import kotlinx.coroutines.flow.combine object KeyguardSmartspaceViewBinder { @JvmStatic Loading @@ -43,8 +44,12 @@ object KeyguardSmartspaceViewBinder { return keyguardRootView.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.CREATED) { launch("$TAG#clockViewModel.hasCustomWeatherDataDisplay") { clockViewModel.hasCustomWeatherDataDisplay.collect { hasCustomWeatherDataDisplay -> combine( smartspaceViewModel.isWeatherVisible, clockViewModel.hasCustomWeatherDataDisplay, ::Pair, ) .collect { updateDateWeatherToBurnInLayer( keyguardRootView, clockViewModel, Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSection.kt +9 −18 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ import android.view.ViewTreeObserver.OnGlobalLayoutListener import androidx.constraintlayout.widget.Barrier import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import androidx.constraintlayout.widget.ConstraintSet.GONE import androidx.constraintlayout.widget.ConstraintSet.VISIBLE import com.android.systemui.customization.R as customR import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.KeyguardUnlockAnimationController Loading Loading @@ -195,24 +197,13 @@ constructor( smartspaceController.requestSmartspaceUpdate() constraintSet.apply { val weatherVisibility = when (keyguardSmartspaceViewModel.isWeatherVisible.value) { true -> ConstraintSet.VISIBLE false -> ConstraintSet.GONE } setVisibility(sharedR.id.weather_smartspace_view, weatherVisibility) setAlpha( sharedR.id.weather_smartspace_view, if (weatherVisibility == View.VISIBLE) 1f else 0f, ) val dateVisibility = if (keyguardClockViewModel.hasCustomWeatherDataDisplay.value) ConstraintSet.GONE else ConstraintSet.VISIBLE setVisibility(sharedR.id.date_smartspace_view, dateVisibility) setAlpha( sharedR.id.date_smartspace_view, if (dateVisibility == ConstraintSet.VISIBLE) 1f else 0f, ) val showWeather = keyguardSmartspaceViewModel.isWeatherVisible.value setVisibility(sharedR.id.weather_smartspace_view, if (showWeather) VISIBLE else GONE) setAlpha(sharedR.id.weather_smartspace_view, if (showWeather) 1f else 0f) val showDateView = !keyguardClockViewModel.hasCustomWeatherDataDisplay.value setVisibility(sharedR.id.date_smartspace_view, if (showDateView) VISIBLE else GONE) setAlpha(sharedR.id.date_smartspace_view, if (showDateView) 1f else 0f) } } } packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardSmartspaceViewModel.kt +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ constructor( isWeatherVisible( clockIncludesCustomWeatherDisplay = keyguardClockViewModel.hasCustomWeatherDataDisplay.value, isWeatherEnabled = smartspaceInteractor.isWeatherEnabled.value, isWeatherEnabled = isWeatherEnabled.value, ), ) Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt +18 −13 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.res.R import com.android.systemui.shared.R as sharedR import kotlinx.coroutines.DisposableHandle import kotlinx.coroutines.flow.combine object KeyguardSmartspaceViewBinder { @JvmStatic Loading @@ -43,8 +44,12 @@ object KeyguardSmartspaceViewBinder { return keyguardRootView.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.CREATED) { launch("$TAG#clockViewModel.hasCustomWeatherDataDisplay") { clockViewModel.hasCustomWeatherDataDisplay.collect { hasCustomWeatherDataDisplay -> combine( smartspaceViewModel.isWeatherVisible, clockViewModel.hasCustomWeatherDataDisplay, ::Pair, ) .collect { updateDateWeatherToBurnInLayer( keyguardRootView, clockViewModel, Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSection.kt +9 −18 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ import android.view.ViewTreeObserver.OnGlobalLayoutListener import androidx.constraintlayout.widget.Barrier import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import androidx.constraintlayout.widget.ConstraintSet.GONE import androidx.constraintlayout.widget.ConstraintSet.VISIBLE import com.android.systemui.customization.R as customR import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.KeyguardUnlockAnimationController Loading Loading @@ -195,24 +197,13 @@ constructor( smartspaceController.requestSmartspaceUpdate() constraintSet.apply { val weatherVisibility = when (keyguardSmartspaceViewModel.isWeatherVisible.value) { true -> ConstraintSet.VISIBLE false -> ConstraintSet.GONE } setVisibility(sharedR.id.weather_smartspace_view, weatherVisibility) setAlpha( sharedR.id.weather_smartspace_view, if (weatherVisibility == View.VISIBLE) 1f else 0f, ) val dateVisibility = if (keyguardClockViewModel.hasCustomWeatherDataDisplay.value) ConstraintSet.GONE else ConstraintSet.VISIBLE setVisibility(sharedR.id.date_smartspace_view, dateVisibility) setAlpha( sharedR.id.date_smartspace_view, if (dateVisibility == ConstraintSet.VISIBLE) 1f else 0f, ) val showWeather = keyguardSmartspaceViewModel.isWeatherVisible.value setVisibility(sharedR.id.weather_smartspace_view, if (showWeather) VISIBLE else GONE) setAlpha(sharedR.id.weather_smartspace_view, if (showWeather) 1f else 0f) val showDateView = !keyguardClockViewModel.hasCustomWeatherDataDisplay.value setVisibility(sharedR.id.date_smartspace_view, if (showDateView) VISIBLE else GONE) setAlpha(sharedR.id.date_smartspace_view, if (showDateView) 1f else 0f) } } }
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardSmartspaceViewModel.kt +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ constructor( isWeatherVisible( clockIncludesCustomWeatherDisplay = keyguardClockViewModel.hasCustomWeatherDataDisplay.value, isWeatherEnabled = smartspaceInteractor.isWeatherEnabled.value, isWeatherEnabled = isWeatherEnabled.value, ), ) Loading