Skip to content

Commit

Permalink
Increase ripple contrast
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Mar 7, 2024
1 parent 7c6c854 commit c805f4f
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package net.mullvad.mullvadvpn.lib.theme

import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.material.ripple.RippleAlpha
import androidx.compose.material.ripple.RippleTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Shapes
import androidx.compose.material3.Typography
import androidx.compose.material3.darkColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.remember
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -117,7 +121,24 @@ fun AppTheme(content: @Composable () -> Unit) {
colorScheme = colors,
shapes = Shapes,
typography = typography,
content = content
content = {
CompositionLocalProvider(LocalRippleTheme provides MullvadRippleTheme) { content() }
}
)
}
}

@Immutable
object MullvadRippleTheme : RippleTheme {
@Composable
override fun defaultColor() = RippleTheme.defaultRippleColor(Color.Black, lightTheme = false)

@Composable
override fun rippleAlpha(): RippleAlpha =
RippleAlpha(
pressedAlpha = 0.24f,
focusedAlpha = 0.24f,
draggedAlpha = 0.16f,
hoveredAlpha = 0.08f
)
}

0 comments on commit c805f4f

Please sign in to comment.