From 20263c9fe485f5e757a3eb53d1cb324983a8a568 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 2 May 2018 13:17:57 +0200 Subject: [PATCH] remove other gs helper methods --- .../plugins/PumpInsight/connector/Connector.java | 2 +- .../plugins/PumpInsight/history/LiveHistory.java | 6 +----- .../plugins/PumpInsight/utils/Helpers.java | 16 ++++++---------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/connector/Connector.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/connector/Connector.java index 6a380067e4..b764c62c94 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/connector/Connector.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/connector/Connector.java @@ -221,7 +221,7 @@ public class Connector { public static String getKeepAliveString() { if (keepAliveActive()) { - return MainApp.instance().getString(R.string.insight_keepalive_format_string, + return MainApp.gs(R.string.insight_keepalive_format_string, stayConnectedTime / 1000, Helpers.hourMinuteSecondString(stayConnectedTill)); } else { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/history/LiveHistory.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/history/LiveHistory.java index ca3848e113..46af6bda98 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/history/LiveHistory.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/history/LiveHistory.java @@ -17,7 +17,7 @@ public class LiveHistory { public static String getStatus() { if (status.equals("")) return status; - return status + " " + Helpers.niceTimeScalar(Helpers.msSince(status_time)) + " " + gs(R.string.ago); + return status + " " + Helpers.niceTimeScalar(Helpers.msSince(status_time)) + " " + MainApp.gs(R.string.ago); } public static long getStatusTime() { @@ -30,8 +30,4 @@ public class LiveHistory { status = mystatus; } } - - private static String gs(int id) { - return MainApp.instance().getString(id); - } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/utils/Helpers.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/utils/Helpers.java index a2abda40d7..344bf638b2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/utils/Helpers.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/utils/Helpers.java @@ -96,32 +96,28 @@ public class Helpers { } public static String niceTimeScalar(long t) { - String unit = gs(R.string.second); + String unit = MainApp.gs(R.string.second); t = t / 1000; if (t > 59) { - unit = gs(R.string.minute); + unit = MainApp.gs(R.string.minute); t = t / 60; if (t > 59) { - unit = gs(R.string.hour); + unit = MainApp.gs(R.string.hour); t = t / 60; if (t > 24) { - unit = gs(R.string.day); + unit = MainApp.gs(R.string.day); t = t / 24; if (t > 28) { - unit = gs(R.string.week); + unit = MainApp.gs(R.string.week); t = t / 7; } } } } - if (t != 1) unit = unit + gs(R.string.time_plural); + if (t != 1) unit = unit + MainApp.gs(R.string.time_plural); return qs((double) t, 0) + " " + unit; } - private static String gs(int id) { - return MainApp.instance().getString(id); - } - public static String qs(double x, int digits) { if (digits == -1) {