diff --git a/src/main/java/com/todoroo/astrid/subtasks/SubtasksListFragment.java b/src/main/java/com/todoroo/astrid/subtasks/SubtasksListFragment.java index 239bfd33f..bbb51039b 100644 --- a/src/main/java/com/todoroo/astrid/subtasks/SubtasksListFragment.java +++ b/src/main/java/com/todoroo/astrid/subtasks/SubtasksListFragment.java @@ -30,6 +30,7 @@ import org.tasks.dialogs.DialogBuilder; import org.tasks.injection.ForApplication; import org.tasks.injection.FragmentComponent; import org.tasks.preferences.Preferences; +import org.tasks.themes.Theme; import org.tasks.themes.ThemeCache; import org.tasks.ui.CheckBoxes; @@ -63,6 +64,7 @@ public class SubtasksListFragment extends TaskListFragment { @Inject CheckBoxes checkBoxes; @Inject TagService tagService; @Inject ThemeCache themeCache; + @Inject Theme theme; @Override public void onAttach(Activity activity) { @@ -155,7 +157,7 @@ public class SubtasksListFragment extends TaskListFragment { @Override protected TaskAdapter createTaskAdapter(TodorooCursor cursor) { - return helper.createTaskAdapter(context, cursor, sqlQueryTemplate); + return helper.createTaskAdapter(theme.wrap(context), cursor, sqlQueryTemplate); } @Override diff --git a/src/main/java/com/todoroo/astrid/subtasks/SubtasksTagListFragment.java b/src/main/java/com/todoroo/astrid/subtasks/SubtasksTagListFragment.java index 22eb21e42..d2375835d 100644 --- a/src/main/java/com/todoroo/astrid/subtasks/SubtasksTagListFragment.java +++ b/src/main/java/com/todoroo/astrid/subtasks/SubtasksTagListFragment.java @@ -29,6 +29,7 @@ import org.tasks.dialogs.DialogBuilder; import org.tasks.injection.ForApplication; import org.tasks.injection.FragmentComponent; import org.tasks.preferences.Preferences; +import org.tasks.themes.Theme; import org.tasks.themes.ThemeCache; import org.tasks.ui.CheckBoxes; @@ -53,6 +54,7 @@ public class SubtasksTagListFragment extends TagViewFragment { @Inject CheckBoxes checkBoxes; @Inject TagService tagService; @Inject ThemeCache themeCache; + @Inject Theme theme; private AstridOrderedListFragmentHelper helper; @@ -121,7 +123,7 @@ public class SubtasksTagListFragment extends TagViewFragment { @Override protected TaskAdapter createTaskAdapter(TodorooCursor cursor) { - return helper.createTaskAdapter(context, cursor, sqlQueryTemplate); + return helper.createTaskAdapter(theme.wrap(context), cursor, sqlQueryTemplate); } @Override diff --git a/src/main/java/org/tasks/themes/Theme.java b/src/main/java/org/tasks/themes/Theme.java index ad3245be9..ae44a8194 100644 --- a/src/main/java/org/tasks/themes/Theme.java +++ b/src/main/java/org/tasks/themes/Theme.java @@ -36,9 +36,7 @@ public class Theme { } public LayoutInflater getLayoutInflater(Context context) { - ContextThemeWrapper wrapper = themeBase.wrap(context); - applyToContext(wrapper); - return (LayoutInflater) wrapper.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + return (LayoutInflater) wrap(context).getSystemService(Context.LAYOUT_INFLATER_SERVICE); } public ContextThemeWrapper getThemedDialog(Context context) { @@ -63,4 +61,10 @@ public class Theme { themeColor.applyStyle(theme); themeAccent.apply(theme); } + + public Context wrap(Context context) { + ContextThemeWrapper wrapper = themeBase.wrap(context); + applyToContext(wrapper); + return wrapper; + } }