1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-24 14:00:48 +02:00

Fix previous commit, disable LimitLines for this release

This commit is contained in:
cpfeiffer 2015-06-21 19:43:45 +02:00
parent b1973994f0
commit 1fb20926b3

View File

@ -225,17 +225,15 @@ public class SleepChartActivity extends Activity {
LOG.info("number of samples:" + samples.size()); LOG.info("number of samples:" + samples.size());
if (samples.size() > 1) { if (samples.size() > 1) {
float movement_divisor; float movement_divisor;
boolean annotate; boolean annotate = true;
boolean use_steps_as_movement; boolean use_steps_as_movement;
switch (getProvider(mGBDevice)) { switch (getProvider(mGBDevice)) {
case GBActivitySample.PROVIDER_MIBAND: case GBActivitySample.PROVIDER_MIBAND:
movement_divisor = 256.0f; movement_divisor = 256.0f;
annotate = false; // sample density to high?
use_steps_as_movement = true; use_steps_as_movement = true;
break; break;
default: // Morpheuz default: // Morpheuz
movement_divisor = 5000.0f; movement_divisor = 5000.0f;
annotate = false;
use_steps_as_movement = false; use_steps_as_movement = false;
break; break;
} }
@ -301,23 +299,23 @@ public class SleepChartActivity extends Activity {
date = cal.getTime(); date = cal.getTime();
String dateString = annotationDateFormat.format(date); String dateString = annotationDateFormat.format(date);
xLabel = dateString; xLabel = dateString;
if (last_type != type) { // if (last_type != type) {
if (isSleep(last_type) && !isSleep(type)) { // if (isSleep(last_type) && !isSleep(type)) {
// woken up // // woken up
LimitLine line = new LimitLine(i, dateString); // LimitLine line = new LimitLine(i, dateString);
line.enableDashedLine(8, 8, 0); // line.enableDashedLine(8, 8, 0);
line.setTextColor(Color.WHITE); // line.setTextColor(Color.WHITE);
line.setTextSize(15); // line.setTextSize(15);
mChart.getXAxis().addLimitLine(line); // mChart.getXAxis().addLimitLine(line);
} else if (!isSleep(last_type) && isSleep(type)) { // } else if (!isSleep(last_type) && isSleep(type)) {
// fallen asleep // // fallen asleep
LimitLine line = new LimitLine(i, dateString); // LimitLine line = new LimitLine(i, dateString);
line.enableDashedLine(8, 8, 0); // line.enableDashedLine(8, 8, 0);
line.setTextSize(15); // line.setTextSize(15);
line.setTextColor(Color.WHITE); // line.setTextColor(Color.WHITE);
mChart.getXAxis().addLimitLine(line); // mChart.getXAxis().addLimitLine(line);
} // }
} // }
last_type = type; last_type = type;
} }
xLabels.add(xLabel); xLabels.add(xLabel);