Apply theme when loading task list fragment

pull/437/head
Alex Baker 8 years ago
parent f13234371d
commit adbd75863f

@ -191,6 +191,7 @@ public class TaskListActivity extends InjectingAppCompatActivity implements
: theme.getThemeColor();
themeColor.applyStatusBarColor(drawerLayout);
themeColor.applyTaskDescription(this, filter.listingTitle);
theme.withColor(themeColor).applyToContext(this);
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);

@ -80,7 +80,6 @@ import org.tasks.injection.FragmentComponent;
import org.tasks.injection.InjectingListFragment;
import org.tasks.notifications.NotificationManager;
import org.tasks.preferences.Preferences;
import org.tasks.themes.Theme;
import org.tasks.themes.ThemeCache;
import org.tasks.ui.CheckBoxes;
import org.tasks.ui.MenuColorizer;
@ -147,7 +146,6 @@ public class TaskListFragment extends InjectingListFragment implements
@Inject Broadcaster broadcaster;
@Inject TagService tagService;
@Inject ThemeCache themeCache;
@Inject Theme theme;
@BindView(R.id.swipe_layout) SwipeRefreshLayout swipeRefreshLayout;
@BindView(R.id.swipe_layout_empty) SwipeRefreshLayout emptyView;
@ -242,12 +240,10 @@ public class TaskListFragment extends InjectingListFragment implements
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
LayoutInflater themedLayoutInflater =
((filter.tint >= 0) ? theme.withColor(themeCache.getThemeColor(filter.tint)) : theme)
.getLayoutInflater(context);
View parent = themedLayoutInflater.inflate(R.layout.fragment_task_list, container, false);
((ViewGroup) parent.findViewById(R.id.task_list_body)).addView(themedLayoutInflater.inflate(getListBody(), null), 0);
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View parent = inflater.inflate(R.layout.fragment_task_list, container, false);
((ViewGroup) parent.findViewById(R.id.task_list_body)).addView(inflater.inflate(getListBody(), null), 0);
ButterKnife.bind(this, parent);
setupRefresh(swipeRefreshLayout);
setupRefresh(emptyView);

@ -2,12 +2,10 @@ package org.tasks.themes;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.res.Resources;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Window;
import org.tasks.R;
import org.tasks.ui.MenuColorizer;

Loading…
Cancel
Save