Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pedometer Pause = Pedometer Stop #968

Closed
farxinu opened this issue Oct 23, 2017 · 3 comments
Closed

Pedometer Pause = Pedometer Stop #968

farxinu opened this issue Oct 23, 2017 · 3 comments

Comments

@farxinu
Copy link
Contributor

farxinu commented Oct 23, 2017

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);
    }
  }
@moliata
Copy link
Contributor

moliata commented Oct 24, 2017

Agree with this, plus you some good points.

@ewpatton
Copy link
Member

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.

@moliata
Copy link
Contributor

moliata commented Oct 28, 2017

I am staying with Start and Stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants