diff options
| author | Claude <noreply@anthropic.com> | 2026-04-08 23:55:01 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-04-08 23:55:01 +0000 |
| commit | 5e82a3afb108b53180f6e9bf1089cce4fa448cc4 (patch) | |
| tree | b2d62850e7b526a4ac9667653f3f7e1a577164be /android-app/app/src/main/res | |
| parent | 943d823d71ed5737e8f5b62d75f5d93ac1308d7d (diff) | |
feat(wind): Level 2 — canvas particle simulation (uniform field)
- ParticleWindView: transparent View overlay on the map; tracks 300 particles
as three FloatArrays (lat, lon, age) — no per-frame allocation; projects
lat/lon → screen via MapLibreMap.projection each frame; draws a 14px tail
segment in the wind travel direction with alpha fading by age; respawns
out-of-bounds/aged particles randomly within visible bounds; speed scaled
to viewport so animation is consistent at any zoom level; animates via
postInvalidateOnAnimation()
- activity_main.xml: ParticleWindView added above MapView, match_parent,
non-interactive (clickable/focusable=false)
- MainActivity: finds particle_wind_view; calls attachMap after getMapAsync;
feeds directionDeg/speedKt from windArrow StateFlow
https://claude.ai/code/session_01HXPjBsogsJVRwCiekDGkJX
Diffstat (limited to 'android-app/app/src/main/res')
| -rw-r--r-- | android-app/app/src/main/res/layout/activity_main.xml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/android-app/app/src/main/res/layout/activity_main.xml b/android-app/app/src/main/res/layout/activity_main.xml index 68abc60..feeb43d 100644 --- a/android-app/app/src/main/res/layout/activity_main.xml +++ b/android-app/app/src/main/res/layout/activity_main.xml @@ -17,6 +17,13 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> + <org.terst.nav.ui.map.ParticleWindView + android:id="@+id/particle_wind_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:clickable="false" + android:focusable="false" /> + <!-- Overlay Fragment Container (for Log, Safety, Help) --> <FrameLayout android:id="@+id/fragment_container" |
