Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
tolot27 committed May 16, 2021
2 parents ab2d379 + 84e4376 commit dd03077
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public boolean sessionInProgress() {
}

public long getRealSessionStartTime(long now) {
return now - ((currentTime - sessionStartTime) * 1000);
return now - ((currentTime - sessionStartTime) * 1000L);
}

public long getRealSessionStartTime() {
Expand Down
20 changes: 10 additions & 10 deletions app/src/main/java/com/eveningoutpost/dexdrip/StopSensor.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
import com.eveningoutpost.dexdrip.UtilityModels.Inevitable;
import com.eveningoutpost.dexdrip.UtilityModels.NanoStatus;
import com.eveningoutpost.dexdrip.calibrations.PluggableCalibration;
import com.eveningoutpost.dexdrip.ui.dialog.GenericConfirmDialog;
import com.eveningoutpost.dexdrip.utils.ActivityWithMenu;

import lombok.val;

import static com.eveningoutpost.dexdrip.xdrip.gs;

public class StopSensor extends ActivityWithMenu {
Expand All @@ -43,17 +47,13 @@ public String getMenuName() {
}

public void addListenerOnButton() {

button = (Button)findViewById(R.id.stop_sensor);

button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
stop();
JoH.startActivity(Home.class);
finish();
}

});
val activity = this;
button.setOnClickListener(v -> GenericConfirmDialog.show(activity, gs(R.string.are_you_sure), "Do you want to stop this sensor session?", () -> {
stop();
JoH.startActivity(Home.class);
finish();
}));
}

public synchronized static void stop() {
Expand Down

0 comments on commit dd03077

Please sign in to comment.