[UI] Implement home timetable card.

This commit is contained in:
Kuba Szczodrzyński
2019-11-25 22:15:36 +01:00
parent 7961a74995
commit 37f3d76fb8
9 changed files with 348 additions and 94 deletions

View File

@ -3,6 +3,8 @@ package pl.szczodrzynski.edziennik.utils.models;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import java.util.Calendar;
public class Time implements Comparable<Time> {
@ -114,6 +116,10 @@ public class Time implements Comparable<Time> {
return new Time(c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE), c.get(Calendar.SECOND));
}
public long getInUnix() {
return getInMillis() / 1000;
}
public int getValue()
{
return hour * 10000 + minute * 100 + second;
@ -202,4 +208,8 @@ public class Time implements Comparable<Time> {
result = 31 * result + second;
return result;
}
public long minus(@NotNull Time other) {
return getInUnix() - other.getInUnix();
}
}