diff --git a/astrid/assets/subtasks_horizontal.png b/astrid/assets/subtasks_horizontal.png new file mode 100644 index 000000000..b33b1105e Binary files /dev/null and b/astrid/assets/subtasks_horizontal.png differ diff --git a/astrid/assets/subtasks_vertical.png b/astrid/assets/subtasks_vertical.png new file mode 100644 index 000000000..c9173f737 Binary files /dev/null and b/astrid/assets/subtasks_vertical.png differ diff --git a/astrid/plugin-src/com/todoroo/astrid/subtasks/OrderedListFragmentHelper.java b/astrid/plugin-src/com/todoroo/astrid/subtasks/OrderedListFragmentHelper.java index f78ee4528..e503bbdbe 100644 --- a/astrid/plugin-src/com/todoroo/astrid/subtasks/OrderedListFragmentHelper.java +++ b/astrid/plugin-src/com/todoroo/astrid/subtasks/OrderedListFragmentHelper.java @@ -26,7 +26,10 @@ import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; +import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; +import com.todoroo.andlib.utility.DialogUtilities; +import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.activity.TaskListFragment; import com.todoroo.astrid.adapter.TaskAdapter; import com.todoroo.astrid.adapter.TaskAdapter.OnCompletedTaskListener; @@ -38,6 +41,7 @@ import com.todoroo.astrid.service.TaskService; import com.todoroo.astrid.subtasks.OrderedListUpdater.Node; import com.todoroo.astrid.subtasks.OrderedListUpdater.OrderedListNodeVisitor; import com.todoroo.astrid.ui.DraggableListView; +import com.todoroo.astrid.utility.AstridPreferences; public class OrderedListFragmentHelper { @@ -85,6 +89,28 @@ public class OrderedListFragmentHelper { getTouchListView().setClickListener(rowClickListener); getTouchListView().setSwipeListener(swipeListener); getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics); + + if(Preferences.getInt(AstridPreferences.P_SUBTASKS_HELP, 0) == 0) + showSubtasksHelp(); + } + + @SuppressWarnings("nls") + private void showSubtasksHelp() { + String imageBase = "file:///android_asset/"; + String body = String.format("

%s



" + + "
%s


%s", + getActivity().getString(R.string.subtasks_help_1), + imageBase + "subtasks_vertical.png", + getActivity().getString(R.string.subtasks_help_2), + imageBase + "subtasks_horizontal.png", + getActivity().getString(R.string.subtasks_help_3)); + System.err.println(body);; + + String color = (AndroidUtilities.getSdkVersion() >= 11 ? "black" : "white"); + String html = String.format("%s", + color, body); + + DialogUtilities.htmlDialog(getActivity(), html, R.string.subtasks_help_title); } public void beforeSetUpTaskList(Filter filter) { diff --git a/astrid/res/values/strings-subtasks.xml b/astrid/res/values/strings-subtasks.xml new file mode 100644 index 000000000..899e7ee7c --- /dev/null +++ b/astrid/res/values/strings-subtasks.xml @@ -0,0 +1,11 @@ + + + + + + Sort and Indent in Astrid + Tap and hold to move a task. + Drag vertically to rearrange. + Drag horizontally to indent. + + diff --git a/astrid/src/com/todoroo/astrid/service/ThemeService.java b/astrid/src/com/todoroo/astrid/service/ThemeService.java index 5d4f30507..747520819 100644 --- a/astrid/src/com/todoroo/astrid/service/ThemeService.java +++ b/astrid/src/com/todoroo/astrid/service/ThemeService.java @@ -58,4 +58,5 @@ public class ThemeService { } return theme; } + } diff --git a/astrid/src/com/todoroo/astrid/service/UpgradeService.java b/astrid/src/com/todoroo/astrid/service/UpgradeService.java index bbf7cff83..d1fab5551 100644 --- a/astrid/src/com/todoroo/astrid/service/UpgradeService.java +++ b/astrid/src/com/todoroo/astrid/service/UpgradeService.java @@ -433,7 +433,7 @@ public final class UpgradeService { return; changeLog.append("Have a spectacular day!"); - String color = (AndroidUtilities.getSdkVersion() >= 14 ? "black" : "white"); + String color = (AndroidUtilities.getSdkVersion() >= 11 ? "black" : "white"); String changeLogHtml = "" + changeLog; DialogUtilities.htmlDialog(context, changeLogHtml, diff --git a/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java b/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java index a8b42650e..bfa7d4ed7 100644 --- a/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java +++ b/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java @@ -27,6 +27,8 @@ public class AstridPreferences { private static final long MIN_POPOVER_TIME = 3 * 1000L; + public static final String P_SUBTASKS_HELP = "sthelp"; //$NON-NLS-1$ + /** Set preference defaults, if unset. called at startup */ public static void setPreferenceDefaults() { Context context = ContextManager.getContext();