Back to project page WearPomodoro.
The source code is released under:
GNU General Public License
If you think the Android project WearPomodoro listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Copyright (C) 2014 Alex Korovyansky./*www .ja va 2s .c o m*/ */ package com.alexkorovyansky.wearpomodoro.model; import com.alexkorovyansky.wearpomodoro.app.PomodoroConstants; public enum ActivityType { NONE(0), POMODORO(1), SHORT_BREAK(2), LONG_BREAK(3); private int value; private ActivityType(int value) { this.value = value; } public static ActivityType fromValue(int value) { for (ActivityType activityType: ActivityType.values()) { if (activityType.value() == value) { return activityType; } } return ActivityType.NONE; } public int value() { return value; } public boolean isBreak() { return this == SHORT_BREAK || this == LONG_BREAK; } public boolean isPomodoro() { return this == POMODORO; } public int getLengthMs() { switch (this) { case POMODORO: return PomodoroConstants.POMODORO_LENGTH_MS; case LONG_BREAK: return PomodoroConstants.LONG_BREAK_LENGTH_MS; case SHORT_BREAK: return PomodoroConstants.SHORT_BREAK_LENGTH_MS; default: throw new IllegalStateException(this + " has no length"); } } }