summaryrefslogtreecommitdiff
path: root/android-app/app/src/main/res
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-04-11 09:48:52 +0000
committerClaude <noreply@anthropic.com>2026-04-11 09:48:52 +0000
commit3ddf436958ffde3198492895725fc0ca8ab0a1b2 (patch)
tree4406784c833a04a0a8e49fe2c75a379c8c95dc5e /android-app/app/src/main/res
parent021bc2418d698fe2fc08e108bcba85d609dfed4b (diff)
Show loading spinners next to each instrument value during conditions fetch
- Add _conditionsLoading StateFlow to MainViewModel; set true when loadConditions() fires, false when the fetch completes (success or fail) - Cancel any in-flight conditions job when a new loadConditions() call arrives (e.g. rapid map pans) so only the latest fetch drives the state - Add a 10dp ProgressBar after each of the six data values in layout_instruments_sheet.xml (wind, temp, baro, current, waves, swell); visibility GONE by default, alpha 0.5; header section tinted colorOnSurfaceVariant, forecast section tinted #5B9EC2 to match its labels - Observe conditionsLoading in MainActivity and toggle all six spinners together (all values come from one API call so they load in sync) 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/layout_instruments_sheet.xml60
1 files changed, 60 insertions, 0 deletions
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 03cefb7..edf0928 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
@@ -64,6 +64,16 @@
android:layout_marginStart="3dp"
android:layout_marginBottom="3dp"
android:layout_gravity="bottom" />
+ <ProgressBar
+ android:id="@+id/spinner_tws"
+ style="?android:attr/progressBarStyleSmall"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:indeterminate="true"
+ android:visibility="gone"
+ android:alpha="0.5"
+ android:indeterminateTint="?attr/colorOnSurfaceVariant"
+ android:layout_marginStart="4dp" />
</LinearLayout>
<TextView
android:id="@+id/bearing_tws"
@@ -96,6 +106,16 @@
style="@style/InstrumentPrimaryValue"
tools:text="18" />
<TextView android:id="@+id/unit_temp" style="@style/InstrumentUnit" android:text="°F" />
+ <ProgressBar
+ android:id="@+id/spinner_temp"
+ style="?android:attr/progressBarStyleSmall"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:indeterminate="true"
+ android:visibility="gone"
+ android:alpha="0.5"
+ android:indeterminateTint="?attr/colorOnSurfaceVariant"
+ android:layout_marginStart="4dp" />
</LinearLayout>
</LinearLayout>
@@ -124,6 +144,16 @@
style="@style/InstrumentPrimaryValue"
tools:text="1013" />
<TextView android:id="@+id/unit_baro" style="@style/InstrumentUnit" android:text="hPa" />
+ <ProgressBar
+ android:id="@+id/spinner_baro"
+ style="?android:attr/progressBarStyleSmall"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:indeterminate="true"
+ android:visibility="gone"
+ android:alpha="0.5"
+ android:indeterminateTint="?attr/colorOnSurfaceVariant"
+ android:layout_marginStart="4dp" />
</LinearLayout>
</LinearLayout>
@@ -176,6 +206,16 @@
style="@style/ForecastValue"
tools:text="0.8" />
<TextView android:id="@+id/unit_curr_spd" style="@style/ForecastUnit" android:text="kt" />
+ <ProgressBar
+ android:id="@+id/spinner_curr"
+ style="?android:attr/progressBarStyleSmall"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:indeterminate="true"
+ android:visibility="gone"
+ android:alpha="0.5"
+ android:indeterminateTint="#5B9EC2"
+ android:layout_marginStart="4dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
@@ -215,6 +255,16 @@
style="@style/ForecastValue"
tools:text="3.5" />
<TextView android:id="@+id/unit_wave_ht" style="@style/ForecastUnit" android:text="ft" />
+ <ProgressBar
+ android:id="@+id/spinner_waves"
+ style="?android:attr/progressBarStyleSmall"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:indeterminate="true"
+ android:visibility="gone"
+ android:alpha="0.5"
+ android:indeterminateTint="#5B9EC2"
+ android:layout_marginStart="4dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
@@ -254,6 +304,16 @@
style="@style/ForecastValue"
tools:text="5.2" />
<TextView android:id="@+id/unit_swell_ht" style="@style/ForecastUnit" android:text="ft" />
+ <ProgressBar
+ android:id="@+id/spinner_swell"
+ style="?android:attr/progressBarStyleSmall"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:indeterminate="true"
+ android:visibility="gone"
+ android:alpha="0.5"
+ android:indeterminateTint="#5B9EC2"
+ android:layout_marginStart="4dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"