Minor adjustments to widget code when determining if subtasks should be applied

pull/14/head
Sam Bosley 12 years ago
parent ab2c5e01bd
commit b68cf75104

@ -255,8 +255,10 @@ public class AstridActivity extends FragmentActivity
private static boolean isTagFilter(Filter filter) {
if (filter instanceof FilterWithCustomIntent) {
return ((FilterWithCustomIntent) filter).customTaskList.getClassName().equals(
TagViewFragment.class.getName());
String className = ((FilterWithCustomIntent) filter).customTaskList.getClassName();
if (TagViewFragment.class.getName().equals(className)
|| SubtasksTagListFragment.class.getName().equals(className)) // Need to check this subclass because some shortcuts/widgets may have been saved with it
return true;
}
return false;
}

@ -32,6 +32,7 @@ import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.activity.AstridActivity;
import com.todoroo.astrid.activity.TaskEditActivity;
import com.todoroo.astrid.activity.TaskEditFragment;
import com.todoroo.astrid.activity.TaskListActivity;
@ -182,10 +183,7 @@ public class TasksWidget extends AppWidgetProvider {
String query = SortHelper.adjustQueryForFlagsAndSort(
filter.getSqlQuery(), flags, sort).replaceAll("LIMIT \\d+", "") + " LIMIT " + numberOfTasks;
boolean isTagList = (filter instanceof FilterWithCustomIntent) &&
((((FilterWithCustomIntent)filter).customTaskList.getShortClassName().equals("com.todoroo.astrid.subtasks.SubtasksTagListFragment")) ||
(((FilterWithCustomIntent)filter).customTaskList.getShortClassName().equals("com.todoroo.astrid.actfm.TagViewFragment")));
if (SortHelper.isManualSort(flags) && isTagList) {
if (AstridActivity.shouldUseSubtasksFragmentForFilter(filter)) {
// care for manual ordering
String tagName = Preferences.getStringValue(WidgetConfigActivity.PREF_TITLE + widgetId);
if(tagName == null)

Loading…
Cancel
Save