Skip to content

Commit ff2c03b

Browse files
drchendsn5ft
authored andcommitted
[M3][Color] Implement M3 text colors
PiperOrigin-RevId: 399682484
1 parent c64bb76 commit ff2c03b

24 files changed

+572
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2021 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<!-- Material3 alternative to textColorPrimary for dynamic dark theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:state_enabled="false" android:alpha="@dimen/material_emphasis_disabled"
20+
android:color="@color/m3_sys_color_dynamic_dark_on_surface"/>
21+
<item android:color="@color/m3_sys_color_dynamic_dark_on_surface"/>
22+
</selector>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2021 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<!-- Material3 alternative to textColorSecondary for dynamic dark theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:state_enabled="false" android:alpha="@dimen/material_emphasis_disabled"
20+
android:color="@color/m3_sys_color_dynamic_dark_on_surface"/>
21+
<item android:color="@color/m3_sys_color_dynamic_dark_on_surface_variant"/>
22+
</selector>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2021 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<!-- Material3 alternative to textColorHighlight for dynamic dark theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:alpha="@dimen/material_emphasis_medium" android:color="@color/m3_sys_color_dynamic_dark_primary" />
20+
</selector>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2021 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<!-- Material3 alternative to textColorHint for dynamic dark theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:state_enabled="true"
20+
android:state_pressed="true"
21+
android:alpha="@dimen/material_emphasis_high_type"
22+
android:color="@color/m3_sys_color_dynamic_dark_on_background" />
23+
<item android:alpha="@dimen/material_emphasis_medium"
24+
android:color="@color/m3_sys_color_dynamic_dark_on_background" />
25+
</selector>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2021 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<!-- Material3 alternative to textColorPrimaryDisableOnly for dynamic dark theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:state_enabled="false" android:alpha="@dimen/material_emphasis_medium" android:color="@color/m3_sys_color_dynamic_dark_on_background"/>
20+
<item android:color="@color/m3_sys_color_dynamic_dark_on_background"/>
21+
</selector>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2021 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<!-- Material3 alternative to textColorPrimary for dynamic light theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:state_enabled="false" android:alpha="@dimen/material_emphasis_disabled"
20+
android:color="@color/m3_sys_color_dynamic_light_on_surface"/>
21+
<item android:color="@color/m3_sys_color_dynamic_light_on_surface"/>
22+
</selector>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2021 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<!-- Material3 alternative to textColorSecondary and textColorTertiary for dynamic light theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:state_enabled="false" android:alpha="@dimen/material_emphasis_disabled"
20+
android:color="@color/m3_sys_color_dynamic_light_on_surface"/>
21+
<item android:color="@color/m3_sys_color_dynamic_light_on_surface_variant"/>
22+
</selector>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2021 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<!-- Material3 alternative to textColorHighlight for dynamic light theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:alpha="@dimen/material_emphasis_medium" android:color="@color/m3_sys_color_dynamic_light_primary" />
20+
</selector>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2021 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<!-- Material3 alternative to textColorHint for dynamic light theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:state_enabled="true"
20+
android:state_pressed="true"
21+
android:alpha="@dimen/material_emphasis_medium"
22+
android:color="@color/m3_sys_color_dynamic_light_on_background" />
23+
<item android:alpha="@dimen/material_emphasis_disabled"
24+
android:color="@color/m3_sys_color_dynamic_light_on_background" />
25+
</selector>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2021 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<!-- Material3 alternative to textColorPrimaryDisableOnly for dynamic light theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:state_enabled="false" android:alpha="@dimen/material_emphasis_medium" android:color="@color/m3_sys_color_dynamic_light_on_background"/>
20+
<item android:color="@color/m3_sys_color_dynamic_light_on_background"/>
21+
</selector>

0 commit comments

Comments
 (0)