From d5ae4b7ec947bf96b9e40ce438dc466f2c20114b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Mon, 20 Jan 2020 19:30:20 +0100 Subject: [PATCH] [Home/Grades] Remove filtering grades by semester. --- .../java/pl/szczodrzynski/edziennik/data/db/dao/GradeDao.java | 4 ++-- .../edziennik/ui/modules/home/cards/HomeGradesCard.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/dao/GradeDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/dao/GradeDao.java index f5aa5f48..137df85d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/dao/GradeDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/dao/GradeDao.java @@ -152,7 +152,7 @@ public abstract class GradeDao { } } - public LiveData> getAllFromDate(int profileId, int semester, long date) { - return getAllWhere(profileId, "gradeSemester = " + semester + " AND addedDate > " + date); + public LiveData> getAllFromDate(int profileId, long date) { + return getAllWhere(profileId, "addedDate > " + date); } } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeGradesCard.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeGradesCard.kt index 51c9d208..8c885e54 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeGradesCard.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeGradesCard.kt @@ -69,7 +69,7 @@ class HomeGradesCard( val sevenDaysAgo = System.currentTimeMillis() - 7 * 24 * 60 * 60 * 1000 - app.db.gradeDao().getAllFromDate(profile.id, profile.currentSemester, sevenDaysAgo).observe(fragment, Observer { + app.db.gradeDao().getAllFromDate(profile.id, sevenDaysAgo).observe(fragment, Observer { grades.apply { clear() addAll(it)