bilibili / MagicaSakura

MagicaSakura 是 Android 多主题框架。~ is an Android multi theme library which supporting both daily colorful theme and night theme.
http://app.bilibili.com
Apache License 2.0
3.55k stars 468 forks source link

F ragment 里面的tooloar不会实时刷新 #56

Closed DavidMGT closed 6 years ago

DavidMGT commented 6 years ago

ThemeUtils.refreshUI(getContext(), new ThemeUtils.ExtraRefreshable() { @Override public void refreshGlobal(Activity activity) { //for global setting, just do once if (Build.VERSION.SDK_INT >= 21) { ActivityManager.TaskDescription taskDescription = new ActivityManager.TaskDescription(null, null, ThemeUtils.getThemeAttrColor(context, android.R.attr.colorPrimary)); setTaskDescription(taskDescription); getWindow().setStatusBarColor( ThemeUtils.getColorById(context, R.color.theme_color_primary_dark)); } }

                @Override
                public void refreshSpecificView(View view) {
                    //TODO: will do this for each traversal
                } ThemeUtils.refreshUI(getContext(), new ThemeUtils.ExtraRefreshable() {
                @Override
                public void refreshGlobal(Activity activity) {
                    //for global setting, just do once
                    if (Build.VERSION.SDK_INT >= 21) {
                        ActivityManager.TaskDescription taskDescription =
                                new ActivityManager.TaskDescription(null, null,
                                        ThemeUtils.getThemeAttrColor(context, android.R.attr.colorPrimary));
                        setTaskDescription(taskDescription);
                        getWindow().setStatusBarColor(
                                ThemeUtils.getColorById(context, R.color.theme_color_primary_dark));
                    }
                }

                @Override
                public void refreshSpecificView(View view) {
                    //TODO: will do this for each traversal
                }
            }
    );
            }
    );