You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pedometer.Stop is just a call to Pedometer.Pause. Having two separate buttons for this implies different functionality. I propose that we simply remove the "Stop" function and all current uses of Stop can just become calls to Pause.
Similarly, "Resume"....is a call to Start. Resume should probably be removed as well.
public void Start() {
if (pedometerPaused) {
pedometerPaused = false;
sensorManager.registerListener(this,
sensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER).get(0),
SensorManager.SENSOR_DELAY_FASTEST);
startTime = System.currentTimeMillis();
}
}
/**
* Stops the pedometer.
*/
@SimpleFunction(description = "Stop counting steps")
public void Stop() {
Pause();
}
/**
* Resumes the counting of steps.
*/
@SimpleFunction(description = "Resumes counting, synonym of Start.")
public void Resume() {
Start();
}
/**
* Pauses the counting of steps.
*/
@SimpleFunction(description = "Pause counting of steps and distance.")
public void Pause() {
if (!pedometerPaused) {
pedometerPaused = true;
sensorManager.unregisterListener(this);
Log.d(TAG, "Unregistered listener on pause");
prevStopClockTime += (System.currentTimeMillis() - startTime);
}
}
The text was updated successfully, but these errors were encountered:
We should think about what we want the verbs to be. I think nixing Stop/Resume and leaving us with Start/Pause is not good. We either should agree to Start/Stop or Resume/Pause. I think the former is the better choice.
Pedometer.Stop is just a call to Pedometer.Pause. Having two separate buttons for this implies different functionality. I propose that we simply remove the "Stop" function and all current uses of Stop can just become calls to Pause.
Similarly, "Resume"....is a call to Start. Resume should probably be removed as well.
The text was updated successfully, but these errors were encountered: