Cleanup: ComboFragement.
This commit is contained in:
parent
9121aa5217
commit
88f500417d
1 changed files with 40 additions and 45 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue