Merge branch 'fix-careportalevent' into dev-wip
This commit is contained in:
commit
d7db19bf2d
2 changed files with 6 additions and 8 deletions
|
@ -87,7 +87,7 @@ public class CareportalEvent implements DataPointWithLabelInterface {
|
|||
}
|
||||
|
||||
public long getHoursFromStart() {
|
||||
return (System.currentTimeMillis() - date) / (60 * 1000);
|
||||
return (System.currentTimeMillis() - date) / (60 * 60 * 1000);
|
||||
}
|
||||
|
||||
public String age() {
|
||||
|
@ -98,13 +98,7 @@ public class CareportalEvent implements DataPointWithLabelInterface {
|
|||
return diff.get(TimeUnit.DAYS) + " " + MainApp.gs(R.string.days) + " " + diff.get(TimeUnit.HOURS) + " " + MainApp.gs(R.string.hours);
|
||||
}
|
||||
|
||||
public boolean isOlderThan(double hours) {
|
||||
Map<TimeUnit, Long> diff = computeDiff(date, System.currentTimeMillis());
|
||||
if(diff.get(TimeUnit.DAYS)*24 + diff.get(TimeUnit.HOURS) > hours)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
public boolean isOlderThan(double hours) { return getHoursFromStart() > hours; }
|
||||
|
||||
public String log() {
|
||||
return "CareportalEvent{" +
|
||||
|
|
|
@ -603,6 +603,10 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
String units = MainApp.getConfigBuilder().getProfileUnits();
|
||||
|
||||
FragmentManager manager = getFragmentManager();
|
||||
// try to fix https://fabric.io/nightscout3/android/apps/info.nightscout.androidaps/issues/5aca7a1536c7b23527eb4be7?time=last-seven-days
|
||||
// https://stackoverflow.com/questions/14860239/checking-if-state-is-saved-before-committing-a-fragmenttransaction
|
||||
if (manager.isStateSaved())
|
||||
return;
|
||||
switch (v.getId()) {
|
||||
case R.id.overview_accepttempbutton:
|
||||
onClickAcceptTemp();
|
||||
|
|
Loading…
Reference in a new issue