Merge remote-tracking branch 'origin/dev' into combo-scripter-v2
* origin/dev: improve GUI response narrower temp basal line for steampunk watchface darker and gracile steampunk-chart Steampunk: Enabled chart zoom with double-tap on bottom 1/3 of screen - xml files. Steampunk: Enabled chart zoom with double-tap on bottom 1/3 of screen. move steampunk md to main dir Addition of a file linking to the location of the Steampunk source photoshop file. File is not included in the repository as it exceeds Github's 25 mb limit. Steampunk watch face - improvement of the units switching functionality (less time spent on "?" on glucose dial). Steampunk watch face - unit testing complete. Steampunk watchface: Updated graphics for more accuracy / brighter background, enabled double-tap, corrected issue when changing from mg/dL to mmol/L (glucose would show as "low"). Steampunk watchface (moto360 support - ignores the chin) Steampunk watchface (mmol support) Includes delta granularity in the watch preferences. Steampunk watchface (interim commit) Steampunk watch face addition of mmol/L drawable Steampunk watch face layout changes Steampunk watch face (for testing) Steampunk watch face (not yet functional) Steampunk watch face (not yet functional)
7
Steampunk_graphics_source_link.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
Follow this link to get the source PSD file for the Steampunk graphics. The file could not be included in the repository as it exceeds Github's 25 mb limit.
|
||||
|
||||
Note, the source image size is 1600x1600. The image size should be reduced to 400x400 prior to export of final PNG.
|
||||
|
||||
https://drive.google.com/drive/folders/1MrdgnQz3wOniDvRSMhAsqHBYb2WmE5i0
|
||||
|
||||
Graphics created by (Github): andrew-warrington
|
|
@ -179,6 +179,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
Handler sLoopHandler = new Handler();
|
||||
Runnable sRefreshLoop = null;
|
||||
|
||||
final Object updateSync = new Object();
|
||||
|
||||
private static final ScheduledExecutorService worker = Executors.newSingleThreadScheduledExecutor();
|
||||
private static ScheduledFuture<?> scheduledUpdate = null;
|
||||
|
||||
|
@ -902,9 +904,9 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void updateGUI(String from) {
|
||||
public void updateGUI(final String from) {
|
||||
log.debug("updateGUI entered from: " + from);
|
||||
Date updateGUIStart = new Date();
|
||||
final Date updateGUIStart = new Date();
|
||||
|
||||
if (getActivity() == null)
|
||||
return;
|
||||
|
@ -926,7 +928,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
BgReading actualBG = DatabaseHelper.actualBg();
|
||||
BgReading lastBG = DatabaseHelper.lastBg();
|
||||
|
||||
PumpInterface pump = ConfigBuilderPlugin.getActivePump();
|
||||
final PumpInterface pump = ConfigBuilderPlugin.getActivePump();
|
||||
|
||||
Profile profile = MainApp.getConfigBuilder().getProfile();
|
||||
String units = profile.getUnits();
|
||||
|
@ -938,8 +940,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
return;
|
||||
}
|
||||
|
||||
double lowLine = SP.getDouble("low_mark", 0d);
|
||||
double highLine = SP.getDouble("high_mark", 0d);
|
||||
final double lowLine = SP.getDouble("low_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetLow, units));
|
||||
final double highLine = SP.getDouble("high_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetHigh, units));
|
||||
|
||||
//Start with updating the BG as it is unaffected by loop.
|
||||
// **** BG value ****
|
||||
|
@ -1143,16 +1145,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
}
|
||||
|
||||
|
||||
if (lowLine < 1) {
|
||||
lowLine = Profile.fromMgdlToUnits(OverviewPlugin.bgTargetLow, units);
|
||||
}
|
||||
if (highLine < 1) {
|
||||
highLine = Profile.fromMgdlToUnits(OverviewPlugin.bgTargetHigh, units);
|
||||
}
|
||||
|
||||
// **** BG value ****
|
||||
if (lastBG == null) { //left this here as it seems you want to exit at this point if it is null...
|
||||
|
||||
return;
|
||||
}
|
||||
Integer flag = bgView.getPaintFlags();
|
||||
|
@ -1203,7 +1197,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
cobView.setText(cobText);
|
||||
}
|
||||
|
||||
boolean showPrediction = showPredictionView.isChecked() && finalLastRun != null && finalLastRun.constraintsProcessed.getClass().equals(DetermineBasalResultAMA.class);
|
||||
final boolean showPrediction = showPredictionView.isChecked() && finalLastRun != null && finalLastRun.constraintsProcessed.getClass().equals(DetermineBasalResultAMA.class);
|
||||
if (MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class) != null && MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class).isEnabled(PluginBase.APS)) {
|
||||
showPredictionView.setVisibility(View.VISIBLE);
|
||||
getActivity().findViewById(R.id.overview_showprediction_label).setVisibility(View.VISIBLE);
|
||||
|
@ -1247,105 +1241,118 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
|
||||
// ****** GRAPH *******
|
||||
|
||||
// allign to hours
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.add(Calendar.HOUR, 1);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// allign to hours
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.add(Calendar.HOUR, 1);
|
||||
|
||||
int hoursToFetch;
|
||||
long toTime;
|
||||
long fromTime;
|
||||
long endTime;
|
||||
if (showPrediction) {
|
||||
int predHours = (int) (Math.ceil(((DetermineBasalResultAMA) finalLastRun.constraintsProcessed).getLatestPredictionsTime() - System.currentTimeMillis()) / (60 * 60 * 1000));
|
||||
predHours = Math.min(2, predHours);
|
||||
predHours = Math.max(0, predHours);
|
||||
hoursToFetch = rangeToDisplay - predHours;
|
||||
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific
|
||||
fromTime = toTime - hoursToFetch * 60 * 60 * 1000L;
|
||||
endTime = toTime + predHours * 60 * 60 * 1000L;
|
||||
} else {
|
||||
hoursToFetch = rangeToDisplay;
|
||||
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific
|
||||
fromTime = toTime - hoursToFetch * 60 * 60 * 1000L;
|
||||
endTime = toTime;
|
||||
}
|
||||
int hoursToFetch;
|
||||
final long toTime;
|
||||
final long fromTime;
|
||||
final long endTime;
|
||||
if (showPrediction) {
|
||||
int predHours = (int) (Math.ceil(((DetermineBasalResultAMA) finalLastRun.constraintsProcessed).getLatestPredictionsTime() - System.currentTimeMillis()) / (60 * 60 * 1000));
|
||||
predHours = Math.min(2, predHours);
|
||||
predHours = Math.max(0, predHours);
|
||||
hoursToFetch = rangeToDisplay - predHours;
|
||||
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific
|
||||
fromTime = toTime - hoursToFetch * 60 * 60 * 1000L;
|
||||
endTime = toTime + predHours * 60 * 60 * 1000L;
|
||||
} else {
|
||||
hoursToFetch = rangeToDisplay;
|
||||
toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific
|
||||
fromTime = toTime - hoursToFetch * 60 * 60 * 1000L;
|
||||
endTime = toTime;
|
||||
}
|
||||
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
final long now = System.currentTimeMillis();
|
||||
|
||||
// 2nd graph
|
||||
// remove old data
|
||||
iobGraph.getSeries().clear();
|
||||
// ------------------ 1st graph
|
||||
Profiler.log(log, from + " - 1st graph - START", updateGUIStart);
|
||||
|
||||
GraphData secondGraphData = new GraphData();
|
||||
final GraphData graphData = new GraphData(bgGraph);
|
||||
|
||||
boolean useIobForScale = false;
|
||||
boolean useCobForScale = false;
|
||||
boolean useDevForScale = false;
|
||||
boolean useRatioForScale = false;
|
||||
// **** In range Area ****
|
||||
graphData.addInRangeArea(fromTime, endTime, lowLine, highLine);
|
||||
|
||||
if (showIobView.isChecked()) {
|
||||
useIobForScale = true;
|
||||
} else if (showCobView.isChecked()) {
|
||||
useCobForScale = true;
|
||||
} else if (showDeviationsView.isChecked()) {
|
||||
useDevForScale = true;
|
||||
} else if (showRatiosView.isChecked()) {
|
||||
useRatioForScale = true;
|
||||
}
|
||||
// **** BG ****
|
||||
if (showPrediction)
|
||||
graphData.addBgReadings(fromTime, toTime, lowLine, highLine, (DetermineBasalResultAMA) finalLastRun.constraintsProcessed);
|
||||
else
|
||||
graphData.addBgReadings(fromTime, toTime, lowLine, highLine, null);
|
||||
|
||||
if (showIobView.isChecked())
|
||||
secondGraphData.addIob(iobGraph, fromTime, now, useIobForScale, 1d);
|
||||
if (showCobView.isChecked())
|
||||
secondGraphData.addCob(iobGraph, fromTime, now, useCobForScale, useCobForScale ? 1d : 0.5d);
|
||||
if (showDeviationsView.isChecked())
|
||||
secondGraphData.addDeviations(iobGraph, fromTime, now, useDevForScale, 1d);
|
||||
if (showRatiosView.isChecked())
|
||||
secondGraphData.addRatio(iobGraph, fromTime, now, useRatioForScale, 1d);
|
||||
// set manual x bounds to have nice steps
|
||||
graphData.formatAxis(fromTime, endTime);
|
||||
|
||||
if (showIobView.isChecked() || showCobView.isChecked() || showDeviationsView.isChecked() || showRatiosView.isChecked()) {
|
||||
iobGraph.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
iobGraph.setVisibility(View.GONE);
|
||||
}
|
||||
// Treatments
|
||||
graphData.addTreatments(fromTime, endTime);
|
||||
|
||||
// remove old data from graph
|
||||
bgGraph.getSeries().clear();
|
||||
// add basal data
|
||||
if (pump.getPumpDescription().isTempBasalCapable && showBasalsView.isChecked()) {
|
||||
graphData.addBasals(fromTime, now, lowLine / graphData.maxY / 1.2d);
|
||||
}
|
||||
|
||||
GraphData graphData = new GraphData();
|
||||
// **** NOW line ****
|
||||
graphData.addNowLine(now);
|
||||
|
||||
// **** In range Area ****
|
||||
graphData.addInRangeArea(bgGraph, fromTime, endTime, lowLine, highLine);
|
||||
// ------------------ 2nd graph
|
||||
Profiler.log(log, from + " - 2nd graph - START", updateGUIStart);
|
||||
|
||||
// **** BG ****
|
||||
if (showPrediction)
|
||||
graphData.addBgReadings(bgGraph, fromTime, toTime, lowLine, highLine, (DetermineBasalResultAMA) finalLastRun.constraintsProcessed);
|
||||
else
|
||||
graphData.addBgReadings(bgGraph, fromTime, toTime, lowLine, highLine, null);
|
||||
final GraphData secondGraphData = new GraphData(iobGraph);
|
||||
|
||||
// set manual x bounds to have nice steps
|
||||
graphData.formatAxis(bgGraph, fromTime, endTime);
|
||||
secondGraphData.formatAxis(iobGraph, fromTime, endTime);
|
||||
boolean useIobForScale = false;
|
||||
boolean useCobForScale = false;
|
||||
boolean useDevForScale = false;
|
||||
boolean useRatioForScale = false;
|
||||
|
||||
// Treatments
|
||||
graphData.addTreatments(bgGraph, fromTime, endTime);
|
||||
if (showIobView.isChecked()) {
|
||||
useIobForScale = true;
|
||||
} else if (showCobView.isChecked()) {
|
||||
useCobForScale = true;
|
||||
} else if (showDeviationsView.isChecked()) {
|
||||
useDevForScale = true;
|
||||
} else if (showRatiosView.isChecked()) {
|
||||
useRatioForScale = true;
|
||||
}
|
||||
|
||||
// add basal data
|
||||
if (pump.getPumpDescription().isTempBasalCapable && showBasalsView.isChecked()) {
|
||||
graphData.addBasals(bgGraph, fromTime, now, lowLine / graphData.maxY / 1.2d);
|
||||
}
|
||||
if (showIobView.isChecked())
|
||||
secondGraphData.addIob(fromTime, now, useIobForScale, 1d);
|
||||
if (showCobView.isChecked())
|
||||
secondGraphData.addCob(fromTime, now, useCobForScale, useCobForScale ? 1d : 0.5d);
|
||||
if (showDeviationsView.isChecked())
|
||||
secondGraphData.addDeviations(fromTime, now, useDevForScale, 1d);
|
||||
if (showRatiosView.isChecked())
|
||||
secondGraphData.addRatio(fromTime, now, useRatioForScale, 1d);
|
||||
|
||||
// **** NOW line ****
|
||||
graphData.addNowLine(bgGraph, now);
|
||||
secondGraphData.addNowLine(iobGraph, now);
|
||||
// **** NOW line ****
|
||||
// set manual x bounds to have nice steps
|
||||
secondGraphData.formatAxis(fromTime, endTime);
|
||||
secondGraphData.addNowLine(now);
|
||||
|
||||
// finaly enforce drawing of graphs
|
||||
bgGraph.onDataChanged(false, false);
|
||||
iobGraph.onDataChanged(false, false);
|
||||
// do GUI update
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (showIobView.isChecked() || showCobView.isChecked() || showDeviationsView.isChecked() || showRatiosView.isChecked()) {
|
||||
iobGraph.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
iobGraph.setVisibility(View.GONE);
|
||||
}
|
||||
// finaly enforce drawing of graphs
|
||||
graphData.performUpdate();
|
||||
secondGraphData.performUpdate();
|
||||
Profiler.log(log, from + " - onDataChanged", updateGUIStart);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
|
||||
Profiler.log(log, from, updateGUIStart);
|
||||
}
|
||||
|
@ -1431,6 +1438,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void updateNotifications() {
|
||||
|
|
|
@ -45,15 +45,18 @@ import info.nightscout.utils.Round;
|
|||
|
||||
public class GraphData {
|
||||
|
||||
public GraphData() {
|
||||
units = MainApp.getConfigBuilder().getProfileUnits();
|
||||
}
|
||||
|
||||
private GraphView graph;
|
||||
public double maxY = 0;
|
||||
private List<BgReading> bgReadingsArray;
|
||||
private String units;
|
||||
private List<Series> series = new ArrayList<>();
|
||||
|
||||
public void addBgReadings(GraphView bgGraph, long fromTime, long toTime, double lowLine, double highLine, DetermineBasalResultAMA amaResult) {
|
||||
public GraphData(GraphView graph) {
|
||||
units = MainApp.getConfigBuilder().getProfileUnits();
|
||||
this.graph = graph;
|
||||
}
|
||||
|
||||
public void addBgReadings(long fromTime, long toTime, double lowLine, double highLine, DetermineBasalResultAMA amaResult) {
|
||||
double maxBgValue = 0d;
|
||||
bgReadingsArray = MainApp.getDbHelper().getBgreadingsDataFromTime(fromTime, true);
|
||||
List<DataPointWithLabelInterface> bgListArray = new ArrayList<>();
|
||||
|
@ -81,20 +84,18 @@ public class GraphData {
|
|||
DataPointWithLabelInterface[] bg = new DataPointWithLabelInterface[bgListArray.size()];
|
||||
bg = bgListArray.toArray(bg);
|
||||
|
||||
if (bg.length > 0) {
|
||||
addSeriesWithoutInvalidate(bgGraph, new PointsWithLabelGraphSeries<>(bg));
|
||||
}
|
||||
|
||||
maxY = maxBgValue;
|
||||
// set manual y bounds to have nice steps
|
||||
bgGraph.getViewport().setMaxY(maxY);
|
||||
bgGraph.getViewport().setMinY(0);
|
||||
bgGraph.getViewport().setYAxisBoundsManual(true);
|
||||
bgGraph.getGridLabelRenderer().setNumVerticalLabels(numOfVertLines);
|
||||
graph.getViewport().setMaxY(maxY);
|
||||
graph.getViewport().setMinY(0);
|
||||
graph.getViewport().setYAxisBoundsManual(true);
|
||||
graph.getGridLabelRenderer().setNumVerticalLabels(numOfVertLines);
|
||||
|
||||
addSeries(new PointsWithLabelGraphSeries<>(bg));
|
||||
}
|
||||
|
||||
public void addInRangeArea(GraphView bgGraph, long fromTime, long toTime, double lowLine, double highLine) {
|
||||
public void addInRangeArea(long fromTime, long toTime, double lowLine, double highLine) {
|
||||
AreaGraphSeries<DoubleDataPoint> inRangeAreaSeries;
|
||||
|
||||
DoubleDataPoint[] inRangeAreaDataPoints = new DoubleDataPoint[]{
|
||||
|
@ -102,14 +103,15 @@ public class GraphData {
|
|||
new DoubleDataPoint(toTime, lowLine, highLine)
|
||||
};
|
||||
inRangeAreaSeries = new AreaGraphSeries<>(inRangeAreaDataPoints);
|
||||
addSeriesWithoutInvalidate(bgGraph, inRangeAreaSeries);
|
||||
inRangeAreaSeries.setColor(0);
|
||||
inRangeAreaSeries.setDrawBackground(true);
|
||||
inRangeAreaSeries.setBackgroundColor(MainApp.sResources.getColor(R.color.inrangebackground));
|
||||
|
||||
addSeries(inRangeAreaSeries);
|
||||
}
|
||||
|
||||
// scale in % of vertical size (like 0.3)
|
||||
public void addBasals(GraphView bgGraph, long fromTime, long toTime, double scale) {
|
||||
public void addBasals(long fromTime, long toTime, double scale) {
|
||||
LineGraphSeries<ScaledDataPoint> basalsLineSeries;
|
||||
LineGraphSeries<ScaledDataPoint> absoluteBasalsLineSeries;
|
||||
LineGraphSeries<ScaledDataPoint> baseBasalsSeries;
|
||||
|
@ -194,7 +196,7 @@ public class GraphData {
|
|||
basalsLineSeries = new LineGraphSeries<>(basalLine);
|
||||
Paint paint = new Paint();
|
||||
paint.setStyle(Paint.Style.STROKE);
|
||||
paint.setStrokeWidth(MainApp.instance().getApplicationContext().getResources().getDisplayMetrics().scaledDensity*2);
|
||||
paint.setStrokeWidth(MainApp.instance().getApplicationContext().getResources().getDisplayMetrics().scaledDensity * 2);
|
||||
paint.setPathEffect(new DashPathEffect(new float[]{2, 4}, 0));
|
||||
paint.setColor(MainApp.sResources.getColor(R.color.basal));
|
||||
basalsLineSeries.setCustomPaint(paint);
|
||||
|
@ -204,19 +206,19 @@ public class GraphData {
|
|||
absoluteBasalsLineSeries = new LineGraphSeries<>(absoluteBasalLine);
|
||||
Paint absolutePaint = new Paint();
|
||||
absolutePaint.setStyle(Paint.Style.STROKE);
|
||||
absolutePaint.setStrokeWidth(MainApp.instance().getApplicationContext().getResources().getDisplayMetrics().scaledDensity*2);
|
||||
absolutePaint.setStrokeWidth(MainApp.instance().getApplicationContext().getResources().getDisplayMetrics().scaledDensity * 2);
|
||||
absolutePaint.setColor(MainApp.sResources.getColor(R.color.basal));
|
||||
absoluteBasalsLineSeries.setCustomPaint(absolutePaint);
|
||||
|
||||
basalScale.setMultiplier(maxY * scale / maxBasalValueFound);
|
||||
|
||||
addSeriesWithoutInvalidate(bgGraph, baseBasalsSeries);
|
||||
addSeriesWithoutInvalidate(bgGraph, tempBasalsSeries);
|
||||
addSeriesWithoutInvalidate(bgGraph, basalsLineSeries);
|
||||
addSeriesWithoutInvalidate(bgGraph, absoluteBasalsLineSeries);
|
||||
addSeries(baseBasalsSeries);
|
||||
addSeries(tempBasalsSeries);
|
||||
addSeries(basalsLineSeries);
|
||||
addSeries(absoluteBasalsLineSeries);
|
||||
}
|
||||
|
||||
public void addTreatments(GraphView bgGraph, long fromTime, long endTime) {
|
||||
public void addTreatments(long fromTime, long endTime) {
|
||||
List<DataPointWithLabelInterface> filteredTreatments = new ArrayList<>();
|
||||
|
||||
List<Treatment> treatments = MainApp.getConfigBuilder().getTreatmentsFromHistory();
|
||||
|
@ -262,9 +264,7 @@ public class GraphData {
|
|||
|
||||
DataPointWithLabelInterface[] treatmentsArray = new DataPointWithLabelInterface[filteredTreatments.size()];
|
||||
treatmentsArray = filteredTreatments.toArray(treatmentsArray);
|
||||
if (treatmentsArray.length > 0) {
|
||||
addSeriesWithoutInvalidate(bgGraph, new PointsWithLabelGraphSeries<>(treatmentsArray));
|
||||
}
|
||||
addSeries(new PointsWithLabelGraphSeries<>(treatmentsArray));
|
||||
}
|
||||
|
||||
double getNearestBg(long date) {
|
||||
|
@ -279,7 +279,7 @@ public class GraphData {
|
|||
}
|
||||
|
||||
// scale in % of vertical size (like 0.3)
|
||||
public void addIob(GraphView graph, long fromTime, long toTime, boolean useForScale, double scale) {
|
||||
public void addIob(long fromTime, long toTime, boolean useForScale, double scale) {
|
||||
FixedLineGraphSeries<ScaledDataPoint> iobSeries;
|
||||
List<ScaledDataPoint> iobArray = new ArrayList<>();
|
||||
Double maxIobValueFound = 0d;
|
||||
|
@ -310,11 +310,11 @@ public class GraphData {
|
|||
|
||||
iobScale.setMultiplier(maxY * scale / maxIobValueFound);
|
||||
|
||||
addSeriesWithoutInvalidate(graph, iobSeries);
|
||||
addSeries(iobSeries);
|
||||
}
|
||||
|
||||
// scale in % of vertical size (like 0.3)
|
||||
public void addCob(GraphView graph, long fromTime, long toTime, boolean useForScale, double scale) {
|
||||
public void addCob(long fromTime, long toTime, boolean useForScale, double scale) {
|
||||
FixedLineGraphSeries<ScaledDataPoint> cobSeries;
|
||||
List<ScaledDataPoint> cobArray = new ArrayList<>();
|
||||
Double maxCobValueFound = 0d;
|
||||
|
@ -349,11 +349,11 @@ public class GraphData {
|
|||
|
||||
cobScale.setMultiplier(maxY * scale / maxCobValueFound);
|
||||
|
||||
addSeriesWithoutInvalidate(graph, cobSeries);
|
||||
addSeries(cobSeries);
|
||||
}
|
||||
|
||||
// scale in % of vertical size (like 0.3)
|
||||
public void addDeviations(GraphView graph, long fromTime, long toTime, boolean useForScale, double scale) {
|
||||
public void addDeviations(long fromTime, long toTime, boolean useForScale, double scale) {
|
||||
class DeviationDataPoint extends ScaledDataPoint {
|
||||
public int color;
|
||||
|
||||
|
@ -396,11 +396,11 @@ public class GraphData {
|
|||
|
||||
devScale.setMultiplier(maxY * scale / maxDevValueFound);
|
||||
|
||||
addSeriesWithoutInvalidate(graph, devSeries);
|
||||
addSeries(devSeries);
|
||||
}
|
||||
|
||||
// scale in % of vertical size (like 0.3)
|
||||
public void addRatio(GraphView graph, long fromTime, long toTime, boolean useForScale, double scale) {
|
||||
public void addRatio(long fromTime, long toTime, boolean useForScale, double scale) {
|
||||
LineGraphSeries<DataPoint> ratioSeries;
|
||||
List<DataPoint> ratioArray = new ArrayList<>();
|
||||
Double maxRatioValueFound = 0d;
|
||||
|
@ -426,11 +426,11 @@ public class GraphData {
|
|||
|
||||
ratioScale.setMultiplier(maxY * scale / maxRatioValueFound);
|
||||
|
||||
addSeriesWithoutInvalidate(graph, ratioSeries);
|
||||
addSeries(ratioSeries);
|
||||
}
|
||||
|
||||
// scale in % of vertical size (like 0.3)
|
||||
public void addNowLine(GraphView graph, long now) {
|
||||
public void addNowLine(long now) {
|
||||
LineGraphSeries<DataPoint> seriesNow;
|
||||
DataPoint[] nowPoints = new DataPoint[]{
|
||||
new DataPoint(now, 0),
|
||||
|
@ -447,10 +447,10 @@ public class GraphData {
|
|||
paint.setColor(Color.WHITE);
|
||||
seriesNow.setCustomPaint(paint);
|
||||
|
||||
addSeriesWithoutInvalidate(graph, seriesNow);
|
||||
addSeries(seriesNow);
|
||||
}
|
||||
|
||||
public void formatAxis(GraphView graph, long fromTime, long endTime) {
|
||||
public void formatAxis(long fromTime, long endTime) {
|
||||
graph.getViewport().setMaxX(endTime);
|
||||
graph.getViewport().setMinX(fromTime);
|
||||
graph.getViewport().setXAxisBoundsManual(true);
|
||||
|
@ -458,11 +458,23 @@ public class GraphData {
|
|||
graph.getGridLabelRenderer().setNumHorizontalLabels(7); // only 7 because of the space
|
||||
}
|
||||
|
||||
private void addSeriesWithoutInvalidate(GraphView bgGraph, Series s) {
|
||||
if (!s.isEmpty()) {
|
||||
s.onGraphViewAttached(bgGraph);
|
||||
bgGraph.getSeries().add(s);
|
||||
}
|
||||
private void addSeries(Series s) {
|
||||
series.add(s);
|
||||
}
|
||||
|
||||
public void performUpdate() {
|
||||
// clear old data
|
||||
graph.getSeries().clear();
|
||||
|
||||
// add precalculated series
|
||||
for (Series s: series) {
|
||||
if (!s.isEmpty()) {
|
||||
s.onGraphViewAttached(graph);
|
||||
graph.getSeries().add(s);
|
||||
}
|
||||
}
|
||||
|
||||
// draw it
|
||||
graph.onDataChanged(false, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -243,6 +243,7 @@ public class WatchUpdaterService extends WearableListenerService implements
|
|||
|
||||
DataMap dataMap = new DataMap();
|
||||
dataMap.putString("sgvString", lastBG.valueToUnitsToString(units));
|
||||
dataMap.putString("glucoseUnits", units);
|
||||
dataMap.putLong("timestamp", lastBG.date);
|
||||
if (glucoseStatus == null) {
|
||||
dataMap.putString("slopeArrow", "");
|
||||
|
@ -253,7 +254,6 @@ public class WatchUpdaterService extends WearableListenerService implements
|
|||
dataMap.putString("delta", deltastring(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units));
|
||||
dataMap.putString("avgDelta", deltastring(glucoseStatus.avgdelta, glucoseStatus.avgdelta * Constants.MGDL_TO_MMOLL, units));
|
||||
}
|
||||
|
||||
dataMap.putLong("sgvLevel", sgvLevel);
|
||||
dataMap.putDouble("sgvDouble", lastBG.value);
|
||||
dataMap.putDouble("high", highLine);
|
||||
|
|
|
@ -111,6 +111,25 @@
|
|||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name=".watchfaces.Steampunk"
|
||||
android:allowEmbedded="true"
|
||||
android:label="AAPS(Steampunk)"
|
||||
android:permission="android.permission.BIND_WALLPAPER">
|
||||
<meta-data
|
||||
android:name="android.service.wallpaper"
|
||||
android:resource="@xml/watch_face" />
|
||||
<meta-data
|
||||
android:name="com.google.android.wearable.watchface.preview"
|
||||
android:resource="@drawable/watchface_steampunk" />
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||
|
||||
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name=".watchfaces.LargeHome"
|
||||
android:allowEmbedded="true"
|
||||
|
|
|
@ -21,6 +21,7 @@ import android.view.Display;
|
|||
import android.view.View;
|
||||
import android.view.WindowInsets;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
@ -44,15 +45,17 @@ import lecho.lib.hellocharts.view.LineChartView;
|
|||
|
||||
/**
|
||||
* Created by emmablack on 12/29/14.
|
||||
* Updated by andrew-warrington on 11/15/17.
|
||||
* Updated by andrew-warrington on 02-Jan-2018.
|
||||
*/
|
||||
|
||||
public abstract class BaseWatchFace extends WatchFace implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
public final static IntentFilter INTENT_FILTER;
|
||||
public static final long[] vibratePattern = {0,400,300,400,300,400};
|
||||
public TextView mTime, mSgv, mDirection, mTimestamp, mUploaderBattery, mRigBattery, mDelta, mAvgDelta, mStatus, mBasalRate, mIOB1, mIOB2, mCOB1, mCOB2, mBgi, mLoop, mDay, mMonth, isAAPSv2, mHighLight, mLowLight;
|
||||
public ImageView mGlucoseDial, mDeltaGauge, mHourHand, mMinuteHand;
|
||||
public long datetime;
|
||||
public RelativeLayout mRelativeLayout;
|
||||
public LinearLayout mLinearLayout, mLinearLayout2, mDate;
|
||||
public LinearLayout mLinearLayout, mLinearLayout2, mDate, mChartTap, mMainMenuTap;
|
||||
public long sgvLevel = 0;
|
||||
public int ageLevel = 1;
|
||||
public int loopLevel = 1;
|
||||
|
@ -85,6 +88,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
|||
|
||||
public boolean detailedIOB = false;
|
||||
public boolean showBGI = false;
|
||||
public boolean forceSquareCanvas = false; //set to true by the Steampunk watch face.
|
||||
public long openApsStatus;
|
||||
public String externalStatusString = "no status";
|
||||
public String sSgv = "---";
|
||||
|
@ -99,21 +103,24 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
|||
public String sCOB1 = "Carb";
|
||||
public String sCOB2 = "--g";
|
||||
public String sBgi = "--";
|
||||
public String sMinute = "0";
|
||||
public String sHour = "0";
|
||||
public String sUnits = "-";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE))
|
||||
.getDefaultDisplay();
|
||||
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
|
||||
display.getSize(displaySize);
|
||||
wakeLock = ((PowerManager) getSystemService(Context.POWER_SERVICE)).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Clock");
|
||||
|
||||
specW = View.MeasureSpec.makeMeasureSpec(displaySize.x,
|
||||
View.MeasureSpec.EXACTLY);
|
||||
specH = View.MeasureSpec.makeMeasureSpec(displaySize.y,
|
||||
View.MeasureSpec.EXACTLY);
|
||||
sharedPrefs = PreferenceManager
|
||||
.getDefaultSharedPreferences(this);
|
||||
specW = View.MeasureSpec.makeMeasureSpec(displaySize.x, View.MeasureSpec.EXACTLY);
|
||||
if (forceSquareCanvas) {
|
||||
specH = specW;
|
||||
} else {
|
||||
specH = View.MeasureSpec.makeMeasureSpec(displaySize.y, View.MeasureSpec.EXACTLY);
|
||||
}
|
||||
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
sharedPrefs.registerOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
|
@ -160,10 +167,17 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
|||
mRelativeLayout = (RelativeLayout) stub.findViewById(R.id.main_layout);
|
||||
mLinearLayout = (LinearLayout) stub.findViewById(R.id.secondary_layout);
|
||||
mLinearLayout2 = (LinearLayout) stub.findViewById(R.id.tertiary_layout);
|
||||
mGlucoseDial = (ImageView) stub.findViewById(R.id.glucose_dial);
|
||||
mDeltaGauge = (ImageView) stub.findViewById(R.id.delta_pointer);
|
||||
mHourHand = (ImageView) stub.findViewById(R.id.hour_hand);
|
||||
mMinuteHand = (ImageView) stub.findViewById(R.id.minute_hand);
|
||||
mChartTap = (LinearLayout) stub.findViewById(R.id.chart_zoom_tap);
|
||||
mMainMenuTap = (LinearLayout) stub.findViewById(R.id.main_menu_tap);
|
||||
chart = (LineChartView) stub.findViewById(R.id.chart);
|
||||
layoutSet = true;
|
||||
|
||||
setDataFields();
|
||||
setColor();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -214,7 +228,14 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
|||
protected void onDraw(Canvas canvas) {
|
||||
if (layoutSet) {
|
||||
setupCharts();
|
||||
this.mRelativeLayout.draw(canvas);
|
||||
|
||||
mRelativeLayout.measure(specW, specH);
|
||||
if (forceSquareCanvas) {
|
||||
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.x); //force a square for Steampunk watch face.
|
||||
} else {
|
||||
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.y);
|
||||
}
|
||||
mRelativeLayout.draw(canvas);
|
||||
Log.d("onDraw", "draw");
|
||||
}
|
||||
}
|
||||
|
@ -225,11 +246,16 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
|||
wakeLock.acquire(50);
|
||||
|
||||
setDataFields();
|
||||
setColor();
|
||||
missedReadingAlert();
|
||||
|
||||
mRelativeLayout.measure(specW, specH);
|
||||
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
|
||||
mRelativeLayout.getMeasuredHeight());
|
||||
if (forceSquareCanvas) {
|
||||
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.x); //force a square for Steampunk watch face.
|
||||
} else {
|
||||
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.y);
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -247,6 +273,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
|||
sDirection = dataMap.getString("slopeArrow");
|
||||
sDelta = dataMap.getString("delta");
|
||||
sAvgDelta = dataMap.getString("avgDelta");
|
||||
sUnits = dataMap.getString("glucoseUnits");
|
||||
if (chart != null) {
|
||||
addToWatchSet(dataMap);
|
||||
setupCharts();
|
||||
|
@ -273,6 +300,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
|||
}
|
||||
|
||||
setDataFields();
|
||||
setColor();
|
||||
|
||||
bundle = intent.getBundleExtra("basals");
|
||||
if (layoutSet && bundle != null) {
|
||||
|
@ -282,10 +310,12 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
|||
}
|
||||
|
||||
mRelativeLayout.measure(specW, specH);
|
||||
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
|
||||
mRelativeLayout.getMeasuredHeight());
|
||||
if (forceSquareCanvas) {
|
||||
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.x); //force a square for Steampunk watch face.
|
||||
} else {
|
||||
mRelativeLayout.layout(0, 0, displaySize.x, displaySize.y);
|
||||
}
|
||||
invalidate();
|
||||
setColor();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -476,15 +506,22 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
|||
public void setDateAndTime() {
|
||||
|
||||
final java.text.DateFormat timeFormat = DateFormat.getTimeFormat(BaseWatchFace.this);
|
||||
mTime.setText(timeFormat.format(System.currentTimeMillis()));
|
||||
if (mTime != null) {
|
||||
mTime.setText(timeFormat.format(System.currentTimeMillis()));
|
||||
}
|
||||
|
||||
Date now = new Date();
|
||||
SimpleDateFormat sdfHour = new SimpleDateFormat("HH");
|
||||
SimpleDateFormat sdfMinute = new SimpleDateFormat("mm");
|
||||
sHour = sdfHour.format(now);
|
||||
sMinute = sdfMinute.format(now);
|
||||
|
||||
if (mDate != null && mDay != null && mMonth != null) {
|
||||
if (sharedPrefs.getBoolean("show_date", false)) {
|
||||
Date today = new Date();
|
||||
SimpleDateFormat sdfDay = new SimpleDateFormat("dd");
|
||||
SimpleDateFormat sdfMonth = new SimpleDateFormat("MMM");
|
||||
mDay.setText(sdfDay.format(today));
|
||||
mMonth.setText(sdfMonth.format(today));
|
||||
mDay.setText(sdfDay.format(now));
|
||||
mMonth.setText(sdfMonth.format(now));
|
||||
mDate.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mDate.setVisibility(View.GONE);
|
||||
|
@ -534,6 +571,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
|||
|
||||
if(layoutSet){
|
||||
setDataFields();
|
||||
setColor();
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ public class BgGraphBuilder {
|
|||
|
||||
for (TempWatchData twd: tempWatchDataList) {
|
||||
if(twd.endTime > start_time) {
|
||||
lines.add(tempValuesLine(twd, (float) minChart, factor, false, highlight?3:2));
|
||||
lines.add(tempValuesLine(twd, (float) minChart, factor, false, highlight?(pointSize+1):pointSize));
|
||||
if(highlight){
|
||||
lines.add(tempValuesLine(twd, (float) minChart, factor, true, 1));
|
||||
}
|
||||
|
|
|
@ -0,0 +1,243 @@
|
|||
package info.nightscout.androidaps.watchfaces;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.wearable.watchface.WatchFaceStyle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.view.animation.RotateAnimation;
|
||||
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.interaction.menus.MainMenuActivity;
|
||||
|
||||
/**
|
||||
* Created by andrew-warrington on 01/12/2017.
|
||||
*/
|
||||
|
||||
public class Steampunk extends BaseWatchFace {
|
||||
|
||||
private long chartTapTime = 0;
|
||||
private long mainMenuTapTime = 0;
|
||||
private float lastEndDegrees = 0f;
|
||||
private float deltaRotationAngle = 0f;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
forceSquareCanvas = true;
|
||||
super.onCreate();
|
||||
LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
|
||||
layoutView = inflater.inflate(R.layout.activity_steampunk, null);
|
||||
performViewSetup();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTapCommand(int tapType, int x, int y, long eventTime) {
|
||||
|
||||
if (tapType == TAP_TYPE_TAP&&
|
||||
x >= mChartTap.getLeft() &&
|
||||
x <= mChartTap.getRight()&&
|
||||
y >= mChartTap.getTop() &&
|
||||
y <= mChartTap.getBottom()){
|
||||
if (eventTime - chartTapTime < 800){
|
||||
changeChartTimeframe();
|
||||
}
|
||||
chartTapTime = eventTime;
|
||||
|
||||
} else if (tapType == TAP_TYPE_TAP&&
|
||||
x >= mMainMenuTap.getLeft() &&
|
||||
x <= mMainMenuTap.getRight()&&
|
||||
y >= mMainMenuTap.getTop() &&
|
||||
y <= mMainMenuTap.getBottom()){
|
||||
if (eventTime - mainMenuTapTime < 800){
|
||||
Intent intent = new Intent(this, MainMenuActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
}
|
||||
mainMenuTapTime = eventTime;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WatchFaceStyle getWatchFaceStyle() {
|
||||
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
||||
}
|
||||
|
||||
protected void setColorDark() {
|
||||
|
||||
if (mLinearLayout2 != null) {
|
||||
if (ageLevel() <= 0) {
|
||||
mLinearLayout2.setBackgroundResource(R.drawable.redline);
|
||||
mTimestamp.setTextColor(getResources().getColor(R.color.red_600));
|
||||
} else {
|
||||
mLinearLayout2.setBackgroundResource(0);
|
||||
mTimestamp.setTextColor(getResources().getColor(R.color.black_86p));
|
||||
}
|
||||
}
|
||||
|
||||
if (mLoop != null) {
|
||||
if (loopLevel == 0) {
|
||||
mLoop.setTextColor(getResources().getColor(R.color.red_600));
|
||||
} else {
|
||||
mLoop.setTextColor(getResources().getColor(R.color.black_86p));
|
||||
}
|
||||
}
|
||||
|
||||
if (!sSgv.equals("---")) {
|
||||
|
||||
float rotationAngle = 0f; //by default, show ? on the dial (? is at 0 degrees on the dial)
|
||||
|
||||
if (!sUnits.equals("-")) {
|
||||
|
||||
//ensure the glucose dial is the correct units
|
||||
if (sUnits.equals("mmol")) {
|
||||
mGlucoseDial.setImageResource(R.drawable.steampunk_dial_mmol);
|
||||
} else {
|
||||
mGlucoseDial.setImageResource(R.drawable.steampunk_dial_mgdl);
|
||||
}
|
||||
|
||||
//convert the Sgv to degrees of rotation
|
||||
if (sUnits.equals("mmol")) {
|
||||
rotationAngle = Float.valueOf(sSgv) * 18f; //convert to mg/dL, which is equivalent to degrees
|
||||
} else {
|
||||
rotationAngle = Float.valueOf(sSgv); //if glucose a value is received, use it to determine the amount of rotation of the dial.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (rotationAngle > 330) rotationAngle = 330; //if the glucose value is higher than 330 then show "HIGH" on the dial. ("HIGH" is at 330 degrees on the dial)
|
||||
if (rotationAngle != 0 && rotationAngle < 30) rotationAngle = 30; //if the glucose value is lower than 30 show "LOW" on the dial. ("LOW" is at 30 degrees on the dial)
|
||||
|
||||
//rotate glucose dial
|
||||
RotateAnimation rotate = new RotateAnimation(
|
||||
lastEndDegrees, rotationAngle - lastEndDegrees,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f);
|
||||
rotate.setFillAfter(true);
|
||||
rotate.setInterpolator(new LinearInterpolator());
|
||||
rotate.setDuration(1);
|
||||
mGlucoseDial.startAnimation(rotate);
|
||||
lastEndDegrees = rotationAngle; //store the final angle as a starting point for the next rotation.
|
||||
}
|
||||
|
||||
//set the delta gauge and rotate the delta pointer
|
||||
float deltaIsNegative = 1f; //by default go clockwise
|
||||
if (!sAvgDelta.equals("--")) { //if a legitimate delta value is received, then...
|
||||
if (sAvgDelta.substring(0,1).equals("-")) deltaIsNegative = -1f; //if the delta is negative, go counter-clockwise
|
||||
|
||||
//ensure the delta gauge is the right units and granularity
|
||||
if (!sUnits.equals("-")) {
|
||||
if (sUnits.equals("mmol")) {
|
||||
if (sharedPrefs.getString("delta_granularity", "2").equals("1")) { //low
|
||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_10);
|
||||
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 30f); //get rid of the sign so it can be converted to float.
|
||||
}
|
||||
if (sharedPrefs.getString("delta_granularity", "2").equals("2")) { //medium
|
||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_05);
|
||||
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 60f); //get rid of the sign so it can be converted to float.
|
||||
}
|
||||
if (sharedPrefs.getString("delta_granularity", "2").equals("3")) { //high
|
||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_03);
|
||||
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 100f); //get rid of the sign so it can be converted to float.
|
||||
}
|
||||
} else {
|
||||
if (sharedPrefs.getString("delta_granularity", "2").equals("1")) { //low
|
||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_20);
|
||||
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 1.5f); //get rid of the sign so it can be converted to float.
|
||||
}
|
||||
if (sharedPrefs.getString("delta_granularity", "2").equals("2")) { //medium
|
||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_10);
|
||||
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 3f); //get rid of the sign so it can be converted to float.
|
||||
}
|
||||
if (sharedPrefs.getString("delta_granularity", "2").equals("3")) { //high
|
||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_5);
|
||||
deltaRotationAngle = (Float.valueOf(sAvgDelta.substring(1)) * 6f); //get rid of the sign so it can be converted to float.
|
||||
}
|
||||
}
|
||||
}
|
||||
if (deltaRotationAngle > 40) deltaRotationAngle = 40f;
|
||||
mDeltaGauge.setRotation(deltaRotationAngle * deltaIsNegative);
|
||||
}
|
||||
|
||||
//rotate the minute hand.
|
||||
mMinuteHand.setRotation(Float.valueOf(sMinute) * 6f);
|
||||
|
||||
//rotate the hour hand.
|
||||
mHourHand.setRotation((Float.valueOf(sHour) * 30f) + (Float.valueOf(sMinute) * 0.5f));
|
||||
|
||||
setTextSizes();
|
||||
|
||||
if (mLoop != null) {
|
||||
mLoop.setBackgroundResource(0);
|
||||
}
|
||||
|
||||
if (chart != null) {
|
||||
highColor = ContextCompat.getColor(getApplicationContext(), R.color.black);
|
||||
lowColor = ContextCompat.getColor(getApplicationContext(), R.color.black);
|
||||
midColor = ContextCompat.getColor(getApplicationContext(), R.color.black);
|
||||
gridColor = ContextCompat.getColor(getApplicationContext(), R.color.grey_steampunk);
|
||||
basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
||||
basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
||||
pointSize = 1;
|
||||
setupCharts();
|
||||
}
|
||||
|
||||
invalidate();
|
||||
|
||||
}
|
||||
|
||||
protected void setColorLowRes() {
|
||||
setColorDark();
|
||||
}
|
||||
|
||||
protected void setColorBright() {
|
||||
setColorDark();
|
||||
}
|
||||
|
||||
protected void setTextSizes() {
|
||||
|
||||
float fontSmall = 10f;
|
||||
float fontMedium = 11f;
|
||||
float fontLarge = 12f;
|
||||
|
||||
if (bIsRound) {
|
||||
fontSmall = 11f;
|
||||
fontMedium = 12f;
|
||||
fontLarge = 13f;
|
||||
}
|
||||
|
||||
//top row. large font unless text too big (i.e. detailedIOB)
|
||||
mCOB2.setTextSize(fontLarge);
|
||||
mBasalRate.setTextSize(fontLarge);
|
||||
if (sIOB2.length() < 7) {
|
||||
mIOB2.setTextSize(fontLarge);
|
||||
} else {
|
||||
mIOB2.setTextSize(fontSmall);
|
||||
}
|
||||
|
||||
//bottom row. font medium unless text too long (i.e. longer than 9' timestamp)
|
||||
if (mTimestamp.getText().length() < 3 || mLoop.getText().length() < 3) { //always resize these fields together, for symmetry.
|
||||
mTimestamp.setTextSize(fontMedium);
|
||||
mLoop.setTextSize(fontMedium);
|
||||
} else {
|
||||
mTimestamp.setTextSize(fontSmall);
|
||||
mLoop.setTextSize(fontSmall);
|
||||
}
|
||||
|
||||
//if both batteries are shown, make them smaller.
|
||||
if (sharedPrefs.getBoolean("show_uploader_battery", true) && sharedPrefs.getBoolean("show_rig_battery", false)) {
|
||||
mUploaderBattery.setTextSize(fontSmall);
|
||||
mRigBattery.setTextSize(fontSmall);
|
||||
} else {
|
||||
mUploaderBattery.setTextSize(fontMedium);
|
||||
mRigBattery.setTextSize(fontMedium);
|
||||
}
|
||||
}
|
||||
|
||||
private void changeChartTimeframe() {
|
||||
int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3"));
|
||||
timeframe = (timeframe%5) + 1;
|
||||
sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit();
|
||||
}
|
||||
|
||||
}
|
BIN
wear/src/main/res/drawable/redline.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
wear/src/main/res/drawable/steampunk_cover_plate.png
Normal file
After Width: | Height: | Size: 98 KiB |
BIN
wear/src/main/res/drawable/steampunk_dial_mgdl.png
Normal file
After Width: | Height: | Size: 140 KiB |
BIN
wear/src/main/res/drawable/steampunk_dial_mmol.png
Normal file
After Width: | Height: | Size: 107 KiB |
BIN
wear/src/main/res/drawable/steampunk_gauge_mgdl_10.png
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
wear/src/main/res/drawable/steampunk_gauge_mgdl_20.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
wear/src/main/res/drawable/steampunk_gauge_mgdl_5.png
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
wear/src/main/res/drawable/steampunk_gauge_mmol_03.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
wear/src/main/res/drawable/steampunk_gauge_mmol_05.png
Normal file
After Width: | Height: | Size: 63 KiB |
BIN
wear/src/main/res/drawable/steampunk_gauge_mmol_10.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
wear/src/main/res/drawable/steampunk_hour_hand.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
wear/src/main/res/drawable/steampunk_minute_hand.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
wear/src/main/res/drawable/steampunk_pointer.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
wear/src/main/res/drawable/watchface_steampunk.png
Normal file
After Width: | Height: | Size: 143 KiB |
12
wear/src/main/res/layout/activity_steampunk.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.wearable.view.WatchViewStub
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/watch_view_stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:rectLayout="@layout/rect_steampunk"
|
||||
app:roundLayout="@layout/round_steampunk"
|
||||
tools:context=".watchfaces.Cockpit"
|
||||
tools:deviceIds="wear"/>
|
381
wear/src/main/res/layout/rect_steampunk.xml
Normal file
|
@ -0,0 +1,381 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".watchfaces.Steampunk"
|
||||
tools:deviceIds="wear_square">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/glucose_dial"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/steampunk_dial_mgdl" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/secondary_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/steampunk_gauge_mgdl_20"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delta_pointer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0px"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.69"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/steampunk_pointer" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/main_menu_tap"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.7"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.05"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.26"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.2"
|
||||
android:gravity="center"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.16"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cobView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingTop="7dp"
|
||||
android:rotation="-28"
|
||||
android:text="--g"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.24"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tmpBasal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="12dp"
|
||||
android:rotation="-1"
|
||||
android:text="-.--U/h"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/iobView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingTop="6dp"
|
||||
android:rotation="28"
|
||||
android:text="0.00U"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.2"
|
||||
android:gravity="center"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/chart_zoom_tap"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.27"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.25"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<lecho.lib.hellocharts.view.LineChartView
|
||||
android:id="@+id/chart"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.25"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.03"
|
||||
android:orientation="vertical" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tertiary_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.15"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.21"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.32"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.12"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/loop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:rotation="-24"
|
||||
android:text="-'"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.12"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rig_battery"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="--%"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/uploader_battery"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="--%"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.12"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timestamp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingTop="8dp"
|
||||
android:rotation="24"
|
||||
android:text="-'"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.32"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.64"
|
||||
android:orientation="horizontal"></LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/cover_plate_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/steampunk_cover_plate"
|
||||
android:orientation="vertical">
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/hour_hand"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.3"
|
||||
android:orientation="vertical"
|
||||
android:rotation="0"
|
||||
android:src="@drawable/steampunk_hour_hand" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/minute_hand"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.3"
|
||||
android:orientation="vertical"
|
||||
android:src="@drawable/steampunk_minute_hand" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/AAPSv2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</RelativeLayout>
|
381
wear/src/main/res/layout/round_steampunk.xml
Normal file
|
@ -0,0 +1,381 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".watchfaces.Steampunk"
|
||||
tools:deviceIds="wear_round">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/glucose_dial"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/steampunk_dial_mgdl" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/secondary_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/steampunk_gauge_mgdl_20"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delta_pointer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0px"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.69"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/steampunk_pointer" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/main_menu_tap"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.7"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.05"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.26"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.2"
|
||||
android:gravity="center"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.165"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cobView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingTop="7dp"
|
||||
android:rotation="-28"
|
||||
android:text="--g"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.27"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tmpBasal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="14dp"
|
||||
android:rotation="0"
|
||||
android:text="-.--U/h"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.165"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/iobView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingTop="6dp"
|
||||
android:rotation="28"
|
||||
android:text="0.00U"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.2"
|
||||
android:gravity="center"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/chart_zoom_tap"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.27"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.25"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<lecho.lib.hellocharts.view.LineChartView
|
||||
android:id="@+id/chart"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.25"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.03"
|
||||
android:orientation="vertical" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tertiary_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.15"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.21"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.32"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.12"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/loop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:rotation="-24"
|
||||
android:text="-'"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.12"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rig_battery"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="--%"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/uploader_battery"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="--%"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.12"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timestamp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingTop="8dp"
|
||||
android:rotation="24"
|
||||
android:text="-'"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black_86p"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.32"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.64"
|
||||
android:orientation="horizontal"></LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/cover_plate_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/steampunk_cover_plate"
|
||||
android:orientation="vertical">
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/hour_hand"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.3"
|
||||
android:orientation="vertical"
|
||||
android:rotation="0"
|
||||
android:src="@drawable/steampunk_hour_hand" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/minute_hand"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="0.3"
|
||||
android:orientation="vertical"
|
||||
android:src="@drawable/steampunk_minute_hand" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/AAPSv2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</RelativeLayout>
|
|
@ -61,6 +61,7 @@
|
|||
<color name="grey_50">#FAFAFA</color>
|
||||
<color name="grey_300">#E0E0E0</color>
|
||||
<color name="grey_500">#9E9E9E</color>
|
||||
<color name="grey_steampunk">#333333</color>
|
||||
<!-- Grey -->
|
||||
|
||||
<!-- Blue Grey -->
|
||||
|
|
|
@ -20,6 +20,18 @@
|
|||
<item>5</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="delta_granularity">
|
||||
<item>Low</item>
|
||||
<item>Medium</item>
|
||||
<item>High</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="delta_granularity_values">
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="input_design">
|
||||
<item>Default</item>
|
||||
<item>Quick righty</item>
|
||||
|
|
|
@ -141,6 +141,14 @@
|
|||
android:summary="Input Design"
|
||||
android:title="Input Design" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="2"
|
||||
android:entries="@array/delta_granularity"
|
||||
android:entryValues="@array/delta_granularity_values"
|
||||
android:key="delta_granularity"
|
||||
android:summary="Delta Granularity (Steampunk)"
|
||||
android:title="Delta Granularity (Steampunk)" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="showBigNumbers"
|
||||
|
|