Google 推出了 Material 3,它允许用户选择一种颜色来应用于整个系统主题,但他们的文档不清楚,也没有提到如何以编程方式获取当前颜色以用于应用程序,例如更改视图的背景颜色或文字颜色。
例如:view.setBackgroundColor(Material3.getPrimaryColor());
view.setBackgroundColor(Material3.getPrimaryColor());
当然Material3.getPrimaryColor()不存在,这只是我需要的一个例子。
Material3.getPrimaryColor()
如有任何帮助,我们将不胜感激,谢谢。
java android material-components-android
android ×1
java ×1
material-components-android ×1