Skip to content

Commit ce68ec6

Browse files
Material Design Teamleticiarossi
authored andcommitted
[M3][Color] Added framework color roles support for content color
PiperOrigin-RevId: 493027582
1 parent 6c85b59 commit ce68ec6

12 files changed

+260
-2
lines changed
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) 2022 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 personalized theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:alpha="@dimen/material_emphasis_medium" android:color="@color/material_personalized_color_primary" />
20+
</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) 2022 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 textColorHighlightInverse for personalized theme -->
18+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
19+
<item android:alpha="@dimen/material_emphasis_medium" android:color="@color/material_personalized_color_primary_inverse" />
20+
</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) 2022 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 personalized 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/material_personalized_color_on_surface"/>
21+
<item android:color="@color/material_personalized_color_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) 2022 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 textColorPrimaryInverse for personalized 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/material_personalized_color_text_primary_inverse"/>
21+
<item android:color="@color/material_personalized_color_text_primary_inverse"/>
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) 2022 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 personalized 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/material_personalized_color_on_surface"/>
21+
<item android:color="@color/material_personalized_color_on_surface_variant"/>
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) 2022 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 textColorSecondaryInverse for personalized 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/material_personalized_color_text_secondary_and_tertiary_inverse_disabled"/>
21+
<item android:color="@color/material_personalized_color_text_secondary_and_tertiary_inverse"/>
22+
</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) 2022 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 personalized 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/material_personalized_color_on_background" />
23+
<item android:alpha="@dimen/material_emphasis_disabled"
24+
android:color="@color/material_personalized_color_on_background" />
25+
</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) 2022 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 textColorHintInverse for personalized 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/material_personalized_color_text_hint_foreground_inverse" />
23+
<item android:alpha="@dimen/material_emphasis_disabled"
24+
android:color="@color/material_personalized_color_text_hint_foreground_inverse" />
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) 2022 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 textColorPrimaryInverseDisableOnly for personalized 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/material_personalized_color_text_primary_inverse_disable_only"/>
20+
<item android:color="@color/material_personalized_color_text_primary_inverse_disable_only"/>
21+
</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) 2022 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 personalized 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/material_personalized_color_on_background"/>
20+
<item android:color="@color/material_personalized_color_on_background"/>
21+
</selector>

0 commit comments

Comments
 (0)