Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ActivityAmount.java
Andreas Shimokawa 1d41f2f8e4 Refactoring
The notfification APIs now use NotificationSpec as their only parameter, which
contains all information (required and optional ones).
We no longer have separate methods and actions for SMS/EMAIL/GENERIC anymore.
The type of notification is important now, not how we received them technically.
2015-09-24 14:45:21 +02:00

44 lines
964 B
Java

package nodomain.freeyourgadget.gadgetbridge.model;
import android.content.Context;
public class ActivityAmount {
private int activityKind;
private short percent;
private long totalSeconds;
public ActivityAmount(int activityKind) {
this.activityKind = activityKind;
}
public void addSeconds(long seconds) {
totalSeconds += seconds;
}
public long getTotalSeconds() {
return totalSeconds;
}
public int getActivityKind() {
return activityKind;
}
public short getPercent() {
return percent;
}
public void setPercent(short percent) {
this.percent = percent;
}
public String getName(Context context) {
switch (activityKind) {
case ActivityKind.TYPE_DEEP_SLEEP:
return "Deep Sleep";
case ActivityKind.TYPE_LIGHT_SLEEP:
return "Light Sleep";
}
return "Activity";
}
}