Bluetooth Sensor: add cycling powermeter.

This commit is contained in:
Dennis Guse
2020-10-01 17:55:33 +02:00
parent e5911a79ab
commit 634a7a4321
16 changed files with 243 additions and 18 deletions
@@ -487,5 +487,47 @@
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_sensor_cadence_value" />
<!-- Cycling Power -->
<androidx.constraintlayout.widget.Group
android:id="@+id/stats_sensor_power_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="stats_sensor_power_label,stats_sensor_power_sensor_value,stats_sensor_power_value,stats_sensor_power_unit" />
<TextView
android:id="@+id/stats_sensor_power_label"
style="@style/StatsLargeLabel"
android:text="@string/sensor_state_power"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_sensor_horizontal_line" />
<TextView
android:id="@+id/stats_sensor_power_sensor_value"
style="@style/StatsTinyValue"
android:text="@string/value_unknown"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_sensor_power_label"
tools:text="90" />
<TextView
android:id="@+id/stats_sensor_power_value"
style="@style/StatsLargeValue"
android:value="@string/value_unknown"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_sensor_power_sensor_value"
tools:text="90" />
<TextView
android:id="@+id/stats_sensor_power_unit"
style="@style/StatsUnit"
android:text="@string/sensor_unit_power"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_sensor_power_value" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
+2 -2
View File
@@ -22,10 +22,10 @@ limitations under the License.
<color name="chart_heart_rate_fill">#40E88A70</color> <!-- transparent red -->
<color name="chart_pace_border">#FF0066FF</color> <!-- blue -->
<color name="chart_pace_fill">#40C8E0FF</color> <!-- transparent blue -->
<color name="chart_power_border">#FF401465</color> <!-- purple -->
<color name="chart_power_fill">#40401465</color> <!-- transparent purple -->
<color name="chart_speed_border">#FF0066FF</color> <!-- blue -->
<color name="chart_speed_fill">#40C8E0FF</color> <!-- transparent blue -->
<color name="chart_power_border">#FF7A26C0</color> <!-- purple -->
<color name="chart_power_fill">#407A26C0</color> <!-- transparent purple -->
<color name="colorAccent">@android:color/holo_orange_dark</color>
<color name="colorAccentTransparent">#55FF8800</color>
+1
View File
@@ -26,6 +26,7 @@ limitations under the License.
<string name="sensor_unit_beats_per_minute" translatable="false">BPM</string>
<string name="sensor_unit_rounds_per_minute" translatable="false">RPM</string>
<string name="sensor_unit_power" translatable="false">W</string>
<string name="value_unknown" translatable="false">-</string>
+1
View File
@@ -21,6 +21,7 @@
<string name="settings_sensor_bluetooth_heart_rate_key" translatable="false">bluetoothSensor</string>
<string name="settings_sensor_bluetooth_cycling_cadence_key" translatable="false">bluetoothCyclingCadenceSensor</string>
<string name="settings_sensor_bluetooth_cycling_speed_key" translatable="false">bluetoothCyclingSpeedSensor</string>
<string name="settings_sensor_bluetooth_cycling_power_key" translatable="false">bluetoothCyclingPowerSensor</string>
<string name="sensor_type_value_none" translatable="false">NONE</string>
<string name="settings_sensor_bluetooth_cycling_speed_wheel_circumference_key" translatable="false">bluetoothCyclingSpeedWheelCircumference</string>
+4
View File
@@ -131,6 +131,10 @@ limitations under the License.
android:defaultValue="@string/sensor_type_value_none"
android:key="@string/settings_sensor_bluetooth_cycling_cadence_key"
android:title="@string/sensor_state_cadence" />
<de.dennisguse.opentracks.settings.bluetooth.BluetoothLeCyclingPowerPreference
android:defaultValue="@string/sensor_type_value_none"
android:key="@string/settings_sensor_bluetooth_cycling_power_key"
android:title="@string/sensor_state_power" />
<de.dennisguse.opentracks.settings.bluetooth.BluetoothLeCyclingCadenceAndSpeedPreference
android:defaultValue="@string/sensor_type_value_none"
android:key="@string/settings_sensor_bluetooth_cycling_speed_key"