Cleanup: ComboFragement.

This commit is contained in:
Johannes Mockenhaupt 2017-10-31 11:02:14 +01:00
parent 9121aa5217
commit 88f500417d
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -15,7 +15,6 @@ import com.squareup.otto.Subscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.jotomo.ruffy.spi.CommandResult;
import de.jotomo.ruffy.spi.PumpState;
import de.jotomo.ruffy.spi.history.Bolus;
import info.nightscout.androidaps.R;
@ -124,8 +123,6 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
}
// last connection
CommandResult lastCmdResult = plugin.getPump().lastCmdResult;
if (lastCmdResult != null) {
String minAgo = DateUtil.minAgo(plugin.getPump().lastSuccessfulConnection);
String time = DateUtil.timeString(plugin.getPump().lastSuccessfulConnection);
String timeAgo = getString(R.string.combo_last_connection_time, minAgo, time);
@ -158,9 +155,8 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
}
// TBR
boolean tbrActive = ps.tbrPercent != -1 && ps.tbrPercent != 100;
String tbrStr = "";
if (tbrActive) {
if (ps.tbrPercent != -1 && ps.tbrPercent != 100) {
long minSinceRead = (System.currentTimeMillis() - plugin.getPump().state.timestamp) / 1000 / 60;
long remaining = ps.tbrRemainingDuration - minSinceRead;
if (remaining >= 0) {
@ -169,7 +165,6 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
}
tempBasalText.setText(tbrStr);
}
}
});
}
}