diff --git a/app/build.gradle b/app/build.gradle index 9bf4db43b8..e4ddb5ef71 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,9 +9,17 @@ buildscript { classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2' } } -apply plugin: 'com.android.application' -apply plugin: 'io.fabric' -apply plugin: 'jacoco-android' +apply plugin: "com.android.application" +apply plugin: "io.fabric" +apply plugin: "jacoco-android" + +ext { + supportLibraryVersion = "23.4.0" + ormLiteVersion = "4.46" + powermockVersion = "1.7.3" + dexmakerVersion = "1.2" +} + repositories { maven { url 'https://maven.fabric.io/public' } @@ -154,56 +162,58 @@ allprojects { dependencies { wearApp project(':wear') - - compile fileTree(include: ['*.jar'], dir: 'libs') - compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') { - transitive = true; - } - compile('com.crashlytics.sdk.android:answers:1.3.12@aar') { - transitive = true; - } - - compile 'com.android.support:appcompat-v7:23.4.0' - compile 'com.android.support:support-v4:23.4.0' - compile 'com.android.support:cardview-v7:23.4.0' - compile 'com.android.support:recyclerview-v7:23.4.0' - compile 'com.android.support:gridlayout-v7:23.4.0' - compile "com.android.support:design:23.4.0" - compile "com.android.support:percent:23.4.0" - compile 'com.wdullaer:materialdatetimepicker:2.3.0' - compile 'com.squareup:otto:1.3.7' - compile 'com.j256.ormlite:ormlite-core:4.46' - compile 'com.j256.ormlite:ormlite-android:4.46' - compile('com.github.tony19:logback-android-classic:1.1.1-6') { - exclude group: 'com.google.android', module: 'android' - } - compile 'org.apache.commons:commons-lang3:3.6' - compile 'org.slf4j:slf4j-api:1.7.12' - compile 'com.jjoe64:graphview:4.0.1' - compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.1' - compile 'com.google.android.gms:play-services-wearable:7.5.0' - compile 'junit:junit:4.12' - testCompile 'org.json:json:20140107' - testCompile 'org.mockito:mockito-core:2.7.22' - testCompile 'org.powermock:powermock-api-mockito2:1.7.3' - testCompile 'org.powermock:powermock-module-junit4-rule-agent:1.7.3' - testCompile 'org.powermock:powermock-module-junit4-rule:1.7.3' - testCompile 'org.powermock:powermock-module-junit4:1.7.3' - androidTestCompile 'org.mockito:mockito-core:2.7.22' - androidTestCompile 'com.google.dexmaker:dexmaker:1.2' - androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2' - compile(name: 'android-edittext-validator-v1.3.4-mod', ext: 'aar') - compile('com.google.android:flexbox:0.3.0') { - exclude group: 'com.android.support' - } - compile('io.socket:socket.io-client:0.8.3') { - // excluding org.json which is provided by Android - exclude group: 'org.json', module: 'json' - } - compile 'com.google.code.gson:gson:2.7' - compile 'com.google.guava:guava:20.0' compile project(path: ':ruffyscripter') - compile 'net.danlew:android.joda:2.9.9.1' - testCompile 'joda-time:joda-time:2.9.4.2' + compile fileTree(include: ['*.jar'], dir: 'libs') + compile("com.crashlytics.sdk.android:crashlytics:2.6.7@aar") { + transitive = true; + } + compile("com.crashlytics.sdk.android:answers:1.3.12@aar") { + transitive = true; + } + + compile "com.android.support:appcompat-v7:${supportLibraryVersion}" + compile "com.android.support:support-v4:${supportLibraryVersion}" + compile "com.android.support:cardview-v7:${supportLibraryVersion}" + compile "com.android.support:recyclerview-v7:${supportLibraryVersion}" + compile "com.android.support:gridlayout-v7:${supportLibraryVersion}" + compile "com.android.support:design:${supportLibraryVersion}" + compile "com.android.support:percent:${supportLibraryVersion}" + compile "com.wdullaer:materialdatetimepicker:2.3.0" + compile "com.squareup:otto:1.3.7" + compile "com.j256.ormlite:ormlite-core:${ormLiteVersion}" + compile "com.j256.ormlite:ormlite-android:${ormLiteVersion}" + compile("com.github.tony19:logback-android-classic:1.1.1-6") { + exclude group: "com.google.android", module: "android" + } + compile "org.apache.commons:commons-lang3:3.6" + compile "org.slf4j:slf4j-api:1.7.12" + compile "com.jjoe64:graphview:4.0.1" + compile "com.joanzapata.iconify:android-iconify-fontawesome:2.1.1" + compile "com.google.android.gms:play-services-wearable:7.5.0" + compile(name: "android-edittext-validator-v1.3.4-mod", ext: "aar") + compile("com.google.android:flexbox:0.3.0") { + exclude group: "com.android.support" + } + compile("io.socket:socket.io-client:0.8.3") { + // excluding org.json which is provided by Android + exclude group: "org.json", module: "json" + } + compile "com.google.code.gson:gson:2.7" + compile "com.google.guava:guava:20.0" + + compile "net.danlew:android.joda:2.9.9.1" + + testCompile "junit:junit:4.12" + testCompile "org.json:json:20140107" + testCompile "org.mockito:mockito-core:2.7.22" + testCompile "org.powermock:powermock-api-mockito2:${powermockVersion}" + testCompile "org.powermock:powermock-module-junit4-rule-agent:${powermockVersion}" + testCompile "org.powermock:powermock-module-junit4-rule:${powermockVersion}" + testCompile "org.powermock:powermock-module-junit4:${powermockVersion}" + testCompile "joda-time:joda-time:2.9.4.2" + + androidTestCompile "org.mockito:mockito-core:2.7.22" + androidTestCompile "com.google.dexmaker:dexmaker:${dexmakerVersion}" + androidTestCompile "com.google.dexmaker:dexmaker-mockito:${dexmakerVersion}" } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index 03f0f60341..62848b7e5e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -631,7 +631,7 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr @Override @Nullable public TemporaryBasal getTempBasalFromHistory(long time) { - return activeTreatments.getTempBasalFromHistory(time); + return activeTreatments != null ? activeTreatments.getTempBasalFromHistory(time) : null; } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Persistentnotification/PersistentNotificationPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Persistentnotification/PersistentNotificationPlugin.java index dc67a1449d..9e631def18 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Persistentnotification/PersistentNotificationPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Persistentnotification/PersistentNotificationPlugin.java @@ -139,8 +139,8 @@ public class PersistentNotificationPlugin implements PluginBase { } } - if (MainApp.getConfigBuilder().isTempBasalInProgress()) { - TemporaryBasal activeTemp = MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis()); + TemporaryBasal activeTemp = MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis()); + if (activeTemp != null) { line1 += " " + activeTemp.toStringShort(); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java index 8f0dca4996..1cd45d9f03 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java @@ -403,8 +403,10 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface { @Override public double getTempBasalRemainingMinutesFromHistory() { - if (isTempBasalInProgress()) - return getTempBasalFromHistory(System.currentTimeMillis()).getPlannedRemainingMinutes(); + TemporaryBasal activeTemp = getTempBasalFromHistory(System.currentTimeMillis()); + if (activeTemp != null) { + return activeTemp.getPlannedRemainingMinutes(); + } return 0; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java index 60d784d377..5fb902c2eb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java @@ -182,10 +182,9 @@ public class StatuslinePlugin implements PluginBase { //Temp basal TreatmentsInterface treatmentsInterface = MainApp.getConfigBuilder(); - if (treatmentsInterface.isTempBasalInProgress()) { - TemporaryBasal activeTemp = treatmentsInterface.getTempBasalFromHistory(System.currentTimeMillis()); + TemporaryBasal activeTemp = treatmentsInterface.getTempBasalFromHistory(System.currentTimeMillis()); + if (activeTemp != null) { status += activeTemp.toStringShort(); - } //IOB diff --git a/wear/build.gradle b/wear/build.gradle index 0f98aff25d..7c7e2d7c49 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -1,5 +1,10 @@ apply plugin: 'com.android.application' +ext { + supportLibraryVersion = "23.0.1" + wearableVersion = "2.0.1" +} + def generateGitBuild = { -> StringBuilder stringBuilder = new StringBuilder(); @@ -60,12 +65,12 @@ allprojects { dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') - //compile 'com.ustwo.android:clockwise-wearable:1.0.2' - provided 'com.google.android.wearable:wearable:2.0.1' - compile 'com.google.android.support:wearable:2.0.1' - compile 'com.google.android.gms:play-services-wearable:7.3.0' - compile files('libs/hellocharts-library-1.5.5.jar') - compile(name:'ustwo-clockwise-debug', ext:'aar') - compile 'com.android.support:support-v4:23.0.1' - compile 'me.denley.wearpreferenceactivity:wearpreferenceactivity:0.5.0' + compile files("libs/hellocharts-library-1.5.5.jar") + //compile "com.ustwo.android:clockwise-wearable:1.0.2" + provided "com.google.android.wearable:wearable:${wearableVersion}" + compile "com.google.android.support:wearable:${wearableVersion}" + compile "com.google.android.gms:play-services-wearable:7.3.0" + compile(name:"ustwo-clockwise-debug", ext:"aar") + compile "com.android.support:support-v4:23.0.1" + compile "me.denley.wearpreferenceactivity:wearpreferenceactivity:0.5.0" } diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java index 06f50edfb0..3549b2a67d 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java @@ -178,7 +178,11 @@ public class Steampunk extends BaseWatchFace { 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; + if (Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3")) < 3) { + pointSize = 2; + } else { + pointSize = 1; + } setupCharts(); } @@ -237,7 +241,12 @@ public class Steampunk extends BaseWatchFace { private void changeChartTimeframe() { int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3")); timeframe = (timeframe%5) + 1; + if (timeframe < 3) { + pointSize = 2; + } else { + pointSize = 1; + } + setupCharts(); sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit(); } - } \ No newline at end of file