如何在 Android XML 中引用 Material Design 3 - 标记/颜色

Mus*_*eed 6 android material-design

我是新来的Material Design 3。我试图理解并使用Android Views (XML). DynamicColors我想参考下图构建设计:在此输入图像描述

我无法理解如何使用设计令牌,例如 Surface 容器 md.sys.color.surface-container 来Android XML用作颜色background。我的基本设计主题文件如下:

<resources xmlns:tools="http://schemas.android.com/tools">
    <!-- Base application theme. -->
    <style name="Base.Theme.BasicM3App" parent="Theme.Material3.DynamicColors.DayNight">
    </style>

    <style name="Theme.BasicM3App" parent="Base.Theme.BasicM3App" />
</resources>
Run Code Online (Sandbox Code Playgroud)

和我的布局文件,我想使用colorSurface作为背景颜色:

<RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="" <<<======== Here I want to use colorSurface for dynamic behavior
            android:layout_weight="1">
Run Code Online (Sandbox Code Playgroud)