Merge "Media output selector chip color updated per designers" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
058f1d9eb1
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user