summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Göransson <david.goransson@mullvad.net>2024-03-12 07:42:53 +0100
committerDavid Göransson <david.goransson@mullvad.net>2024-03-12 07:42:53 +0100
commit1c6d12ffbc5584044e2d2f1bd9056a00f4654384 (patch)
treee4a79d5ed71b95a2bcaf2c164b92fe130c1fc0f7
parentbed06a1c14eaa312c8ed76a6310754261addaee5 (diff)
parente628186d0262de4593a11ebc924120e73ec5ca3a (diff)
downloadmullvadvpn-1c6d12ffbc5584044e2d2f1bd9056a00f4654384.tar.xz
mullvadvpn-1c6d12ffbc5584044e2d2f1bd9056a00f4654384.zip
Merge branch 'investigate-improving-contrast-of-focus-highlight-droid-649'
-rw-r--r--CHANGELOG.md3
-rw-r--r--android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt31
2 files changed, 32 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fec6de55c8..28e5dc382d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,7 +32,7 @@ Line wrap the file at 100 chars. Th
- Add toggle for enabling or disabling split tunneling.
- Replace auto connect with auto connect and lockdown mode guide on platforms that has
system vpn settings.
-- Add 3D map to Connect screen.
+- Add 3D map to Connect screen.
### Changed
- Change default obfuscation setting to `auto`.
@@ -40,6 +40,7 @@ Line wrap the file at 100 chars. Th
#### Android
- Migrate to Compose Navigation which also improves screen transition animations.
+- Increase focus highlight opacity
### Fixed
- Continual excessive attempts to update the API IP were made after testing access methods.
diff --git a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt
index 8d68723679..85d45c4d2b 100644
--- a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt
+++ b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt
@@ -1,12 +1,17 @@
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.LocalContentColor
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
@@ -97,6 +102,21 @@ val Shapes =
val Dimens: Dimensions
@Composable get() = LocalAppDimens.current
+private object StateTokens {
+ const val DraggedStateLayerOpacity = 0.16f // 0.16f (Material default)
+ const val FocusStateLayerOpacity = 0.24f // 0.12f (Material default)
+ const val HoverStateLayerOpacity = 0.08f // 0.08f (Material default)
+ const val PressedStateLayerOpacity = 0.12f // 0.12f (Material default)
+}
+
+private val rippleAlpha =
+ RippleAlpha(
+ pressedAlpha = StateTokens.PressedStateLayerOpacity,
+ focusedAlpha = StateTokens.FocusStateLayerOpacity,
+ draggedAlpha = StateTokens.DraggedStateLayerOpacity,
+ hoveredAlpha = StateTokens.HoverStateLayerOpacity
+ )
+
@Composable
fun ProvideDimens(dimensions: Dimensions, content: @Composable () -> Unit) {
val dimensionSet = remember { dimensions }
@@ -117,7 +137,16 @@ 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() = LocalContentColor.current
+
+ @Composable override fun rippleAlpha() = rippleAlpha
+}