First pass at hide until due time

pull/14/head
Sam Bosley 12 years ago
parent 1c1964a622
commit 2ce3030d29

@ -414,6 +414,7 @@ public final class Task extends RemoteModel {
public static final int HIDE_UNTIL_WEEK_BEFORE = 3;
public static final int HIDE_UNTIL_SPECIFIC_DAY = 4;
public static final int HIDE_UNTIL_SPECIFIC_DAY_TIME = 5;
public static final int HIDE_UNTIL_DUE_TIME = 6;
/**
* Creates due date for this task. If this due date has no time associated,
@ -487,6 +488,7 @@ public final class Task extends RemoteModel {
case HIDE_UNTIL_NONE:
return 0;
case HIDE_UNTIL_DUE:
case HIDE_UNTIL_DUE_TIME:
date = getValue(DUE_DATE);
break;
case HIDE_UNTIL_DAY_BEFORE:
@ -507,7 +509,7 @@ public final class Task extends RemoteModel {
return date;
Date hideUntil = new Date(date / 1000L * 1000L); // get rid of millis
if(setting != HIDE_UNTIL_SPECIFIC_DAY_TIME) {
if(setting != HIDE_UNTIL_SPECIFIC_DAY_TIME && setting != HIDE_UNTIL_DUE_TIME) {
hideUntil.setHours(0);
hideUntil.setMinutes(0);
hideUntil.setSeconds(0);

@ -412,6 +412,7 @@
<!-- hideUntil: labels for edit page. -->
<item>Never</item>
<item>Due date</item>
<item>Due time</item>
<item>Day before due</item>
<item>Week before due</item>
<item>Specific day/time</item>

@ -86,9 +86,10 @@ public class HideUntilControlSet extends PopupControlSet implements OnItemSelect
HideUntilValue[] values = new HideUntilValue[labels.length];
values[0] = new HideUntilValue(labels[0], Task.HIDE_UNTIL_NONE);
values[1] = new HideUntilValue(labels[1], Task.HIDE_UNTIL_DUE);
values[2] = new HideUntilValue(labels[2], Task.HIDE_UNTIL_DAY_BEFORE);
values[3] = new HideUntilValue(labels[3], Task.HIDE_UNTIL_WEEK_BEFORE);
values[4] = new HideUntilValue(labels[4], Task.HIDE_UNTIL_SPECIFIC_DAY, -1);
values[2] = new HideUntilValue(labels[2], Task.HIDE_UNTIL_DUE_TIME);
values[3] = new HideUntilValue(labels[3], Task.HIDE_UNTIL_DAY_BEFORE);
values[4] = new HideUntilValue(labels[4], Task.HIDE_UNTIL_WEEK_BEFORE);
values[5] = new HideUntilValue(labels[5], Task.HIDE_UNTIL_SPECIFIC_DAY, -1);
if(specificDate > 0) {
HideUntilValue[] updated = new HideUntilValue[values.length + 1];
@ -238,13 +239,13 @@ public class HideUntilControlSet extends PopupControlSet implements OnItemSelect
selection = 0;
date = 0;
} else if(date == dueTime) {
selection = 1;
selection = task.hasDueTime() ? 2 : 1;
date = 0;
} else if(date + DateUtilities.ONE_DAY == dueDay.getTime()) {
selection = 2;
selection = 3;
date = 0;
} else if(date + DateUtilities.ONE_WEEK == dueDay.getTime()) {
selection = 3;
selection = 4;
date = 0;
}

Loading…
Cancel
Save