diff options
| author | Claude <noreply@anthropic.com> | 2026-04-11 09:55:54 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-04-11 09:55:54 +0000 |
| commit | 122e8b7b84df85b1f6a9ed50c6c66273acee911d (patch) | |
| tree | 0ff274561af606f0cd745400939cd10448aa3ad9 /android-app/app/src/main/kotlin/org | |
| parent | e4ae5ac3a83f1da940ab33c93da4ed3e03cd7f14 (diff) | |
WaveView adapts sky/sea colors to light/dark mode
Day (light mode): vivid sky blue (#2B8FC4 → #87C8DF) fading into
tropical deep-sea blue (#0D7A9A → #074B68) — evokes a clear Kona
afternoon with deep Pacific below. Shimmer is bright white sunlight
on water (#50FFFFFF).
Night (dark mode): retains the existing dark charcoal sky (#1C1B1F →
#162433) and midnight navy sea (#0B3050 → #0D2137) with blue shimmer.
Colors are defined as adaptive color resources (values/ and values-night/)
and read in WaveView.onSizeChanged() and paint init instead of hardcoded
Color.parseColor() calls.
https://claude.ai/code/session_01HXPjBsogsJVRwCiekDGkJX
Diffstat (limited to 'android-app/app/src/main/kotlin/org')
| -rw-r--r-- | android-app/app/src/main/kotlin/org/terst/nav/ui/WaveView.kt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/android-app/app/src/main/kotlin/org/terst/nav/ui/WaveView.kt b/android-app/app/src/main/kotlin/org/terst/nav/ui/WaveView.kt index d3f9a4d..ba7dee8 100644 --- a/android-app/app/src/main/kotlin/org/terst/nav/ui/WaveView.kt +++ b/android-app/app/src/main/kotlin/org/terst/nav/ui/WaveView.kt @@ -2,7 +2,6 @@ package org.terst.nav.ui import android.content.Context import android.graphics.Canvas -import android.graphics.Color import android.graphics.LinearGradient import android.graphics.Paint import android.graphics.Path @@ -10,6 +9,7 @@ import android.graphics.Shader import android.os.SystemClock import android.util.AttributeSet import android.view.View +import org.terst.nav.R import kotlin.math.sin /** @@ -50,14 +50,14 @@ class WaveView @JvmOverloads constructor( private val shimmerPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply { style = Paint.Style.STROKE strokeWidth = 1.5f - color = Color.argb(77, 111, 195, 232) + color = context.getColor(R.color.wave_shimmer) } private val whitecapPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply { style = Paint.Style.STROKE strokeWidth = 1.5f strokeCap = Paint.Cap.ROUND - color = Color.argb(128, 255, 255, 255) + color = context.getColor(R.color.wave_whitecap) } override fun onAttachedToWindow() { @@ -69,14 +69,14 @@ class WaveView @JvmOverloads constructor( override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { skyPaint.shader = LinearGradient( 0f, 0f, 0f, h * 0.6f, - Color.parseColor("#1C1B1F"), - Color.parseColor("#162433"), + context.getColor(R.color.wave_sky_top), + context.getColor(R.color.wave_sky_bottom), Shader.TileMode.CLAMP ) seaPaint.shader = LinearGradient( 0f, h * 0.4f, 0f, h.toFloat(), - Color.parseColor("#0B3050"), - Color.parseColor("#0D2137"), + context.getColor(R.color.wave_sea_top), + context.getColor(R.color.wave_sea_bottom), Shader.TileMode.CLAMP ) } |
