diff --git a/res/values/strings.xml b/res/values/strings.xml index a12956b4c..dd11ea0b5 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -150,7 +150,7 @@ Sort Reverse Times You\'ve Postponed: %d - (Turn off Astrid\'s Hints on the Preferences screen) + (You can turn off Astrid\'s Hints on the Settings screen) Postpone for how long? "Delete completed tasks older than # days:" diff --git a/src/com/timsu/astrid/activities/TaskListSubActivity.java b/src/com/timsu/astrid/activities/TaskListSubActivity.java index 42aac0ffe..091a88cfb 100644 --- a/src/com/timsu/astrid/activities/TaskListSubActivity.java +++ b/src/com/timsu/astrid/activities/TaskListSubActivity.java @@ -119,7 +119,7 @@ public class TaskListSubActivity extends SubActivity { private static final int SORTFLAG_FILTERHIDDEN = (1 << 6); private static final int HIDE_ADD_BTN_PORTRAIT = 4; private static final int HIDE_ADD_BTN_LANDSCPE = 2; - private static final float POSTPONE_STAT_PCT = 0.3f; + private static final float POSTPONE_STAT_PCT = 0.2f; // UI components private ListView listView; @@ -985,7 +985,7 @@ public class TaskListSubActivity extends SubActivity { if(Preferences.shouldShowNags(getParent())) { Random random = new Random(); final String nagText; - if(postponeCount == 0) + if(postponeCount == 1 || postponeCount == 5) nagText = r.getString(R.string.taskList_postpone_firsttime); else if(random.nextFloat() < POSTPONE_STAT_PCT) nagText = r.getString(R.string.taskList_postpone_count, diff --git a/src/com/timsu/astrid/utilities/Preferences.java b/src/com/timsu/astrid/utilities/Preferences.java index 68249c08f..ed453aa24 100644 --- a/src/com/timsu/astrid/utilities/Preferences.java +++ b/src/com/timsu/astrid/utilities/Preferences.java @@ -47,7 +47,7 @@ public class Preferences { editor.putString(r.getString(R.string.p_deadlineTime), "1"); } if(!prefs.contains(r.getString(R.string.p_postponecount))) { - editor.putString(r.getString(R.string.p_postponecount), "0"); + editor.putInt(r.getString(R.string.p_postponecount), 0); } if(!prefs.contains(r.getString(R.string.p_notif_defaultRemind))) { editor.putString(r.getString(R.string.p_notif_defaultRemind), "0"); @@ -175,8 +175,13 @@ public class Preferences { } /** gets # of times user has postponed a task */ - public static Integer getPostponeCount(Context context) { - return getIntegerValue(context, R.string.p_postponecount); + public static int getPostponeCount(Context context) { + try { + return getPrefs(context).getInt(context.getResources(). + getString(R.string.p_postponecount), 0); + } catch (ClassCastException e) { + return 0; + } } /** sets # of times user has postponed a task */