Fix crash on Android 2.x

pull/324/merge 4.7.21
Alex Baker 10 years ago
parent e4cb84d0b5
commit 251d28ddf6

@ -28,8 +28,8 @@ android {
buildToolsVersion "23.0.1" buildToolsVersion "23.0.1"
defaultConfig { defaultConfig {
versionCode 376 versionCode 377
versionName "4.7.20" versionName "4.7.21"
minSdkVersion 7 minSdkVersion 7
targetSdkVersion 22 targetSdkVersion 22
} }

@ -184,26 +184,26 @@ public class DeadlineControlSet extends TaskEditControlSetBase {
if (atLeastHoneycomb()) { if (atLeastHoneycomb()) {
if (date == 0) { if (date == 0) {
dueDateSpinner.setAlpha(0.5f); dueDateSpinner.setAlpha(0.5f);
dueDateSpinner.setBackground(getThemedUnderline()); dueDateSpinner.setBackgroundDrawable(getThemedUnderline());
} else { } else {
dueDateSpinner.setAlpha(1.0f); dueDateSpinner.setAlpha(1.0f);
if (date < newDateTime().withMillisOfDay(0).getMillis()) { if (date < newDateTime().withMillisOfDay(0).getMillis()) {
dueDateSpinner.setBackground(getRedUnderline()); dueDateSpinner.setBackgroundDrawable(getRedUnderline());
tv.setTextColor(activity.getResources().getColor(R.color.overdue)); tv.setTextColor(activity.getResources().getColor(R.color.overdue));
} else { } else {
dueDateSpinner.setBackground(getThemedUnderline()); dueDateSpinner.setBackgroundDrawable(getThemedUnderline());
tv.setTextColor(themeColor); tv.setTextColor(themeColor);
} }
} }
} else { } else {
if (date == 0) { if (date == 0) {
dueDateSpinner.setBackground(getThemedUnderline()); dueDateSpinner.setBackgroundDrawable(getThemedUnderline());
tv.setTextColor(unsetColor); tv.setTextColor(unsetColor);
} else if (date < newDateTime().withMillisOfDay(0).getMillis()) { } else if (date < newDateTime().withMillisOfDay(0).getMillis()) {
dueDateSpinner.setBackground(getRedUnderline()); dueDateSpinner.setBackgroundDrawable(getRedUnderline());
tv.setTextColor(activity.getResources().getColor(R.color.overdue)); tv.setTextColor(activity.getResources().getColor(R.color.overdue));
} else { } else {
dueDateSpinner.setBackground(getThemedUnderline()); dueDateSpinner.setBackgroundDrawable(getThemedUnderline());
tv.setTextColor(themeColor); tv.setTextColor(themeColor);
} }
} }
@ -245,26 +245,26 @@ public class DeadlineControlSet extends TaskEditControlSetBase {
if (atLeastHoneycomb()) { if (atLeastHoneycomb()) {
if (time == -1) { if (time == -1) {
dueTimeSpinner.setAlpha(0.5f); dueTimeSpinner.setAlpha(0.5f);
dueTimeSpinner.setBackground(getThemedUnderline()); dueTimeSpinner.setBackgroundDrawable(getThemedUnderline());
} else { } else {
dueTimeSpinner.setAlpha(1.0f); dueTimeSpinner.setAlpha(1.0f);
if (newDateTime(date).withMillisOfDay(time).isBeforeNow()) { if (newDateTime(date).withMillisOfDay(time).isBeforeNow()) {
dueTimeSpinner.setBackground(getRedUnderline()); dueTimeSpinner.setBackgroundDrawable(getRedUnderline());
tv.setTextColor(activity.getResources().getColor(R.color.overdue)); tv.setTextColor(activity.getResources().getColor(R.color.overdue));
} else { } else {
dueTimeSpinner.setBackground(getThemedUnderline()); dueTimeSpinner.setBackgroundDrawable(getThemedUnderline());
tv.setTextColor(themeColor); tv.setTextColor(themeColor);
} }
} }
} else { } else {
if (time == -1) { if (time == -1) {
dueTimeSpinner.setBackground(getThemedUnderline()); dueTimeSpinner.setBackgroundDrawable(getThemedUnderline());
tv.setTextColor(unsetColor); tv.setTextColor(unsetColor);
} else if (newDateTime(date).withMillisOfDay(time).isBeforeNow()) { } else if (newDateTime(date).withMillisOfDay(time).isBeforeNow()) {
dueTimeSpinner.setBackground(getRedUnderline()); dueTimeSpinner.setBackgroundDrawable(getRedUnderline());
tv.setTextColor(activity.getResources().getColor(R.color.overdue)); tv.setTextColor(activity.getResources().getColor(R.color.overdue));
} else { } else {
dueTimeSpinner.setBackground(getThemedUnderline()); dueTimeSpinner.setBackgroundDrawable(getThemedUnderline());
tv.setTextColor(themeColor); tv.setTextColor(themeColor);
} }
} }

Loading…
Cancel
Save