From e1ca0ca6207e06b0596b41334025026540eb453c Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Sat, 11 Jul 2015 06:47:42 -0500 Subject: [PATCH] Fix crashes --- build.gradle | 4 ++-- src/main/java/org/tasks/ui/DeadlineControlSet.java | 14 ++++---------- .../java/org/tasks/ui/ProgressDialogAsyncTask.java | 10 +++++++++- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 082314e8f..bcdcef536 100644 --- a/build.gradle +++ b/build.gradle @@ -27,8 +27,8 @@ android { buildToolsVersion "22.0.1" defaultConfig { - versionCode 369 - versionName "4.7.13" + versionCode 370 + versionName "4.7.14" minSdkVersion 7 targetSdkVersion 22 } diff --git a/src/main/java/org/tasks/ui/DeadlineControlSet.java b/src/main/java/org/tasks/ui/DeadlineControlSet.java index b75d89054..0ff91ab21 100644 --- a/src/main/java/org/tasks/ui/DeadlineControlSet.java +++ b/src/main/java/org/tasks/ui/DeadlineControlSet.java @@ -186,7 +186,7 @@ public class DeadlineControlSet extends TaskEditControlSetBase { } else { dueDateSpinner.setAlpha(1.0f); if (date < newDateTime().withMillisOfDay(0).getMillis()) { - dueDateSpinner.setBackground(activity.getResources().getDrawable(R.drawable.textfield_underline_red, activity.getTheme())); + dueDateSpinner.setBackgroundResource(R.drawable.textfield_underline_red); tv.setTextColor(activity.getResources().getColor(R.color.overdue)); } else { dueDateSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline)); @@ -198,7 +198,7 @@ public class DeadlineControlSet extends TaskEditControlSetBase { dueDateSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline)); tv.setTextColor(unsetColor); } else if (date < newDateTime().withMillisOfDay(0).getMillis()) { - dueDateSpinner.setBackground(activity.getResources().getDrawable(R.drawable.textfield_underline_red, activity.getTheme())); + dueDateSpinner.setBackgroundResource(R.drawable.textfield_underline_red); tv.setTextColor(activity.getResources().getColor(R.color.overdue)); } else { dueDateSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline)); @@ -247,7 +247,7 @@ public class DeadlineControlSet extends TaskEditControlSetBase { } else { dueTimeSpinner.setAlpha(1.0f); if (newDateTime(date).withMillisOfDay(time).isBeforeNow()) { - dueTimeSpinner.setBackground(activity.getResources().getDrawable(R.drawable.textfield_underline_red, activity.getTheme())); + dueTimeSpinner.setBackgroundResource(R.drawable.textfield_underline_red); tv.setTextColor(activity.getResources().getColor(R.color.overdue)); } else { dueTimeSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline)); @@ -259,19 +259,13 @@ public class DeadlineControlSet extends TaskEditControlSetBase { dueTimeSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline)); tv.setTextColor(unsetColor); } else if (newDateTime(date).withMillisOfDay(time).isBeforeNow()) { - dueTimeSpinner.setBackground(activity.getResources().getDrawable(R.drawable.textfield_underline_red, activity.getTheme())); + dueTimeSpinner.setBackgroundResource(R.drawable.textfield_underline_red); tv.setTextColor(activity.getResources().getColor(R.color.overdue)); } else { dueTimeSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline)); tv.setTextColor(themeColor); } } - - if (atLeastHoneycomb()) { - dueTimeSpinner.setAlpha(time == -1 ? 0.5f : 1.0f); - } else { - tv.setTextColor(time >= 0 ? themeColor : unsetColor); - } return tv; } diff --git a/src/main/java/org/tasks/ui/ProgressDialogAsyncTask.java b/src/main/java/org/tasks/ui/ProgressDialogAsyncTask.java index cf3452087..d0fdbc385 100644 --- a/src/main/java/org/tasks/ui/ProgressDialogAsyncTask.java +++ b/src/main/java/org/tasks/ui/ProgressDialogAsyncTask.java @@ -5,11 +5,15 @@ import android.app.ProgressDialog; import android.os.AsyncTask; import android.widget.Toast; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.tasks.R; import org.tasks.dialogs.DialogBuilder; public abstract class ProgressDialogAsyncTask extends AsyncTask { + private static final Logger log = LoggerFactory.getLogger(ProgressDialogAsyncTask.class); + ProgressDialog progressDialog; private Activity activity; private DialogBuilder dialogBuilder; @@ -28,7 +32,11 @@ public abstract class ProgressDialogAsyncTask extends AsyncTask