Merge "Media output selector chip color updated per designers" into tm-dev am: 058f1d9eb1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18164073 Change-Id: If11c8753f969ac5c40f157058911f7318b9af187 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -24,6 +24,8 @@ import android.content.res.ColorStateList
|
|||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.drawable.GradientDrawable
|
import android.graphics.drawable.GradientDrawable
|
||||||
import android.graphics.drawable.RippleDrawable
|
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.R
|
||||||
import com.android.internal.annotations.VisibleForTesting
|
import com.android.internal.annotations.VisibleForTesting
|
||||||
import com.android.settingslib.Utils
|
import com.android.settingslib.Utils
|
||||||
@@ -124,7 +126,6 @@ class ColorSchemeTransition internal constructor(
|
|||||||
val accentColorList = ColorStateList.valueOf(accentPrimary)
|
val accentColorList = ColorStateList.valueOf(accentPrimary)
|
||||||
mediaViewHolder.actionPlayPause.backgroundTintList = accentColorList
|
mediaViewHolder.actionPlayPause.backgroundTintList = accentColorList
|
||||||
mediaViewHolder.gutsViewHolder.setAccentPrimaryColor(accentPrimary)
|
mediaViewHolder.gutsViewHolder.setAccentPrimaryColor(accentPrimary)
|
||||||
mediaViewHolder.seamlessButton.backgroundTintList = accentColorList
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val accentSecondary = animatingColorTransitionFactory(
|
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(
|
val textPrimary = animatingColorTransitionFactory(
|
||||||
loadDefaultColor(R.attr.textColorPrimary),
|
loadDefaultColor(R.attr.textColorPrimary),
|
||||||
::textPrimaryFromScheme
|
::textPrimaryFromScheme
|
||||||
@@ -185,6 +199,7 @@ class ColorSchemeTransition internal constructor(
|
|||||||
|
|
||||||
val colorTransitions = arrayOf(
|
val colorTransitions = arrayOf(
|
||||||
surfaceColor,
|
surfaceColor,
|
||||||
|
colorSeamless,
|
||||||
accentPrimary,
|
accentPrimary,
|
||||||
accentSecondary,
|
accentSecondary,
|
||||||
textPrimary,
|
textPrimary,
|
||||||
|
|||||||
@@ -146,6 +146,6 @@ class ColorSchemeTransitionTest : SysuiTestCase() {
|
|||||||
@Test
|
@Test
|
||||||
fun testColorSchemeTransition_update() {
|
fun testColorSchemeTransition_update() {
|
||||||
colorSchemeTransition.updateColorScheme(colorScheme, true)
|
colorSchemeTransition.updateColorScheme(colorScheme, true)
|
||||||
verify(mockAnimatingTransition, times(9)).updateColorScheme(colorScheme)
|
verify(mockAnimatingTransition, times(10)).updateColorScheme(colorScheme)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user