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

Tiny simplification and extract string

This commit is contained in:
cpfeiffer 2015-09-01 22:30:02 +02:00
parent 917801f223
commit a6d18e599b
3 changed files with 5 additions and 4 deletions

View File

@ -281,7 +281,7 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
private int getTSLast24Hours() { private int getTSLast24Hours() {
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
return (int) ((now / 1000) - (24 * 60 * 60) & 0xffffffff); // -24 hours return (int) ((now / 1000) - (24 * 60 * 60)); // -24 hours
} }
protected List<ActivitySample> getActivitySamples(DBHandler db, GBDevice device, int tsFrom, int tsTo) { protected List<ActivitySample> getActivitySamples(DBHandler db, GBDevice device, int tsFrom, int tsTo) {
@ -306,7 +306,7 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
cal.clear(); cal.clear();
cal.set(2015, Calendar.JUNE, 10, 6, 40); cal.set(2015, Calendar.JUNE, 10, 6, 40);
// ignore provided date ranges // ignore provided date ranges
tsTo = (int) ((cal.getTimeInMillis() / 1000) & 0xffffffff); tsTo = (int) ((cal.getTimeInMillis() / 1000));
tsFrom = tsTo - (24 * 60 * 60); tsFrom = tsTo - (24 * 60 * 60);
SampleProvider provider = getProvider(device); SampleProvider provider = getProvider(device);
@ -611,6 +611,6 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
} }
private int toTimestamp(Date date) { private int toTimestamp(Date date) {
return (int) ((date.getTime() / 1000) & 0xffffffff); return (int) ((date.getTime() / 1000));
} }
} }

View File

@ -192,7 +192,7 @@ public class WeekStepsChartFragment extends AbstractChartFragment {
List<Integer> legendColors = new ArrayList<>(1); List<Integer> legendColors = new ArrayList<>(1);
List<String> legendLabels = new ArrayList<>(1); List<String> legendLabels = new ArrayList<>(1);
legendColors.add(akActivity.color); legendColors.add(akActivity.color);
legendLabels.add("Steps"); legendLabels.add(getContext().getString(R.string.chart_steps));
chart.getLegend().setColors(legendColors); chart.getLegend().setColors(legendColors);
chart.getLegend().setLabels(legendLabels); chart.getLegend().setLabels(legendLabels);
chart.getLegend().setTextColor(LEGEND_TEXT_COLOR); chart.getLegend().setTextColor(LEGEND_TEXT_COLOR);

View File

@ -184,4 +184,5 @@
<string name="updatefirmwareoperation_update_complete">Firmware installation complete</string> <string name="updatefirmwareoperation_update_complete">Firmware installation complete</string>
<string name="updatefirmwareoperation_update_complete_rebooting">Firmware installation complete, rebooting device…</string> <string name="updatefirmwareoperation_update_complete_rebooting">Firmware installation complete, rebooting device…</string>
<string name="updatefirmwareoperation_write_failed">Firmware write failed</string> <string name="updatefirmwareoperation_write_failed">Firmware write failed</string>
<string name="chart_steps">Steps</string>
</resources> </resources>