mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 21:06:50 +01:00
Tiny simplification and extract string
This commit is contained in:
parent
917801f223
commit
a6d18e599b
@ -281,7 +281,7 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
|
||||
|
||||
private int getTSLast24Hours() {
|
||||
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) {
|
||||
@ -306,7 +306,7 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
|
||||
cal.clear();
|
||||
cal.set(2015, Calendar.JUNE, 10, 6, 40);
|
||||
// ignore provided date ranges
|
||||
tsTo = (int) ((cal.getTimeInMillis() / 1000) & 0xffffffff);
|
||||
tsTo = (int) ((cal.getTimeInMillis() / 1000));
|
||||
tsFrom = tsTo - (24 * 60 * 60);
|
||||
|
||||
SampleProvider provider = getProvider(device);
|
||||
@ -611,6 +611,6 @@ public abstract class AbstractChartFragment extends AbstractGBFragment {
|
||||
}
|
||||
|
||||
private int toTimestamp(Date date) {
|
||||
return (int) ((date.getTime() / 1000) & 0xffffffff);
|
||||
return (int) ((date.getTime() / 1000));
|
||||
}
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ public class WeekStepsChartFragment extends AbstractChartFragment {
|
||||
List<Integer> legendColors = new ArrayList<>(1);
|
||||
List<String> legendLabels = new ArrayList<>(1);
|
||||
legendColors.add(akActivity.color);
|
||||
legendLabels.add("Steps");
|
||||
legendLabels.add(getContext().getString(R.string.chart_steps));
|
||||
chart.getLegend().setColors(legendColors);
|
||||
chart.getLegend().setLabels(legendLabels);
|
||||
chart.getLegend().setTextColor(LEGEND_TEXT_COLOR);
|
||||
|
@ -184,4 +184,5 @@
|
||||
<string name="updatefirmwareoperation_update_complete">Firmware installation complete</string>
|
||||
<string name="updatefirmwareoperation_update_complete_rebooting">Firmware installation complete, rebooting device…</string>
|
||||
<string name="updatefirmwareoperation_write_failed">Firmware write failed</string>
|
||||
<string name="chart_steps">Steps</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user