代码拉取完成,页面将自动刷新
第一步:在项目的attr.xml声明自定义属性(各种模式都会用到的属性)
Setup 1:declare attribute in attr.xml
第二步:在项目的style.xml指定各种模式主题下的自定义属性值
Setup 2:declare attribute in style.xml
第三步:在页面布局文件里使用自定义属性值
Setup 3:use attribute in layout
第四步:在基类的onCreate方法里添加切换主题模式的逻辑代码
Setup 4:add the code of switch theme-mode in base activity
第五步:调用工具类方法切换主题模式
Setup 5:switch theme-mode in code
第六步:针对切换主题模式时需要立即更新页面ui的页面,需要使用框架里的封装控件
Setup 6:use customize-widget of framework at the activity that need update ui when switch theme-mode.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。