mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-03 01:53:05 +02:00
Barometer: select INTERNAL or NONE (also while recording).
Part of #1424.
This commit is contained in:
@@ -48,6 +48,7 @@ import de.dennisguse.opentracks.data.models.HeartRateZones;
|
||||
import de.dennisguse.opentracks.data.models.Track;
|
||||
import de.dennisguse.opentracks.io.file.TrackFileFormat;
|
||||
import de.dennisguse.opentracks.io.file.TrackFilenameGenerator;
|
||||
import de.dennisguse.opentracks.sensors.SensorType;
|
||||
import de.dennisguse.opentracks.ui.customRecordingLayout.CsvLayoutUtils;
|
||||
import de.dennisguse.opentracks.ui.customRecordingLayout.RecordingLayout;
|
||||
import de.dennisguse.opentracks.ui.customRecordingLayout.RecordingLayoutIO;
|
||||
@@ -249,22 +250,21 @@ public class PreferencesUtils {
|
||||
}
|
||||
|
||||
private static String getBluetoothSensorAddressNone() {
|
||||
return resources.getString(R.string.sensor_type_value_none);
|
||||
return SensorType.NONE.getPreferenceValue();
|
||||
}
|
||||
|
||||
public static boolean isBluetoothSensorAddressNone(String currentValue) {
|
||||
return getBluetoothSensorAddressNone().equals(currentValue);
|
||||
}
|
||||
|
||||
private static String getBluetoothSensorAddressInternal() {
|
||||
return resources.getString(R.string.sensor_type_value_internal);
|
||||
public static SensorType getSensorType(String address) {
|
||||
return Arrays.stream(SensorType.values())
|
||||
.filter(it -> it.getPreferenceValue().equals(address))
|
||||
.findFirst()
|
||||
.orElse(SensorType.REMOTE);
|
||||
}
|
||||
|
||||
public static boolean isBluetoothSensorAddressInternal(String currentValue) {
|
||||
return getBluetoothSensorAddressInternal().equals(currentValue);
|
||||
}
|
||||
|
||||
public static String getBluetoothPressureAddress() {
|
||||
public static String getBarometerSensorAddress() {
|
||||
return getString(R.string.settings_sensor_bluetooth_pressure_key, getBluetoothSensorAddressNone());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user