improve code style
This commit is contained in:
parent
7c48e942dc
commit
c76f504525
|
@ -59,14 +59,6 @@ public class TodoItem {
|
|||
"interview"
|
||||
};
|
||||
|
||||
public static String typeName(int type) {
|
||||
if (1 <= type && type < TYPE_NAME.length) {
|
||||
return TYPE_NAME[type];
|
||||
} else {
|
||||
return TYPE_NAME[0];
|
||||
}
|
||||
}
|
||||
|
||||
// endregion type constants
|
||||
|
||||
|
||||
|
@ -341,4 +333,13 @@ public class TodoItem {
|
|||
return ((Object) mId).hashCode();
|
||||
}
|
||||
|
||||
|
||||
public static String typeName(int type) {
|
||||
if (1 <= type && type < TYPE_NAME.length) {
|
||||
return TYPE_NAME[type];
|
||||
} else {
|
||||
return TYPE_NAME[0];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,17 +45,16 @@ public class ListTodoItemsStrategy {
|
|||
}
|
||||
|
||||
private void onClickSearch() {
|
||||
try {
|
||||
Calendar c1 = CalendarUtil.constructCalendar(
|
||||
fromDate.getText(), fromTime.getText()
|
||||
);
|
||||
Calendar c2 = CalendarUtil.constructCalendar(
|
||||
toDate.getText(), toTime.getText()
|
||||
);
|
||||
String fromString = fromDate + "/" + fromTime;
|
||||
String toString = toDate + "/" + toTime;
|
||||
|
||||
mPresenter.listTodoItemDuring(c1, c2);
|
||||
} catch (IllegalArgumentException e) {
|
||||
if (!CalendarUtil.isValidCalendarString(fromString) ||
|
||||
!CalendarUtil.isValidCalendarString(toString)) {
|
||||
mPresenter.showAlert(0, "滚");
|
||||
} else {
|
||||
Calendar c1 = CalendarUtil.constructCalendar(fromString);
|
||||
Calendar c2 = CalendarUtil.constructCalendar(toString);
|
||||
mPresenter.listTodoItemDuring(c1, c2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue