improve code style

This commit is contained in:
hlq07 2018-05-28 03:45:21 +08:00
parent 7c48e942dc
commit c76f504525
2 changed files with 17 additions and 17 deletions

View File

@ -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];
}
}
}

View File

@ -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);
}
}