First pass at making a help file for subtasks

pull/14/head
Tim Su 13 years ago
parent 2fbae84da7
commit e10e4c8a0d

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

@ -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<LIST> {
@ -85,6 +89,28 @@ public class OrderedListFragmentHelper<LIST> {
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("<h2>%s</h2><br><br><img src='%s'/>" +
"<br>%s<br><br><img src='%s'/><br>%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("<html><body style='text-align:center;color:%s'>%s</body></html>",
color, body);
DialogUtilities.htmlDialog(getActivity(), html, R.string.subtasks_help_title);
}
public void beforeSetUpTaskList(Filter filter) {

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- See the file "LICENSE" for the full license governing this code. -->
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Subtasks Help Introduction -->
<string name="subtasks_help_title">Sort and Indent in Astrid</string>
<string name="subtasks_help_1">Tap and hold to move a task.</string>
<string name="subtasks_help_2">Drag vertically to rearrange.</string>
<string name="subtasks_help_3">Drag horizontally to indent.</string>
</resources>

@ -58,4 +58,5 @@ public class ThemeService {
}
return theme;
}
}

@ -433,7 +433,7 @@ public final class UpgradeService {
return;
changeLog.append("Have a spectacular day!</body></html>");
String color = (AndroidUtilities.getSdkVersion() >= 14 ? "black" : "white");
String color = (AndroidUtilities.getSdkVersion() >= 11 ? "black" : "white");
String changeLogHtml = "<html><body style='color: " + color +"'>" + changeLog;
DialogUtilities.htmlDialog(context, changeLogHtml,

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

Loading…
Cancel
Save