Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

主题色切换 #29

Closed
marvin-an opened this issue Jan 20, 2018 · 1 comment
Closed

主题色切换 #29

marvin-an opened this issue Jan 20, 2018 · 1 comment

Comments

@marvin-an
Copy link

请问下一条中的主题色是怎么切换的?
public void onColorSelection(@nonnull ColorChooserDialog dialog, @ColorInt int selectedColor)
方法中只有切换状态栏、任务栏、导航栏的颜色
请问是怎么动态切换主题色的?

@iMeiji
Copy link
Owner

iMeiji commented Jan 20, 2018

@lhzlg3368

@Override
    public void onResume() {
        super.onResume();
        linearLayout.setBackgroundColor(SettingUtil.getInstance().getColor());
    }

在 onResume 里重新设置颜色,但这么写部分机型可能会失效,正确写法是发送个 事件/广播 通知界面要更改颜色,可以看看我另一个项目 https://github.com/iMeiji/Daily

@iMeiji iMeiji closed this as completed Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants