mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-21 13:19:02 +00:00
Added isDue field support
This commit is contained in:
parent
d5daaf1bb6
commit
e8f04a218e
5 changed files with 13 additions and 5 deletions
|
|
@ -1 +1,2 @@
|
|||
ALTER TABLE Preferences ADD COLUMN dailyDueDefaultView bool;
|
||||
ALTER TABLE Preferences ADD COLUMN dailyDueDefaultView bool;
|
||||
|
||||
|
|
|
|||
1
Habitica/assets/migrations/Habitica/37.sql
Normal file
1
Habitica/assets/migrations/Habitica/37.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE Task ADD COLUMN isDue BOOLEAN;
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue