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 | |
| 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')
4 files changed, 24 insertions, 9 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 ) } diff --git a/android-app/app/src/main/res/layout/layout_instruments_sheet.xml b/android-app/app/src/main/res/layout/layout_instruments_sheet.xml index e14b468..3a4adf1 100644 --- a/android-app/app/src/main/res/layout/layout_instruments_sheet.xml +++ b/android-app/app/src/main/res/layout/layout_instruments_sheet.xml @@ -159,10 +159,9 @@ </LinearLayout> - <!-- Animated wave divider — always ocean-coloured, never inverted --> + <!-- Animated wave divider — colors adapt via wave_sky/sea color resources --> <org.terst.nav.ui.WaveView android:id="@+id/wave_divider" - android:forceDarkAllowed="false" android:layout_width="match_parent" android:layout_height="72dp" android:layout_marginStart="-16dp" diff --git a/android-app/app/src/main/res/values-night/colors.xml b/android-app/app/src/main/res/values-night/colors.xml index 4d9faee..b3f8669 100644 --- a/android-app/app/src/main/res/values-night/colors.xml +++ b/android-app/app/src/main/res/values-night/colors.xml @@ -29,4 +29,12 @@ <color name="instrument_text_secondary">#9A94A0</color> <color name="instrument_background">#1C1B1F</color> <color name="instrument_card_background">#2B2930</color> + + <!-- WaveView — night: dark sky + midnight ocean --> + <color name="wave_sky_top">#1C1B1F</color> + <color name="wave_sky_bottom">#162433</color> + <color name="wave_sea_top">#0B3050</color> + <color name="wave_sea_bottom">#0D2137</color> + <color name="wave_shimmer">#4D6FC3E8</color> + <color name="wave_whitecap">#80FFFFFF</color> </resources> diff --git a/android-app/app/src/main/res/values/colors.xml b/android-app/app/src/main/res/values/colors.xml index a470c0c..2df4109 100755 --- a/android-app/app/src/main/res/values/colors.xml +++ b/android-app/app/src/main/res/values/colors.xml @@ -48,6 +48,14 @@ <color name="wind_medium">#FF9800</color> <color name="wind_strong">#F44336</color> + <!-- WaveView — day: sunny sky + tropical deep-sea blue --> + <color name="wave_sky_top">#2B8FC4</color> + <color name="wave_sky_bottom">#87C8DF</color> + <color name="wave_sea_top">#0D7A9A</color> + <color name="wave_sea_bottom">#074B68</color> + <color name="wave_shimmer">#50FFFFFF</color> + <color name="wave_whitecap">#80FFFFFF</color> + <!-- Night Vision Mode (Stays Red) --> <color name="night_red_primary">#FFFF0000</color> <color name="night_red_variant">#FFBB0000</color> |
