Merge pull request #302 from AdrianLxM/cleanups

Cleanups
This commit is contained in:
AdrianLxM 2017-07-21 16:46:48 +02:00 committed by GitHub
commit 6d1c0feeab
13 changed files with 14 additions and 29 deletions

View file

@ -51,7 +51,7 @@ public class TempTarget implements Interval {
return false; return false;
if (high != other.high) if (high != other.high)
return false; return false;
if (reason != other.reason) if (!Objects.equals(reason, other.reason))
return false; return false;
if (!Objects.equals(_id, other._id)) if (!Objects.equals(_id, other._id))
return false; return false;

View file

@ -83,7 +83,6 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
MainApp.bus().register(this); MainApp.bus().register(this);
PowerManager powerManager = (PowerManager) MainApp.instance().getApplicationContext().getSystemService(Context.POWER_SERVICE); PowerManager powerManager = (PowerManager) MainApp.instance().getApplicationContext().getSystemService(Context.POWER_SERVICE);
mWakeLock = powerManager.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "ConfigBuilderPlugin"); mWakeLock = powerManager.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "ConfigBuilderPlugin");
;
} }
@Override @Override

View file

@ -33,7 +33,7 @@ public class BroadcastStatus {
bundle.putInt("nsclientversioncode", MainApp.instance().getPackageManager().getPackageInfo(MainApp.instance().getPackageName(), 0).versionCode); bundle.putInt("nsclientversioncode", MainApp.instance().getPackageManager().getPackageInfo(MainApp.instance().getPackageName(), 0).versionCode);
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
}; }
bundle.putString("nightscoutversionname", NSClientService.nightscoutVersionName); bundle.putString("nightscoutversionname", NSClientService.nightscoutVersionName);
bundle.putInt("nightscoutversioncode", NSClientService.nightscoutVersionCode); bundle.putInt("nightscoutversioncode", NSClientService.nightscoutVersionCode);
bundle.putString("status", status.getData().toString()); bundle.putString("status", status.getData().toString());

View file

@ -207,8 +207,6 @@ public class NSSettingsStatus {
return ret; return ret;
} }
;
private Integer getIntegerOrNull(String key) { private Integer getIntegerOrNull(String key) {
Integer ret = null; Integer ret = null;
if (data.has(key)) { if (data.has(key)) {
@ -221,8 +219,6 @@ public class NSSettingsStatus {
return ret; return ret;
} }
;
private Long getLongOrNull(String key) { private Long getLongOrNull(String key) {
Long ret = null; Long ret = null;
if (data.has(key)) { if (data.has(key)) {
@ -235,8 +231,6 @@ public class NSSettingsStatus {
return ret; return ret;
} }
;
private Date getDateOrNull(String key) { private Date getDateOrNull(String key) {
Date ret = null; Date ret = null;
if (data.has(key)) { if (data.has(key)) {
@ -249,8 +243,6 @@ public class NSSettingsStatus {
return ret; return ret;
} }
;
private boolean getBooleanOrNull(String key) { private boolean getBooleanOrNull(String key) {
boolean ret = false; boolean ret = false;
if (data.has(key)) { if (data.has(key)) {

View file

@ -24,7 +24,7 @@ public class NSSgv {
} }
} }
return ret; return ret;
}; }
private Integer getIntegerOrNull(String key) { private Integer getIntegerOrNull(String key) {
Integer ret = null; Integer ret = null;
@ -36,7 +36,7 @@ public class NSSgv {
} }
} }
return ret; return ret;
}; }
private Long getLongOrNull(String key) { private Long getLongOrNull(String key) {
Long ret = null; Long ret = null;
@ -48,7 +48,7 @@ public class NSSgv {
} }
} }
return ret; return ret;
}; }
public JSONObject getData () { return data; } public JSONObject getData () { return data; }
public Integer getMgdl () { return getIntegerOrNull("mgdl"); } public Integer getMgdl () { return getIntegerOrNull("mgdl"); }

View file

@ -25,7 +25,7 @@ public class NSTreatment {
} }
} }
return ret; return ret;
}; }
private Double getDoubleOrNull(String key) { private Double getDoubleOrNull(String key) {
Double ret = null; Double ret = null;
@ -37,7 +37,7 @@ public class NSTreatment {
} }
} }
return ret; return ret;
}; }
private Integer getIntegerOrNull(String key) { private Integer getIntegerOrNull(String key) {
Integer ret = null; Integer ret = null;
@ -49,7 +49,7 @@ public class NSTreatment {
} }
} }
return ret; return ret;
}; }
private Long getLongOrNull(String key) { private Long getLongOrNull(String key) {
Long ret = null; Long ret = null;
@ -61,7 +61,7 @@ public class NSTreatment {
} }
} }
return ret; return ret;
}; }
private Date getDateOrNull(String key) { private Date getDateOrNull(String key) {
Date ret = null; Date ret = null;
@ -73,7 +73,7 @@ public class NSTreatment {
} }
} }
return ret; return ret;
}; }
public String getAction() { return action; } public String getAction() { return action; }
public JSONObject getData() { return data; } public JSONObject getData() { return data; }

View file

@ -43,7 +43,7 @@ public class DetermineBasalResultAMA extends APSResult {
} }
if (result.contains("duration")) { if (result.contains("duration")) {
duration = result.getInteger("duration"); duration = result.getInteger("duration");
changeRequested = changeRequested; //changeRequested as above
} else { } else {
duration = -1; duration = -1;
changeRequested = false; changeRequested = false;

View file

@ -41,7 +41,7 @@ public class DetermineBasalResultMA extends APSResult {
} }
if (result.contains("duration")) { if (result.contains("duration")) {
duration = result.getInteger("duration"); duration = result.getInteger("duration");
changeRequested = changeRequested; //changeRequested as above
} else { } else {
duration = -1; duration = -1;
changeRequested = false; changeRequested = false;

View file

@ -213,9 +213,7 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
bgTrendInsulin = (TextView) view.findViewById(R.id.treatments_wizard_bgtrendinsulin); bgTrendInsulin = (TextView) view.findViewById(R.id.treatments_wizard_bgtrendinsulin);
cobLayout = (LinearLayout) view.findViewById(R.id.treatments_wizard_cob_layout); cobLayout = (LinearLayout) view.findViewById(R.id.treatments_wizard_cob_layout);
cob = (TextView) view.findViewById(R.id.treatments_wizard_cob); cob = (TextView) view.findViewById(R.id.treatments_wizard_cob);
;
cobInsulin = (TextView) view.findViewById(R.id.treatments_wizard_cobinsulin); cobInsulin = (TextView) view.findViewById(R.id.treatments_wizard_cobinsulin);
;
bgCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bgcheckbox); bgCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bgcheckbox);
bolusIobCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bolusiobcheckbox); bolusIobCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bolusiobcheckbox);

View file

@ -434,7 +434,6 @@ public class CircadianPercentageProfileFragment extends Fragment {
if (i == 0) { if (i == 0) {
copyprevbutton.setVisibility(View.INVISIBLE); copyprevbutton.setVisibility(View.INVISIBLE);
;
} else { } else {
final int j = i; //needs to be final to be passed to inner class. final int j = i; //needs to be final to be passed to inner class.
copyprevbutton.setOnClickListener(new View.OnClickListener() { copyprevbutton.setOnClickListener(new View.OnClickListener() {

View file

@ -173,7 +173,7 @@ public class ActionStringHandler {
rTitle += " LOOP"; rTitle += " LOOP";
rMessage = "TARGETS:\n" + getTargetsStatus(); rMessage = "TARGETS:\n" + getTargetsStatus();
rMessage += "\n\n" + getLoopStatus(); rMessage += "\n\n" + getLoopStatus();
rMessage += "\n\nOAPS RESULT:\n" + getOAPSResultStatus();; rMessage += "\n\nOAPS RESULT:\n" + getOAPSResultStatus();
} }
} else if ("wizard".equals(act[0])) { } else if ("wizard".equals(act[0])) {

View file

@ -387,11 +387,10 @@
<string name="send_to_pump">ENVIAR A BOMBA</string> <string name="send_to_pump">ENVIAR A BOMBA</string>
<string name="short_avgdelta">Media corta delta</string> <string name="short_avgdelta">Media corta delta</string>
<string name="sms_bolus">Bolo:</string> <string name="sms_bolus">Bolo:</string>
<string name="sms_lastbg">Ultimo BG:</string> <string name="sms_lastbg">Último BG:</string>
<string name="sms_minago">%dmin antes</string> <string name="sms_minago">%dmin antes</string>
<string name="smscommunicator_bolusdelivered">Bolo %.2fU enviado correctamente</string> <string name="smscommunicator_bolusdelivered">Bolo %.2fU enviado correctamente</string>
<string name="target_range">Rango Objetivo:</string> <string name="target_range">Rango Objetivo:</string>
<string name="timeshift_hint"></string>
<string name="units">Unidades:</string> <string name="units">Unidades:</string>
<string name="error_only_numeric_digits_allowed">Sólo se permiten caracteres numéricos</string> <string name="error_only_numeric_digits_allowed">Sólo se permiten caracteres numéricos</string>
<string name="error_only_numeric_digits_range_allowed">Sólo se permiten dígitos en el rango %1$s - %2$s</string> <string name="error_only_numeric_digits_range_allowed">Sólo se permiten dígitos en el rango %1$s - %2$s</string>

View file

@ -4,9 +4,7 @@
<string name="it_lang">Italiano</string> <string name="it_lang">Italiano</string>
<string name="MM640g">MM640g</string> <string name="MM640g">MM640g</string>
<string name="absolute">assoluto</string> <string name="absolute">assoluto</string>
<string name="app_name"></string>
<string name="actions">azioni</string> <string name="actions">azioni</string>
<string name="actions_shortname"></string>
<string name="activity">attivita\'</string> <string name="activity">attivita\'</string>
<string name="adult">adulto</string> <string name="adult">adulto</string>
<string name="advancedsettings_title">settaggi avanzati</string> <string name="advancedsettings_title">settaggi avanzati</string>