Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tabs] Integrated tokens into M3 styles.
PiperOrigin-RevId: 481709158
- Loading branch information
1 parent
32f1118
commit d0460f3
Showing
13 changed files
with
253 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
lib/java/com/google/android/material/tabs/res/color/m3_tabs_icon_color_secondary.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright 2021 The Android Open Source Project | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:alpha="@dimen/material_emphasis_disabled" | ||
android:color="?attr/colorOnSurface" | ||
android:state_enabled="false"/> | ||
|
||
<!-- Selected --> | ||
<item android:color="@macro/m3_comp_secondary_navigation_tab_with_icon_active_icon_color" | ||
android:state_selected="true"/> | ||
|
||
<!-- Not selected --> | ||
<item android:color="@macro/m3_comp_secondary_navigation_tab_with_icon_inactive_icon_color"/> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
lib/java/com/google/android/material/tabs/res/color/m3_tabs_ripple_color_secondary.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright 2021 The Android Open Source Project | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<!-- Selected --> | ||
|
||
<!-- Uses the primary state layer since tapping a selected tab keeps it | ||
selected. --> | ||
<item android:alpha="@dimen/m3_comp_secondary_navigation_tab_pressed_state_layer_opacity" | ||
android:color="@macro/m3_comp_secondary_navigation_tab_pressed_state_layer_color" | ||
android:state_pressed="true" android:state_selected="true"/> | ||
<item android:alpha="@dimen/m3_comp_secondary_navigation_tab_focus_state_layer_opacity" | ||
android:color="@macro/m3_comp_secondary_navigation_tab_focus_state_layer_color" | ||
android:state_focused="true" android:state_selected="true"/> | ||
<item android:alpha="@dimen/m3_comp_secondary_navigation_tab_hover_state_layer_opacity" | ||
android:color="@macro/m3_comp_secondary_navigation_tab_hover_state_layer_color" | ||
android:state_hovered="true" android:state_selected="true"/> | ||
<item android:alpha="@dimen/m3_ripple_default_alpha" | ||
android:color="?attr/colorPrimary" | ||
android:state_selected="true"/> | ||
|
||
<!-- Not selected --> | ||
|
||
<!-- Uses the primary state layer since tapping an non-selected tab will | ||
select it. --> | ||
<item android:alpha="@dimen/m3_comp_secondary_navigation_tab_pressed_state_layer_opacity" | ||
android:color="@macro/m3_comp_secondary_navigation_tab_pressed_state_layer_color" | ||
android:state_pressed="true"/> | ||
<item android:alpha="@dimen/m3_comp_secondary_navigation_tab_focus_state_layer_opacity" | ||
android:color="@macro/m3_comp_secondary_navigation_tab_focus_state_layer_color" | ||
android:state_focused="true"/> | ||
<item android:alpha="@dimen/m3_comp_secondary_navigation_tab_hover_state_layer_opacity" | ||
android:color="@macro/m3_comp_secondary_navigation_tab_hover_state_layer_color" | ||
android:state_hovered="true"/> | ||
<item android:alpha="@dimen/m3_ripple_default_alpha" | ||
android:color="?attr/colorOnSurfaceVariant"/> | ||
|
||
</selector> |
28 changes: 28 additions & 0 deletions
28
lib/java/com/google/android/material/tabs/res/color/m3_tabs_text_color.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright 2021 The Android Open Source Project | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:alpha="@dimen/material_emphasis_disabled" | ||
android:color="?attr/colorOnSurface" | ||
android:state_enabled="false"/> | ||
|
||
<!-- Selected --> | ||
<item android:color="@macro/m3_comp_primary_navigation_tab_with_label_text_active_label_text_color" | ||
android:state_selected="true"/> | ||
|
||
<!-- Not selected --> | ||
<item android:color="@macro/m3_comp_primary_navigation_tab_with_label_text_inactive_label_text_color"/> | ||
</selector> |
28 changes: 28 additions & 0 deletions
28
lib/java/com/google/android/material/tabs/res/color/m3_tabs_text_color_secondary.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright 2021 The Android Open Source Project | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:alpha="@dimen/material_emphasis_disabled" | ||
android:color="?attr/colorOnSurface" | ||
android:state_enabled="false"/> | ||
|
||
<!-- Selected --> | ||
<item android:color="@macro/m3_comp_secondary_navigation_tab_active_label_text_color" | ||
android:state_selected="true"/> | ||
|
||
<!-- Not selected --> | ||
<item android:color="@macro/m3_comp_secondary_navigation_tab_inactive_label_text_color"/> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
lib/java/com/google/android/material/tabs/res/values/tokens.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ Copyright (C) 2022 The Android Open Source Project | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
<!-- AUTOGENERATED FILE. DO NOT MODIFY. --> | ||
<!-- Version: v0.126 --> | ||
|
||
<resources> | ||
<!-- Generated from token set (md.comp.primary-navigation-tab) in default context. --> | ||
<!-- Enabled - Container --> | ||
<macro name="m3_comp_primary_navigation_tab_container_color">?attr/colorSurface</macro> | ||
<!-- Enabled - Label text --> | ||
<macro name="m3_comp_primary_navigation_tab_with_label_text_label_text_type">?attr/textAppearanceTitleSmall</macro> | ||
<macro name="m3_comp_primary_navigation_tab_with_label_text_active_label_text_color">?attr/colorPrimary</macro> | ||
<macro name="m3_comp_primary_navigation_tab_with_label_text_inactive_label_text_color">?attr/colorOnSurfaceVariant</macro> | ||
<!-- Enabled - Icon --> | ||
<dimen name="m3_comp_primary_navigation_tab_with_icon_icon_size">24dp</dimen> | ||
<macro name="m3_comp_primary_navigation_tab_with_icon_active_icon_color">?attr/colorPrimary</macro> | ||
<macro name="m3_comp_primary_navigation_tab_with_icon_inactive_icon_color">?attr/colorOnSurfaceVariant</macro> | ||
<!-- Enabled - Divider --> | ||
<macro name="m3_comp_primary_navigation_tab_divider_color">?attr/colorSurfaceVariant</macro> | ||
<dimen name="m3_comp_primary_navigation_tab_divider_height">1dp</dimen> | ||
<!-- Enabled - Active indicator --> | ||
<macro name="m3_comp_primary_navigation_tab_active_indicator_color">?attr/colorPrimary</macro> | ||
<dimen name="m3_comp_primary_navigation_tab_active_indicator_height">3dp</dimen> | ||
<!-- Hovered - State layer --> | ||
<macro name="m3_comp_primary_navigation_tab_active_hover_state_layer_color">?attr/colorPrimary</macro> | ||
<dimen name="m3_comp_primary_navigation_tab_active_hover_state_layer_opacity">@dimen/m3_sys_state_hover_state_layer_opacity</dimen> | ||
<macro name="m3_comp_primary_navigation_tab_inactive_hover_state_layer_color">?attr/colorOnSurface</macro> | ||
<dimen name="m3_comp_primary_navigation_tab_inactive_hover_state_layer_opacity">@dimen/m3_sys_state_hover_state_layer_opacity</dimen> | ||
<!-- Focused - State layer --> | ||
<macro name="m3_comp_primary_navigation_tab_active_focus_state_layer_color">?attr/colorPrimary</macro> | ||
<dimen name="m3_comp_primary_navigation_tab_active_focus_state_layer_opacity">@dimen/m3_sys_state_focus_state_layer_opacity</dimen> | ||
<macro name="m3_comp_primary_navigation_tab_inactive_focus_state_layer_color">?attr/colorOnSurface</macro> | ||
<dimen name="m3_comp_primary_navigation_tab_inactive_focus_state_layer_opacity">@dimen/m3_sys_state_focus_state_layer_opacity</dimen> | ||
<!-- Pressed (rippple) - State layer --> | ||
<macro name="m3_comp_primary_navigation_tab_active_pressed_state_layer_color">?attr/colorPrimary</macro> | ||
<dimen name="m3_comp_primary_navigation_tab_active_pressed_state_layer_opacity">@dimen/m3_sys_state_pressed_state_layer_opacity</dimen> | ||
<macro name="m3_comp_primary_navigation_tab_inactive_pressed_state_layer_color">?attr/colorPrimary</macro> | ||
<dimen name="m3_comp_primary_navigation_tab_inactive_pressed_state_layer_opacity">@dimen/m3_sys_state_pressed_state_layer_opacity</dimen> | ||
|
||
<!-- Generated from token set (md.comp.secondary-navigation-tab) in default context. --> | ||
<!-- Enabled - Container --> | ||
<macro name="m3_comp_secondary_navigation_tab_container_color">?attr/colorSurface</macro> | ||
<!-- Enabled - Label text --> | ||
<macro name="m3_comp_secondary_navigation_tab_label_text_type">?attr/textAppearanceTitleSmall</macro> | ||
<macro name="m3_comp_secondary_navigation_tab_active_label_text_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_secondary_navigation_tab_inactive_label_text_color">?attr/colorOnSurfaceVariant</macro> | ||
<!-- Enabled - Icon --> | ||
<macro name="m3_comp_secondary_navigation_tab_with_icon_active_icon_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_secondary_navigation_tab_with_icon_inactive_icon_color">?attr/colorOnSurfaceVariant</macro> | ||
<!-- Enabled - Active indicator --> | ||
<macro name="m3_comp_secondary_navigation_tab_active_indicator_color">?attr/colorPrimary</macro> | ||
<dimen name="m3_comp_secondary_navigation_tab_active_indicator_height">2dp</dimen> | ||
<!-- Hovered - State layer --> | ||
<macro name="m3_comp_secondary_navigation_tab_hover_state_layer_color">?attr/colorOnSurface</macro> | ||
<dimen name="m3_comp_secondary_navigation_tab_hover_state_layer_opacity">@dimen/m3_sys_state_hover_state_layer_opacity</dimen> | ||
<!-- Focused - State layer --> | ||
<macro name="m3_comp_secondary_navigation_tab_focus_state_layer_color">?attr/colorOnSurface</macro> | ||
<dimen name="m3_comp_secondary_navigation_tab_focus_state_layer_opacity">@dimen/m3_sys_state_focus_state_layer_opacity</dimen> | ||
<!-- Pressed (rippple) - State layer --> | ||
<macro name="m3_comp_secondary_navigation_tab_pressed_state_layer_color">?attr/colorOnSurface</macro> | ||
<dimen name="m3_comp_secondary_navigation_tab_pressed_state_layer_opacity">@dimen/m3_sys_state_pressed_state_layer_opacity</dimen> | ||
</resources> |