mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-13 10:31:03 +01:00
1d41f2f8e4
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.
44 lines
964 B
Java
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";
|
|
}
|
|
}
|