Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fde561ed authored by James O'Leary's avatar James O'Leary Committed by Automerger Merge Worker
Browse files

Merge "Media output selector chip color updated per designers" into tm-dev am:...

Merge "Media output selector chip color updated per designers" into tm-dev am: 058f1d9e am: 63e6269c am: 4cff24f2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18164073



Change-Id: I991673e8ded77ded0a9e5cc285d89148a0e72108
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 488aceb6 4cff24f2
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ import android.content.res.ColorStateList
import android.graphics.Color
import android.graphics.drawable.GradientDrawable
import android.graphics.drawable.RippleDrawable
import android.content.res.Configuration
import android.content.res.Configuration.UI_MODE_NIGHT_YES
import com.android.internal.R
import com.android.internal.annotations.VisibleForTesting
import com.android.settingslib.Utils
@@ -124,7 +126,6 @@ class ColorSchemeTransition internal constructor(
        val accentColorList = ColorStateList.valueOf(accentPrimary)
        mediaViewHolder.actionPlayPause.backgroundTintList = accentColorList
        mediaViewHolder.gutsViewHolder.setAccentPrimaryColor(accentPrimary)
        mediaViewHolder.seamlessButton.backgroundTintList = accentColorList
    }

    val accentSecondary = animatingColorTransitionFactory(
@@ -138,6 +139,19 @@ class ColorSchemeTransition internal constructor(
        }
    }

    val colorSeamless = animatingColorTransitionFactory(
        loadDefaultColor(R.attr.textColorPrimary),
        { colorScheme: ColorScheme ->
            // A1-100 dark in dark theme, A1-200 in light theme
            if (context.resources.configuration.uiMode and
                    Configuration.UI_MODE_NIGHT_MASK == UI_MODE_NIGHT_YES)
                        colorScheme.accent1[2]
                        else colorScheme.accent1[3]
        }, { seamlessColor: Int ->
            val accentColorList = ColorStateList.valueOf(seamlessColor)
            mediaViewHolder.seamlessButton.backgroundTintList = accentColorList
    })

    val textPrimary = animatingColorTransitionFactory(
        loadDefaultColor(R.attr.textColorPrimary),
        ::textPrimaryFromScheme
@@ -185,6 +199,7 @@ class ColorSchemeTransition internal constructor(

    val colorTransitions = arrayOf(
        surfaceColor,
        colorSeamless,
        accentPrimary,
        accentSecondary,
        textPrimary,
+1 −1
Original line number Diff line number Diff line
@@ -146,6 +146,6 @@ class ColorSchemeTransitionTest : SysuiTestCase() {
    @Test
    fun testColorSchemeTransition_update() {
        colorSchemeTransition.updateColorScheme(colorScheme, true)
        verify(mockAnimatingTransition, times(9)).updateColorScheme(colorScheme)
        verify(mockAnimatingTransition, times(10)).updateColorScheme(colorScheme)
    }
}