Make ripple more visible on top field

This commit is contained in:
Ensar Sarajčić 2023-09-14 12:19:05 +02:00
parent 4c5a355431
commit 3b5a5b31f8
1 changed files with 6 additions and 1 deletions

View File

@ -84,7 +84,12 @@ class ConverterView @JvmOverloads constructor(
) )
} }
binding.topUnitHolder.backgroundTintList = ColorStateList.valueOf(context.getProperPrimaryColor().lightenColor().adjustAlpha(LOWER_ALPHA)) val rippleDrawable = ResourcesCompat.getDrawable(
resources, R.drawable.colored_ripple, context.theme
)?.constantState?.newDrawable()?.mutate() as RippleDrawable
val rippleColoredLayer = rippleDrawable.findDrawableByLayerId(R.id.colored_background) as GradientDrawable
rippleColoredLayer.applyColorFilter(context.getProperPrimaryColor().lightenColor().adjustAlpha(LOWER_ALPHA))
binding.topUnitHolder.background = rippleDrawable
binding.swapButton?.applyColorFilter(context.getProperPrimaryColor()) binding.swapButton?.applyColorFilter(context.getProperPrimaryColor())
listOf(binding.topUnitSymbol, binding.bottomUnitSymbol).forEach { listOf(binding.topUnitSymbol, binding.bottomUnitSymbol).forEach {