Back to project page RazorRunner-AndroidProject.
The source code is released under:
Apache License
If you think the Android project RazorRunner-AndroidProject listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package edu.uark.csce.razorrunner; /* w w w . j a va 2 s. co m*/ import java.util.ArrayList; /** * Created by Kai Tribble on 12/3/2014. */ public class StepDisplayer implements StepListener{ private int mCount = 0; PedometerSettings mSettings; ActivityUtils mUtils; public StepDisplayer(PedometerSettings settings, ActivityUtils utils) { mUtils = utils; mSettings = settings; notifyListener(); } public void setUtils(ActivityUtils utils) { mUtils = utils; } public void setSteps(int steps) { mCount = steps; notifyListener(); } public void onStep() { mCount ++; notifyListener(); } public void reloadSettings() { notifyListener(); } public void passValue() { } //----------------------------------------------------- // Listener public interface Listener { public void stepsChanged(int value); public void passValue(); } private ArrayList<Listener> mListeners = new ArrayList<Listener>(); public void addListener(Listener l) { mListeners.add(l); } public void notifyListener() { for (Listener listener : mListeners) { listener.stepsChanged((int) mCount); } } }