diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/OpenDatasetRequestMessage.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/OpenDatasetRequestMessage.kt index c0b0d3a92b..bc6e00f59a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/OpenDatasetRequestMessage.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/OpenDatasetRequestMessage.kt @@ -14,7 +14,7 @@ class OpenDatasetRequestMessage (val serialNumber : String): BaseMessage() { @Expose var deviceId: String = TidepoolUploader.PUMP_TYPE + ":" + serialNumber @Expose - var time = DateUtil.toISOAsUTC(DateUtil.now()) + var time: String = DateUtil.toISOAsUTC(DateUtil.now()) @Expose var timezoneOffset = (DateUtil.getTimeZoneOffsetMs() / T.mins(1).msecs()).toInt() @Expose @@ -23,7 +23,7 @@ class OpenDatasetRequestMessage (val serialNumber : String): BaseMessage() { @Expose var client = ClientInfo() @Expose - var computerTime = DateUtil.toISONoZone(DateUtil.now()) + var computerTime: String = DateUtil.toISONoZone(DateUtil.now()) @Expose var dataSetType = "continuous" @Expose @@ -37,7 +37,7 @@ class OpenDatasetRequestMessage (val serialNumber : String): BaseMessage() { @Expose var timeProcessing = "none" @Expose - var timezone = TimeZone.getDefault().id + var timezone: String = TimeZone.getDefault().id @Expose var version = BuildConfig.VERSION_NAME diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/ActivityGraph.java b/app/src/main/java/info/nightscout/androidaps/plugins/insulin/ActivityGraph.java index cb8dabdde5..ee682272a1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/ActivityGraph.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/insulin/ActivityGraph.java @@ -49,8 +49,8 @@ public class ActivityGraph extends GraphView { for (long time = 0; time <= hours * 60 * 60 * 1000; time += 5 * 60 * 1000L) { Iob iob = t.iobCalc(time, dia); - activityArray.add(new DataPoint(time / 60 / 1000, iob.activityContrib)); - iobArray.add(new DataPoint(time / 60 / 1000, iob.iobContrib)); + activityArray.add(new DataPoint(time / 60.0 / 1000, iob.activityContrib)); + iobArray.add(new DataPoint(time / 60.0 / 1000, iob.iobContrib)); } DataPoint[] activityDataPoints = new DataPoint[activityArray.size()]; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.java index 9f81d9306e..7e1ff541dd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.java @@ -155,7 +155,7 @@ public class SensitivityAAPSPlugin extends AbstractSensitivityPlugin { Arrays.sort(deviations); double percentile = IobCobCalculatorPlugin.percentile(deviations, 0.50); - double basalOff = percentile * (60 / 5) / sens; + double basalOff = percentile * (60.0 / 5.0) / sens; double ratio = 1 + (basalOff / profile.getMaxDailyBasal()); if (percentile < 0) { // sensitive diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.java index 27b1820735..d38489ea3b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.java @@ -159,7 +159,7 @@ public class SensitivityWeightedAveragePlugin extends AbstractSensitivityPlugin for (int i = 0; i < data.size(); i++) { long reversedWeigth = data.keyAt(i); double value = data.valueAt(i); - double weight = (hightestWeight - reversedWeigth) / 2; + double weight = (hightestWeight - reversedWeigth) / 2.0; weights += weight; weightedsum += weight * value; } diff --git a/core/src/main/java/info/nightscout/androidaps/db/TemporaryBasal.java b/core/src/main/java/info/nightscout/androidaps/db/TemporaryBasal.java index 660ec0ad0a..012016ee03 100644 --- a/core/src/main/java/info/nightscout/androidaps/db/TemporaryBasal.java +++ b/core/src/main/java/info/nightscout/androidaps/db/TemporaryBasal.java @@ -262,7 +262,7 @@ public class TemporaryBasal implements Interval, DbObjectBase { double dia = profile.getDia(); double dia_ago = time - dia * 60 * 60 * 1000; int aboutFiveMinIntervals = (int) Math.ceil(realDuration / 5d); - double tempBolusSpacing = realDuration / aboutFiveMinIntervals; + double tempBolusSpacing = (double) (realDuration / aboutFiveMinIntervals); for (long j = 0L; j < aboutFiveMinIntervals; j++) { // find middle of the interval diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/PointsWithLabelGraphSeries.java b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/PointsWithLabelGraphSeries.java index 8058a6eef6..edf003e859 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/PointsWithLabelGraphSeries.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/PointsWithLabelGraphSeries.java @@ -264,7 +264,7 @@ public class PointsWithLabelGraphSeries e Rect bounds = new Rect(); mPaint.getTextBounds(value.getLabel(), 0, value.getLabel().length(), bounds); mPaint.setStyle(Paint.Style.STROKE); - float px = endX + bounds.height() / 2; + float px = endX + bounds.height() / 2.0f; float py = (float) (graphHeight * ratY + bounds.width() + 10); canvas.save(); canvas.rotate(-90, px, py); diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java index 1717fbf662..7f46ba2fdf 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java @@ -98,8 +98,8 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre private String cobString = ""; private TextView statusView; - private long chartTapTime = 0l; - private long sgvTapTime = 0l; + private long chartTapTime = 0L; + private long sgvTapTime = 0L; @Override public void onCreate() { diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CircleWatchface.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/CircleWatchface.java index fffb0a555e..4813942e1f 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CircleWatchface.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/CircleWatchface.java @@ -216,7 +216,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh public String getMinutes() { String minutes = "--\'"; if (getDatetime() != 0) { - minutes = ((int) Math.floor((System.currentTimeMillis() - getDatetime()) / 60000)) + "\'"; + minutes = ((int) Math.floor((System.currentTimeMillis() - getDatetime()) / 60000.0)) + "\'"; } return minutes; } @@ -669,7 +669,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh } float offsetMultiplier = (((displaySize.x / 2f) - PADDING) / 12f); - float offset = (float) Math.max(1, Math.ceil((System.currentTimeMillis() - entry.timestamp) / (1000 * 60 * 5))); + float offset = (float) Math.max(1, Math.ceil((System.currentTimeMillis() - entry.timestamp) / (1000 * 60 * 5.0))); size = bgToAngle((float) entry.sgv); addArch(canvas, offset * offsetMultiplier + 10, color, (float) size); addArch(canvas, (float) size, offset * offsetMultiplier + 10, getBackgroundColor(), (float) (360 - size)); @@ -695,7 +695,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh barColor = darken(getLowColor(), .5); } float offsetMultiplier = (((displaySize.x / 2f) - PADDING) / 12f); - float offset = (float) Math.max(1, Math.ceil((System.currentTimeMillis() - entry.timestamp) / (1000 * 60 * 5))); + float offset = (float) Math.max(1, Math.ceil((System.currentTimeMillis() - entry.timestamp) / (1000 * 60 * 5.0))); size = bgToAngle((float) entry.sgv); addArch(canvas, offset * offsetMultiplier + 11, barColor, (float) size - 2); // Dark Color Bar addArch(canvas, (float) size - 2, offset * offsetMultiplier + 11, indicatorColor, 2f); // Indicator at end of bar diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/NOChart.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/NOChart.java index f799b0cf6e..0686c91bd9 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/NOChart.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/NOChart.java @@ -78,7 +78,7 @@ public class NOChart extends WatchFace implements SharedPreferences.OnSharedPref private String sgvString = "--"; private String externalStatusString = "no status"; private TextView statusView; - private long sgvTapTime = 0l; + private long sgvTapTime = 0L; @Override public void onCreate() {