-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BottomNavigation] Integrated tokens.
Created a new copy of CSL of icon/text/ripple tint for navigation bar. Before this change, they are shared with navigation rail. Changed item text appearance from textAppearanceTitleSmall to textAppearanceLabelMedium PiperOrigin-RevId: 503210110
- Loading branch information
1 parent
c484ea7
commit 355702f
Showing
10 changed files
with
190 additions
and
12 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...d/material/bottomnavigation/res/color/m3_navigation_bar_item_with_indicator_icon_tint.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,36 @@ | ||
<?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"> | ||
<!-- Active item --> | ||
<item android:color="@macro/m3_comp_navigation_bar_active_pressed_icon_color" | ||
android:state_pressed="true" android:state_checked="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_active_focus_icon_color" | ||
android:state_focused="true" android:state_checked="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_active_hover_icon_color" | ||
android:state_hovered="true" android:state_checked="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_active_icon_color" | ||
android:state_checked="true"/> | ||
|
||
<!-- Inactive item --> | ||
<item android:color="@macro/m3_comp_navigation_bar_inactive_pressed_icon_color" | ||
android:state_pressed="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_inactive_focus_icon_color" | ||
android:state_focused="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_inactive_hover_icon_color" | ||
android:state_hovered="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_inactive_icon_color"/> | ||
</selector> |
36 changes: 36 additions & 0 deletions
36
.../material/bottomnavigation/res/color/m3_navigation_bar_item_with_indicator_label_tint.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,36 @@ | ||
<?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"> | ||
<!-- Active item --> | ||
<item android:color="@macro/m3_comp_navigation_bar_active_pressed_label_text_color" | ||
android:state_pressed="true" android:state_checked="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_active_focus_label_text_color" | ||
android:state_focused="true" android:state_checked="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_active_hover_label_text_color" | ||
android:state_hovered="true" android:state_checked="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_active_label_text_color" | ||
android:state_checked="true"/> | ||
|
||
<!-- Inactive item --> | ||
<item android:color="@macro/m3_comp_navigation_bar_inactive_pressed_label_text_color" | ||
android:state_pressed="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_inactive_focus_label_text_color" | ||
android:state_focused="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_inactive_hover_label_text_color" | ||
android:state_hovered="true"/> | ||
<item android:color="@macro/m3_comp_navigation_bar_inactive_label_text_color"/> | ||
</selector> |
42 changes: 42 additions & 0 deletions
42
...e/android/material/bottomnavigation/res/color/m3_navigation_bar_ripple_color_selector.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,42 @@ | ||
<?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. --> | ||
<item android:alpha="@dimen/m3_comp_navigation_bar_pressed_state_layer_opacity" | ||
android:color="@macro/m3_comp_navigation_bar_active_pressed_state_layer_color" | ||
android:state_pressed="true" android:state_selected="true"/> | ||
<item android:alpha="@dimen/m3_comp_navigation_bar_focus_state_layer_opacity" | ||
android:color="@macro/m3_comp_navigation_bar_active_focus_state_layer_color" | ||
android:state_focused="true" android:state_selected="true"/> | ||
<item android:alpha="@dimen/m3_comp_navigation_bar_hover_state_layer_opacity" | ||
android:color="@macro/m3_comp_navigation_bar_active_hover_state_layer_color" | ||
android:state_hovered="true" android:state_selected="true"/> | ||
|
||
<!-- Unselected. --> | ||
<item android:alpha="@dimen/m3_comp_navigation_bar_pressed_state_layer_opacity" | ||
android:color="@macro/m3_comp_navigation_bar_inactive_pressed_state_layer_color" | ||
android:state_pressed="true"/> | ||
<item android:alpha="@dimen/m3_comp_navigation_bar_focus_state_layer_opacity" | ||
android:color="@macro/m3_comp_navigation_bar_inactive_focus_state_layer_color" | ||
android:state_focused="true"/> | ||
<item android:alpha="@dimen/m3_comp_navigation_bar_hover_state_layer_opacity" | ||
android:color="@macro/m3_comp_navigation_bar_inactive_hover_state_layer_color" | ||
android:state_hovered="true"/> | ||
<item android:color="@android:color/transparent"/> | ||
</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
63 changes: 63 additions & 0 deletions
63
lib/java/com/google/android/material/bottomnavigation/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,63 @@ | ||
<?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.147 --> | ||
|
||
<resources> | ||
|
||
<!-- Generated from token set (md.comp.navigation-bar) in context (platform=android, audience=3p). --> | ||
<!-- Enabled - Container --> | ||
<macro name="m3_comp_navigation_bar_container_color">?attr/colorSurface</macro> | ||
<dimen name="m3_comp_navigation_bar_container_height">80dp</dimen> | ||
<dimen name="m3_comp_navigation_bar_container_elevation">@dimen/m3_sys_elevation_level2</dimen> | ||
<!-- Enabled - Label text --> | ||
<macro name="m3_comp_navigation_bar_label_text_type">?attr/textAppearanceLabelMedium</macro> | ||
<macro name="m3_comp_navigation_bar_active_label_text_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_navigation_bar_inactive_label_text_color">?attr/colorOnSurfaceVariant</macro> | ||
<macro name="m3_comp_navigation_bar_active_hover_label_text_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_navigation_bar_inactive_hover_label_text_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_navigation_bar_active_focus_label_text_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_navigation_bar_inactive_focus_label_text_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_navigation_bar_active_pressed_label_text_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_navigation_bar_inactive_pressed_label_text_color">?attr/colorOnSurface</macro> | ||
<!-- Enabled - Icon --> | ||
<dimen name="m3_comp_navigation_bar_icon_size">24dp</dimen> | ||
<macro name="m3_comp_navigation_bar_active_icon_color">?attr/colorOnSecondaryContainer</macro> | ||
<macro name="m3_comp_navigation_bar_inactive_icon_color">?attr/colorOnSurfaceVariant</macro> | ||
<macro name="m3_comp_navigation_bar_active_hover_icon_color">?attr/colorOnSecondaryContainer</macro> | ||
<macro name="m3_comp_navigation_bar_inactive_hover_icon_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_navigation_bar_active_focus_icon_color">?attr/colorOnSecondaryContainer</macro> | ||
<macro name="m3_comp_navigation_bar_inactive_focus_icon_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_navigation_bar_active_pressed_icon_color">?attr/colorOnSecondaryContainer</macro> | ||
<macro name="m3_comp_navigation_bar_inactive_pressed_icon_color">?attr/colorOnSurface</macro> | ||
<!-- Enabled - Active indicator --> | ||
<macro name="m3_comp_navigation_bar_active_indicator_color">?attr/colorSecondaryContainer</macro> | ||
<dimen name="m3_comp_navigation_bar_active_indicator_height">32dp</dimen> | ||
<dimen name="m3_comp_navigation_bar_active_indicator_width">64dp</dimen> | ||
<style name="ShapeAppearance.M3.Comp.NavigationBar.ActiveIndicator.Shape" parent="ShapeAppearance.M3.Sys.Shape.Corner.Full"/> | ||
<!-- Enabled - State layer --> | ||
<macro name="m3_comp_navigation_bar_active_hover_state_layer_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_navigation_bar_inactive_hover_state_layer_color">?attr/colorOnSurface</macro> | ||
<dimen name="m3_comp_navigation_bar_hover_state_layer_opacity">@dimen/m3_sys_state_hover_state_layer_opacity</dimen> | ||
<macro name="m3_comp_navigation_bar_active_focus_state_layer_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_navigation_bar_inactive_focus_state_layer_color">?attr/colorOnSurface</macro> | ||
<dimen name="m3_comp_navigation_bar_focus_state_layer_opacity">@dimen/m3_sys_state_focus_state_layer_opacity</dimen> | ||
<macro name="m3_comp_navigation_bar_active_pressed_state_layer_color">?attr/colorOnSurface</macro> | ||
<macro name="m3_comp_navigation_bar_inactive_pressed_state_layer_color">?attr/colorOnSurface</macro> | ||
<dimen name="m3_comp_navigation_bar_pressed_state_layer_opacity">@dimen/m3_sys_state_pressed_state_layer_opacity</dimen> | ||
|
||
</resources> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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