1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-04 01:09:47 +01:00

Use ActivityUser.defaultUserStepsGoal instead of hardcoded values

ActivityUser has room for improvement, though.
This commit is contained in:
cpfeiffer 2018-09-16 20:49:00 +02:00
parent 226ae54ae6
commit 934f36f45a
4 changed files with 4 additions and 4 deletions

View File

@ -442,7 +442,7 @@ public class LiveActivityFragment extends AbstractChartFragment {
}
private BarDataSet setupTotalStepsChart(CustomBarChart chart, BarEntry entry, String label) {
mTotalStepsChart.getAxisLeft().addLimitLine(new LimitLine(GBApplication.getPrefs().getInt(ActivityUser.PREF_USER_STEPS_GOAL, 10000), "ss")); // TODO: use daily goal - already reached steps
mTotalStepsChart.getAxisLeft().addLimitLine(new LimitLine(GBApplication.getPrefs().getInt(ActivityUser.PREF_USER_STEPS_GOAL, ActivityUser.defaultUserStepsGoal), "ss")); // TODO: use daily goal - already reached steps
mTotalStepsChart.getAxisLeft().setAxisMinimum(0);
mTotalStepsChart.setAutoScaleMinMaxEnabled(true);
return setupCommonChart(chart, entry, label); // at the moment, these look the same

View File

@ -40,7 +40,7 @@ public class WeekStepsChartFragment extends AbstractWeekChartFragment {
@Override
int getGoal() {
return GBApplication.getPrefs().getInt(ActivityUser.PREF_USER_STEPS_GOAL, 10000);
return GBApplication.getPrefs().getInt(ActivityUser.PREF_USER_STEPS_GOAL, ActivityUser.defaultUserStepsGoal);
}
@Override

View File

@ -377,7 +377,7 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
LOG.info("Attempting to set Fitness Goal...");
BluetoothGattCharacteristic characteristic = getCharacteristic(HuamiService.UUID_CHARACTERISTIC_8_USER_SETTINGS);
if (characteristic != null) {
int fitnessGoal = GBApplication.getPrefs().getInt(ActivityUser.PREF_USER_STEPS_GOAL, 10000);
int fitnessGoal = GBApplication.getPrefs().getInt(ActivityUser.PREF_USER_STEPS_GOAL, ActivityUser.defaultUserStepsGoal);
byte[] bytes = ArrayUtils.addAll(
HuamiService.COMMAND_SET_FITNESS_GOAL_START,
BLETypeConversions.fromUint16(fitnessGoal));

View File

@ -389,7 +389,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
LOG.info("Attempting to set Fitness Goal...");
BluetoothGattCharacteristic characteristic = getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT);
if (characteristic != null) {
int fitnessGoal = GBApplication.getPrefs().getInt(ActivityUser.PREF_USER_STEPS_GOAL, 10000);
int fitnessGoal = GBApplication.getPrefs().getInt(ActivityUser.PREF_USER_STEPS_GOAL, ActivityUser.defaultUserStepsGoal);
transaction.write(characteristic, new byte[]{
MiBandService.COMMAND_SET_FITNESS_GOAL,
0,