summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mike Schneider <michschn@google.com> 2022-07-08 08:06:59 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-07-08 08:06:59 +0000
commit27f17d4c39fa8e69e16aa346bdd1dfd25435e9aa (patch)
tree1db4bc90a93761759ea08e173a3c5863a8424774
parent7736d6823238c8d35687d16380752a347902f7f1 (diff)
parent05b13683b1c26245ad577aafca969f0ddd07abd2 (diff)
Merge "On lockscreen to quick-settings transition, media-player should fade in to quick settings instead of just appear." into tm-qpr-dev am: cb1af1ca55 am: 05b13683b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19200788 Change-Id: Ie291a4bb3f60c83ff251a60047fbca7486179d4b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt15
1 files changed, 3 insertions, 12 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt b/packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt
index 2f732de50ea1..458ed4059b3b 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt
@@ -144,8 +144,7 @@ class MediaHierarchyManager @Inject constructor(
animatedFraction)
// When crossfading, let's keep the bounds at the right location during fading
boundsProgress = if (animationCrossFadeProgress < 0.5f) 0.0f else 1.0f
- currentAlpha = calculateAlphaFromCrossFade(animationCrossFadeProgress,
- instantlyShowAtEnd = false)
+ currentAlpha = calculateAlphaFromCrossFade(animationCrossFadeProgress)
} else {
// If we're not crossfading, let's interpolate from the start alpha to 1.0f
currentAlpha = MathUtils.lerp(animationStartAlpha, 1.0f, animatedFraction)
@@ -276,7 +275,7 @@ class MediaHierarchyManager @Inject constructor(
if (value >= 0) {
updateTargetState()
// Setting the alpha directly, as the below call will use it to update the alpha
- carouselAlpha = calculateAlphaFromCrossFade(field, instantlyShowAtEnd = true)
+ carouselAlpha = calculateAlphaFromCrossFade(field)
applyTargetStateIfNotAnimating()
}
}
@@ -414,18 +413,10 @@ class MediaHierarchyManager @Inject constructor(
* @param crossFadeProgress The current cross fade progress. 0.5f means it's just switching
* between the start and the end location and the content is fully faded, while 0.75f means
* that we're halfway faded in again in the target state.
- *
- * @param instantlyShowAtEnd should the view be instantly shown at the end. This is needed
- * to avoid fadinging in when the target was hidden anyway.
*/
- private fun calculateAlphaFromCrossFade(
- crossFadeProgress: Float,
- instantlyShowAtEnd: Boolean
- ): Float {
+ private fun calculateAlphaFromCrossFade(crossFadeProgress: Float): Float {
if (crossFadeProgress <= 0.5f) {
return 1.0f - crossFadeProgress / 0.5f
- } else if (instantlyShowAtEnd) {
- return 1.0f
} else {
return (crossFadeProgress - 0.5f) / 0.5f
}