feat(metric): reimplement RoundedDiagram/RingDiagram in Compose

- Add MetricGauge, RingGauge, MetricGaugeRow composables
- Add MetricGaugeContract with SensorType enum and AQI color mapping
- Add AQI colors (SensorGreen, SensorYellow, etc.) to theme
- Copy ic_temperature, ic_humidity, ic_pressure drawables from legacy
- Integrate MetricGaugeRow into DashboardScreen
- Add 9 preview composables for portfolio readiness

Made-with: Cursor
This commit is contained in:
2026-03-04 19:34:59 +01:00
parent 00ad737e7e
commit ca5cf8c439
8 changed files with 612 additions and 17 deletions

View File

@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M9.5,12.1c-0.11,-0.13 -0.27,-0.19 -0.46,-0.19c-0.2,0 -0.35,0.06 -0.46,0.19c-0.12,0.12 -0.17,0.29 -0.17,0.52v0.43c0,0.21 0.05,0.37 0.17,0.5c0.11,0.12 0.27,0.19 0.47,0.19c0.41,0 0.62,-0.27 0.62,-0.79V12.6C9.67,12.4 9.61,12.23 9.5,12.1zM9.5,12.1c-0.11,-0.13 -0.27,-0.19 -0.46,-0.19c-0.2,0 -0.35,0.06 -0.46,0.19c-0.12,0.12 -0.17,0.29 -0.17,0.52v0.43c0,0.21 0.05,0.37 0.17,0.5c0.11,0.12 0.27,0.19 0.47,0.19c0.41,0 0.62,-0.27 0.62,-0.79V12.6C9.67,12.4 9.61,12.23 9.5,12.1zM18.71,13.23c-0.43,-1.84 -1.3,-3.46 -2.29,-5.03C14.77,5.59 13,3.06 12.01,0c-0.24,0.61 -0.44,1.15 -0.66,1.68c-0.86,2.03 -2.07,3.86 -3.26,5.71C7.04,9 6.03,10.63 5.48,12.49c-0.55,1.9 -0.6,3.79 0.24,5.63c1.65,3.62 6.61,5.18 10.37,2.59C18.44,19.08 19.4,16.2 18.71,13.23zM7.65,14.33c-0.35,-0.32 -0.52,-0.76 -0.52,-1.31V12.6c0,-0.53 0.17,-0.96 0.52,-1.28c0.34,-0.33 0.81,-0.49 1.39,-0.49c0.59,0 1.05,0.16 1.39,0.48c0.34,0.33 0.51,0.77 0.51,1.32v0.42c0,0.53 -0.17,0.96 -0.51,1.28c-0.34,0.32 -0.8,0.48 -1.38,0.48S8.01,14.65 7.65,14.33zM10.5,18.34L9.31,17.6l4.19,-6.69l1.18,0.74L10.5,18.34zM16.88,16.58c0,0.53 -0.18,0.96 -0.52,1.28c-0.34,0.32 -0.79,0.48 -1.39,0.48c-0.57,0 -1.04,-0.16 -1.39,-0.48c-0.35,-0.32 -0.53,-0.76 -0.53,-1.31v-0.43c0,-0.53 0.18,-0.95 0.52,-1.28c0.35,-0.32 0.81,-0.48 1.39,-0.48c0.58,0 1.05,0.16 1.39,0.48c0.35,0.31 0.53,0.76 0.53,1.32V16.58zM9.04,11.91c-0.2,0 -0.35,0.06 -0.46,0.19c-0.12,0.12 -0.17,0.29 -0.17,0.52v0.43c0,0.21 0.05,0.37 0.17,0.5c0.11,0.12 0.27,0.19 0.47,0.19c0.41,0 0.62,-0.27 0.62,-0.79V12.6c0,-0.2 -0.06,-0.37 -0.17,-0.5S9.23,11.91 9.04,11.91zM9.5,12.1c-0.11,-0.13 -0.27,-0.19 -0.46,-0.19c-0.2,0 -0.35,0.06 -0.46,0.19c-0.12,0.12 -0.17,0.29 -0.17,0.52v0.43c0,0.21 0.05,0.37 0.17,0.5c0.11,0.12 0.27,0.19 0.47,0.19c0.41,0 0.62,-0.27 0.62,-0.79V12.6C9.67,12.4 9.61,12.23 9.5,12.1z"/>
<path
android:fillColor="#FF000000"
android:pathData="M15.6,16.12l-0.01,0.6c-0.02,0.37 -0.24,0.54 -0.62,0.54c-0.04,0 -0.09,-0.01 -0.13,-0.02c-0.01,0 -0.01,0 -0.02,0c-0.12,-0.02 -0.22,-0.08 -0.31,-0.18c-0.12,-0.14 -0.19,-0.3 -0.19,-0.48V16.1c0.02,-0.21 0.08,-0.37 0.18,-0.49c0.09,-0.08 0.2,-0.14 0.32,-0.16c0.05,-0.01 0.09,-0.01 0.14,-0.01c0.2,0 0.36,0.06 0.46,0.18C15.54,15.75 15.6,15.92 15.6,16.12z"/>
<path
android:fillColor="#FF000000"
android:pathData="M9.67,12.6v0.35c0,0.52 -0.21,0.79 -0.62,0.79c-0.2,0 -0.36,-0.07 -0.47,-0.19c-0.12,-0.13 -0.17,-0.29 -0.17,-0.5v-0.43c0,-0.23 0.05,-0.4 0.17,-0.52c0.11,-0.13 0.26,-0.19 0.46,-0.19c0.19,0 0.35,0.06 0.46,0.19S9.67,12.4 9.67,12.6z"/>
</vector>

View File

@@ -0,0 +1,36 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M4.59,19.15c-0.33,0 -0.65,-0.15 -0.87,-0.43c-1.54,-2.02 -2.29,-4.52 -2.11,-7.05C2.03,5.94 7.01,1.62 12.74,2.03c2.77,0.2 5.3,1.46 7.12,3.56c1.82,2.1 2.71,4.78 2.52,7.56c-0.14,2 -0.85,3.9 -2.05,5.5c-0.36,0.48 -1.04,0.58 -1.52,0.22c-0.48,-0.36 -0.58,-1.04 -0.22,-1.52c0.95,-1.26 1.51,-2.76 1.62,-4.35c0.16,-2.19 -0.55,-4.32 -1.99,-5.98c-1.44,-1.66 -3.44,-2.66 -5.63,-2.82c-4.52,-0.32 -8.47,3.1 -8.8,7.63c-0.14,2 0.45,3.98 1.67,5.58c0.36,0.48 0.27,1.16 -0.2,1.52C5.05,19.07 4.82,19.15 4.59,19.15z"/>
<path
android:fillColor="#FF000000"
android:pathData="M9.63,20.32v1.62H8.68v-4.59h1.79c0.34,0 0.65,0.06 0.91,0.19c0.26,0.13 0.46,0.31 0.6,0.54c0.14,0.23 0.21,0.5 0.21,0.79c0,0.45 -0.15,0.8 -0.46,1.06c-0.31,0.26 -0.73,0.39 -1.28,0.39H9.63zM9.63,19.55h0.85c0.25,0 0.44,-0.06 0.57,-0.18c0.13,-0.12 0.2,-0.29 0.2,-0.5c0,-0.22 -0.07,-0.41 -0.2,-0.55c-0.13,-0.14 -0.32,-0.21 -0.55,-0.21H9.63V19.55z"/>
<path
android:fillColor="#FF000000"
android:pathData="M14.73,21.94c-0.04,-0.08 -0.07,-0.18 -0.09,-0.31C14.42,21.88 14.13,22 13.78,22c-0.33,0 -0.61,-0.1 -0.83,-0.29c-0.22,-0.19 -0.33,-0.44 -0.33,-0.73c0,-0.36 0.13,-0.64 0.4,-0.83c0.27,-0.19 0.66,-0.29 1.16,-0.29h0.42v-0.2c0,-0.16 -0.04,-0.28 -0.12,-0.38c-0.08,-0.09 -0.21,-0.14 -0.38,-0.14c-0.15,0 -0.27,0.04 -0.36,0.11c-0.09,0.07 -0.13,0.17 -0.13,0.3h-0.91c0,-0.2 0.06,-0.38 0.18,-0.55c0.12,-0.17 0.29,-0.3 0.52,-0.4c0.22,-0.1 0.47,-0.14 0.75,-0.14c0.42,0 0.75,0.11 1,0.32c0.25,0.21 0.37,0.51 0.37,0.89v1.48c0,0.32 0.05,0.57 0.14,0.73v0.05H14.73zM13.98,21.3c0.13,0 0.26,-0.03 0.37,-0.09c0.11,-0.06 0.2,-0.14 0.25,-0.24v-0.59h-0.34c-0.46,0 -0.7,0.16 -0.73,0.47l0,0.05c0,0.11 0.04,0.21 0.12,0.28C13.73,21.27 13.84,21.3 13.98,21.3z"/>
<path
android:fillColor="#FF000000"
android:pathData="M16.75,7.72l-2.58,3.37c0.04,0.11 0.08,0.23 0.1,0.35c0.24,1.2 -0.54,2.37 -1.75,2.61c-0.22,0.04 -0.43,0.05 -0.64,0.03l-1.01,1.32c-0.08,0.11 -0.2,0.18 -0.34,0.21c-0.02,0 -0.05,0.01 -0.07,0.01c-0.18,0.01 -0.36,-0.05 -0.5,-0.18l-1.34,-1.28c-0.14,-0.13 -0.21,-0.31 -0.2,-0.49c0.01,-0.17 0.08,-0.32 0.21,-0.42l1.27,-1.06c-0.16,-1.16 0.61,-2.26 1.77,-2.49c0.39,-0.08 0.77,-0.05 1.12,0.07l3.25,-2.72c0.2,-0.16 0.47,-0.15 0.66,0.02C16.88,7.24 16.91,7.52 16.75,7.72z"/>
<path
android:fillColor="#FF000000"
android:pathData="M7.04,16.22m-0.64,0a0.64,0.64 0,1 1,1.28 0a0.64,0.64 0,1 1,-1.28 0"/>
<path
android:fillColor="#FF000000"
android:pathData="M5.75,11.91m-0.64,0a0.64,0.64 0,1 1,1.28 0a0.64,0.64 0,1 1,-1.28 0"/>
<path
android:fillColor="#FF000000"
android:pathData="M7.74,7.83m-0.64,0a0.64,0.64 0,1 1,1.28 0a0.64,0.64 0,1 1,-1.28 0"/>
<path
android:fillColor="#FF000000"
android:pathData="M11.98,6.14m-0.64,0a0.64,0.64 0,1 1,1.28 0a0.64,0.64 0,1 1,-1.28 0"/>
<path
android:fillColor="#FF000000"
android:pathData="M16.95,16.22m-0.64,0a0.64,0.64 0,1 1,1.28 0a0.64,0.64 0,1 1,-1.28 0"/>
<path
android:fillColor="#FF000000"
android:pathData="M18.25,11.91m-0.64,0a0.64,0.64 0,1 1,1.28 0a0.64,0.64 0,1 1,-1.28 0"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="36dp"
android:height="36dp"
android:viewportWidth="36"
android:viewportHeight="36">
<path
android:pathData="M22.68,8h-3.52V7.83c0,-0.7 -0.28,-1.33 -0.74,-1.79c-0.46,-0.46 -1.09,-0.74 -1.79,-0.74c-1.4,0 -2.53,1.13 -2.53,2.53v15.74c-0.9,0.74 -1.48,1.86 -1.48,3.11c0,2.21 1.8,4.01 4.01,4.01c2.21,0 4.01,-1.79 4.01,-4.01c0,-1.26 -0.58,-2.38 -1.48,-3.11v-1.41h1.96c0.39,0 0.7,-0.31 0.7,-0.7c0,-0.39 -0.31,-0.7 -0.7,-0.7h-1.96v-1.79h1.96c0.39,0 0.7,-0.31 0.7,-0.7c0,-0.39 -0.31,-0.7 -0.7,-0.7h-1.96v-1.79h1.96c0.39,0 0.7,-0.31 0.7,-0.7c0,-0.39 -0.31,-0.7 -0.7,-0.7h-1.96v-1.79h1.96c0.39,0 0.7,-0.31 0.7,-0.7c0,-0.39 -0.31,-0.7 -0.7,-0.7h-1.96V9.4h3.52c0.39,0 0.7,-0.31 0.7,-0.7S23.07,8 22.68,8zM16.63,28.43c-0.96,0 -1.74,-0.78 -1.74,-1.74c0,-0.21 0.04,-0.41 0.11,-0.6c0.16,-0.44 0.5,-0.8 0.93,-0.99V14.9c0,-0.19 0.08,-0.37 0.2,-0.49c0.13,-0.13 0.3,-0.2 0.49,-0.2c0.39,0 0.7,0.31 0.7,0.7v10.2c0.43,0.19 0.77,0.55 0.93,0.99c0.07,0.19 0.11,0.39 0.11,0.6C18.37,27.65 17.59,28.43 16.63,28.43z"
android:fillColor="#FFFFFF"/>
</vector>