Set filter title and theme color in recent apps

pull/413/head
Alex Baker 10 years ago
parent 33d6c88a9a
commit ef7da583e0

@ -180,6 +180,7 @@ public class TaskListActivity extends InjectingAppCompatActivity implements
.replace(isDoublePaneLayout() ? R.id.master_dual : R.id.single_pane, taskListFragment, TaskListFragment.TAG_TASKLIST_FRAGMENT) .replace(isDoublePaneLayout() ? R.id.master_dual : R.id.single_pane, taskListFragment, TaskListFragment.TAG_TASKLIST_FRAGMENT)
.addToBackStack(TaskListFragment.TAG_TASKLIST_FRAGMENT) .addToBackStack(TaskListFragment.TAG_TASKLIST_FRAGMENT)
.commit(); .commit();
themeApplicator.applyTaskDescription(taskListFragment.filter.listingTitle);
} }
private void loadTaskEditFragment(boolean onCreate, TaskEditFragment taskEditFragment, List<TaskEditControlFragment> taskEditControlFragments) { private void loadTaskEditFragment(boolean onCreate, TaskEditFragment taskEditFragment, List<TaskEditControlFragment> taskEditControlFragments) {

@ -1,8 +1,11 @@
package org.tasks.preferences; package org.tasks.preferences;
import android.app.Activity; import android.app.Activity;
import android.app.ActivityManager;
import android.graphics.PixelFormat; import android.graphics.PixelFormat;
import org.tasks.R;
import javax.inject.Inject; import javax.inject.Inject;
import static com.todoroo.andlib.utility.AndroidUtilities.atLeastLollipop; import static com.todoroo.andlib.utility.AndroidUtilities.atLeastLollipop;
@ -20,12 +23,20 @@ public class ThemeApplicator {
public void applyThemeAndStatusBarColor() { public void applyThemeAndStatusBarColor() {
applyTheme(); applyTheme();
applyStatusBarColor(); applyStatusBarColor();
applyTaskDescription(activity.getString(R.string.app_name));
} }
public void applyTheme() { public void applyTheme() {
applyTheme(themeManager.getBaseTheme()); applyTheme(themeManager.getBaseTheme());
} }
public void applyTaskDescription(String description) {
if (atLeastLollipop()) {
Theme colorTheme = themeManager.getColorTheme();
activity.setTaskDescription(new ActivityManager.TaskDescription(description, null, colorTheme.getPrimaryColor()));
}
}
private void applyTheme(Theme theme) { private void applyTheme(Theme theme) {
activity.setTheme(theme.getResId()); activity.setTheme(theme.getResId());
themeManager.applyThemeToContext(activity); themeManager.applyThemeToContext(activity);

Loading…
Cancel
Save