Skip to content

Commit

Permalink
[Snackbar] Integrated tokens.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 492560860
  • Loading branch information
pekingme authored and leticiarossi committed Dec 2, 2022
1 parent 7bbbe39 commit 0f0b93c
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
<item name="android:background">@null</item>
<item name="android:layout_margin">@dimen/m3_snackbar_margin</item>
<item name="animationMode">fade</item>
<item name="shapeAppearance">?attr/shapeAppearanceCornerExtraSmall</item>
<item name="shapeAppearance">@macro/m3_comp_snackbar_container_shape</item>
<item name="elevation">@dimen/m3_comp_snackbar_container_elevation</item>
</style>

<!-- Style for a full width M3 Snackbar. -->
Expand All @@ -90,8 +91,8 @@

<style name="Widget.Material3.Snackbar.TextView" parent="Widget.MaterialComponents.Snackbar.TextView">
<item name="android:alpha">@dimen/m3_snackbar_action_text_color_alpha</item>
<item name="android:textColor">?attr/colorOnSurfaceInverse</item>
<item name="android:textAppearance">?attr/textAppearanceBodyMedium</item>
<item name="android:textColor">@macro/m3_comp_snackbar_supporting_text_color</item>
<item name="android:textAppearance">@macro/m3_comp_snackbar_supporting_text_type</item>
</style>

<style name="ThemeOverlay.Material3.Snackbar" parent="">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?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.snackbar) in context (platform=android, audience=3p). -->
<!-- Enabled - Container -->
<dimen name="m3_comp_snackbar_container_elevation">@dimen/m3_sys_elevation_level3</dimen>
<macro name="m3_comp_snackbar_container_shape">?attr/shapeAppearanceCornerExtraSmall</macro>
<!-- Enabled - Supporting text -->
<macro name="m3_comp_snackbar_supporting_text_type">?attr/textAppearanceBodyMedium</macro>
<macro name="m3_comp_snackbar_supporting_text_color">?attr/colorOnSurfaceInverse</macro>

</resources>
21 changes: 21 additions & 0 deletions token_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,27 @@ conversion_tasks:
- md.comp.menu.list-item.with-leading-icon.(hover|focus|pressed).icon.color
- md.comp.menu.list-item.with-trailing-icon.(hover|focus|pressed).icon.color

- # Snackbar component tokens.
token_sets: md.comp.snackbar
files:
- {input: tokens.jinja2, output: snackbar/res/values/tokens.xml}
suppressed_tokens:
# TODO(b/260628816) Container color is set programmatically.
- md.comp.snackbar.container.color
# TODO(b/260628816) Shadow color is not styleable.
- md.comp.snackbar.container.shadow-color
# TODO(b/260628816) Container height adapts to the contents.
- md.comp.snackbar.(with-single-line|with-two-lines).container.height
# TODO(b/260628816) Action text button style is defined in Button package.
- md.comp.snackbar.action.label-text.color
- md.comp.snackbar.action.(hover|focus|pressed).label-text.color
- md.comp.snackbar.action.(hover|focus|pressed).state-layer.(color|opacity)
- md.comp.snackbar.action.label-text.type
# TODO(b/260628816) No default close icon is implemented.
- md.comp.snackbar.icon.(color|size)
- md.comp.snackbar.icon.(hover|focus|pressed).icon.color
- md.comp.snackbar.icon.(hover|focus|pressed).state-layer.(color|opacity)

# - # List component tokens.
# TODO(b/260625883) No M3 styles for List.
# token_sets: md.comp.list
Expand Down

0 comments on commit 0f0b93c

Please sign in to comment.