Add max power stats

This commit is contained in:
quaelnix
2023-09-11 15:35:38 +02:00
committed by Dennis Guse
parent e130039118
commit cf9b432224
7 changed files with 62 additions and 16 deletions
+43 -11
View File
@@ -584,53 +584,85 @@
app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_cadence_barrier" />
<!-- Sensors data -->
<androidx.constraintlayout.widget.Group
android:id="@+id/stats_power_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="stats_power_horizontal_line,stats_power_label,stats_power_value,stats_power_unit" />
app:constraint_referenced_ids="stats_power_horizontal_line,stats_max_power_label,stats_max_power_value,stats_max_power_unit,stats_avg_power_label,stats_avg_power_value,stats_avg_power_unit" />
<TextView
android:id="@+id/stats_power_label"
android:id="@+id/stats_max_power_label"
style="@style/TextAppearance.OpenTracks.PrimaryHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sensor_state_power_avg"
android:text="@string/sensor_state_power_max"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toStartOf="@id/guideline2"
app:layout_constraintTop_toBottomOf="@id/stats_power_horizontal_line" />
<TextView
android:id="@+id/stats_power_value"
android:id="@+id/stats_max_power_value"
style="@style/TextAppearance.OpenTracks.PrimaryValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toStartOf="@id/stats_power_unit"
app:layout_constraintTop_toBottomOf="@id/stats_power_label"
app:layout_constraintEnd_toStartOf="@id/stats_max_power_unit"
app:layout_constraintTop_toBottomOf="@id/stats_max_power_label"
tools:text="100" />
<TextView
android:id="@+id/stats_power_unit"
android:id="@+id/stats_max_power_unit"
style="@style/TextAppearance.OpenTracks.PrimaryUnit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sensor_state_power_unit"
app:layout_constraintBottom_toBottomOf="@id/stats_power_value"
app:layout_constraintStart_toEndOf="@id/stats_power_value"
app:layout_constraintBottom_toBottomOf="@id/stats_max_power_value"
app:layout_constraintStart_toEndOf="@id/stats_max_power_value"
app:layout_constraintEnd_toStartOf="@id/guideline2" />
<TextView
android:id="@+id/stats_avg_power_label"
style="@style/TextAppearance.OpenTracks.PrimaryHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sensor_state_power_avg"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toEndOf="@id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_power_horizontal_line" />
<TextView
android:id="@+id/stats_avg_power_value"
style="@style/TextAppearance.OpenTracks.PrimaryValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toStartOf="@id/stats_avg_power_unit"
app:layout_constraintTop_toBottomOf="@id/stats_avg_power_label"
tools:text="100" />
<TextView
android:id="@+id/stats_avg_power_unit"
style="@style/TextAppearance.OpenTracks.PrimaryUnit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sensor_state_power_unit"
app:layout_constraintBottom_toBottomOf="@id/stats_avg_power_value"
app:layout_constraintStart_toEndOf="@id/stats_avg_power_value"
app:layout_constraintEnd_toStartOf="@id/guideline3" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/stats_power_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="stats_power_value" />
app:constraint_referenced_ids="stats_max_power_value,stats_avg_power_value" />
<!-- Horizontal Line -->
<View
+1
View File
@@ -336,6 +336,7 @@ limitations under the License.
<string name="sensor_state_heart_rate_value">%1$d bpm</string>
<string name="sensor_state_power">Power</string>
<string name="sensor_state_power_avg">Avg Power</string>
<string name="sensor_state_power_max">Max Power</string>
<string name="sensor_state_power_unit">W</string>
<string name="sensor_could_not_scan">Could not scan for Bluetooth devices (error %1$i).</string>
<string name="bluetooth_disabled">Please enable Bluetooth.</string>