ursus
05/24/2024, 3:12 PMprivate object MaterialRippleTheme : RippleTheme {
@Composable
override fun defaultColor() = RippleTheme.defaultRippleColor(
contentColor = LocalContentColor.current,
lightTheme = MaterialTheme.colors.isLight
)
I see default ripples pick up content color via the LocalContentColor
composition local.
I'd like to have my system pickup background color.
Is there a comp. local for that, or do I need to roll in my own?Alex Styl
05/24/2024, 3:22 PMMaterialTheme.colors.surface
. The Surface
composable uses the surface color and doesn't have any sort of background color.
AFAIK it is backed up by some sort of composition local (that's how material theme works under the hood)
what are you trying to achieve?ursus
05/24/2024, 3:24 PMAlex Styl
05/24/2024, 3:39 PMLouis Pullen-Freilich [G]
05/24/2024, 4:54 PMJust the ripple over it, conditionally on surface color (edited)FWIW this is basically what content color is, surfaces provide content color based on background color, but the calculation lives at the surface level, rather than providing background color and then calculating this later. But it’s still ‘derived’ from background color
ursus
05/24/2024, 5:07 PMLouis Pullen-Freilich [G]
05/24/2024, 5:11 PMcontentColorFor
Louis Pullen-Freilich [G]
05/24/2024, 5:12 PMursus
05/24/2024, 5:14 PMLouis Pullen-Freilich [G]
05/24/2024, 5:18 PMLouis Pullen-Freilich [G]
05/24/2024, 5:20 PMursus
05/24/2024, 5:31 PMMySurface
?Louis Pullen-Freilich [G]
05/24/2024, 5:31 PMursus
05/24/2024, 5:36 PMSurface
wont workursus
05/24/2024, 5:36 PMLouis Pullen-Freilich [G]
05/24/2024, 5:37 PMLouis Pullen-Freilich [G]
05/24/2024, 5:41 PMursus
05/24/2024, 9:39 PMLocalRippleTheme
is deprecated?Louis Pullen-Freilich [G]
05/24/2024, 10:11 PMLouis Pullen-Freilich [G]
05/24/2024, 10:12 PMursus
05/25/2024, 10:11 AMursus
05/25/2024, 10:12 AMLouis Pullen-Freilich [G]
05/25/2024, 12:16 PMLouis Pullen-Freilich [G]
05/25/2024, 12:17 PMursus
05/25/2024, 1:30 PMLocalContentColor
there?Louis Pullen-Freilich [G]
05/25/2024, 1:39 PM