Added isDue field support

This commit is contained in:
Keith Holliday 2017-04-07 11:07:40 -06:00
parent d5daaf1bb6
commit e8f04a218e
5 changed files with 13 additions and 5 deletions

View file

@ -1 +1,2 @@
ALTER TABLE Preferences ADD COLUMN dailyDueDefaultView bool;
ALTER TABLE Preferences ADD COLUMN dailyDueDefaultView bool;

View file

@ -0,0 +1 @@
ALTER TABLE Task ADD COLUMN isDue BOOLEAN;

View file

@ -7,7 +7,7 @@ public class HabitDatabase {
public static final String NAME = "Habitica";
public static final int VERSION = 36;
public static final int VERSION = 37;
public HabitDatabase() {
super();

View file

@ -42,7 +42,7 @@ public class NotificationPublisher extends BroadcastReceiver {
.queryList();
show_notification = false;
for (Task task : dailies) {
if (task.isDue(0)) {
if (task.checkIfDue(0)) {
show_notification = true;
break;
}

View file

@ -107,6 +107,9 @@ public class Task extends BaseModel {
@SerializedName("_id")
String id;
@Column
public Boolean isDue;
/**
* @return the id
*/
@ -568,7 +571,7 @@ public class Task extends BaseModel {
return R.color.best_10;
}
public Boolean isDue(int offset) {
public Boolean checkIfDue(int offset) {
if (this.getCompleted()) {
return true;
}
@ -608,7 +611,10 @@ public class Task extends BaseModel {
}
public Boolean isDisplayedActive(int offset) {
return this.isDue(offset) && !this.completed;
if (this.isDue != null) {
return this.isDue;
}
return this.checkIfDue(offset) && !this.completed;
}
public Boolean isChecklistDisplayActive(int offset) {