summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sherry Zhou <yuandizhou@google.com> 2024-04-12 05:42:39 +0000
committer Sherry Zhou <yuandizhou@google.com> 2024-04-12 17:19:34 +0000
commit7a2c59df4df547eb43f7634b068ca04e7ff5c82d (patch)
tree6f472db1b1828b6f100ae841b9871a9a9ad71652
parentd588b98d43fa78f0f20606b1c054bcb0947190f4 (diff)
Fix smartspace disappearing when changing from small to large weather clock and the switching to other clock
The reason is that we changed alpha in ClockSizeTransition but not change it back in SmartspaceVisibilityTransition Bug: 327461585 Test: manual Flag: ACONFIG com.android.systemui.migrate_clocks_to_blueprint STAGING Change-Id: I53230827f108e420b32de357b35bdb4de73e4a7c
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt11
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSection.kt15
2 files changed, 19 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt
index b5d61773d9af..6b8e896c937d 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt
@@ -38,6 +38,7 @@ 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 com.android.systemui.shared.R as sharedR
import javax.inject.Inject
import kotlin.math.max
@@ -217,15 +218,21 @@ constructor(
if (!DEBUG || currentClock == null) return
val smallClockViewId = R.id.lockscreen_clock_view
val largeClockViewId = currentClock.largeClock.layout.views[0].id
+ val smartspaceDateId = sharedR.id.date_smartspace_view
Log.i(
TAG,
"applyCsToSmallClock: vis=${cs.getVisibility(smallClockViewId)} " +
- "alpha=${cs.getConstraint(smallClockViewId).propertySet}"
+ "alpha=${cs.getConstraint(smallClockViewId).propertySet.alpha}"
)
Log.i(
TAG,
"applyCsToLargeClock: vis=${cs.getVisibility(largeClockViewId)} " +
- "alpha=${cs.getConstraint(largeClockViewId).propertySet}"
+ "alpha=${cs.getConstraint(largeClockViewId).propertySet.alpha}"
+ )
+ Log.i(
+ TAG,
+ "applyCsToSmartspaceDate: vis=${cs.getVisibility(smartspaceDateId)} " +
+ "alpha=${cs.getConstraint(smartspaceDateId).propertySet.alpha}"
)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSection.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSection.kt
index eaa5e3367f49..9ec7a65cf240 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSection.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSection.kt
@@ -18,7 +18,6 @@ package com.android.systemui.keyguard.ui.view.layout.sections
import android.content.Context
import android.view.View
-import android.view.View.GONE
import android.view.ViewTreeObserver.OnGlobalLayoutListener
import androidx.constraintlayout.widget.Barrier
import androidx.constraintlayout.widget.ConstraintLayout
@@ -205,8 +204,7 @@ constructor(
smartspaceController.requestSmartspaceUpdate()
constraintSet.apply {
- setVisibility(
- sharedR.id.weather_smartspace_view,
+ val weatherVisibility =
when (keyguardClockViewModel.hasCustomWeatherDataDisplay.value) {
true -> ConstraintSet.GONE
false ->
@@ -215,11 +213,18 @@ constructor(
false -> ConstraintSet.GONE
}
}
+ setVisibility(sharedR.id.weather_smartspace_view, weatherVisibility)
+ setAlpha(
+ sharedR.id.weather_smartspace_view,
+ if (weatherVisibility == ConstraintSet.VISIBLE) 1f else 0f
)
- setVisibility(
- sharedR.id.date_smartspace_view,
+ 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
)
}
}