Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] shapeAppearanceSmallComponent, shapeAppearanceMediumComponent, and shapeAppearanceLargeComponent have no effect #4385

Open
manabu-nakamura opened this issue Nov 17, 2024 · 1 comment · May be fixed by #4386 or #4445
Labels

Comments

@manabu-nakamura
Copy link
Contributor

Description:
shapeAppearanceSmallComponent, shapeAppearanceMediumComponent, and shapeAppearanceLargeComponent have no effect because they are not used in Widget.Material3.* (they are used in Widget.MaterialComponents.*):
https://github.com/material-components/material-components-android/blob/master/docs/components/BottomAppBar.md
https://github.com/material-components/material-components-android/blob/master/docs/components/Button.md
https://github.com/material-components/material-components-android/blob/master/docs/components/Card.md
https://github.com/material-components/material-components-android/blob/master/docs/components/Chip.md
https://github.com/material-components/material-components-android/blob/master/docs/components/DatePicker.md
https://github.com/material-components/material-components-android/blob/master/docs/components/SideSheet.md
https://github.com/material-components/material-components-android/blob/master/docs/components/TextField.md

e.g. https://github.com/material-components/material-components-android/blob/master/docs/components/DatePicker.md:

<style name="Theme.App" parent="Theme.Material3.*">
    ...
    <item name="colorPrimary">@color/shrine_pink_100</item>
    <item name="colorOnPrimary">@color/shrine_pink_900</item>
    <item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.App.SmallComponent</item>
    <item name="shapeAppearanceMediumComponent">@style/ShapeAppearance.App.MediumComponent</item>
</style>

<style name="ShapeAppearance.App.SmallComponent" parent="ShapeAppearance.Material3.SmallComponent">
    <item name="cornerFamily">cut</item>
</style>

<style name="ShapeAppearance.App.MediumComponent" parent="ShapeAppearance.Material3.MediumComponent">
    <item name="cornerSize">16dp</item>
</style>

Expected behavior:

<style name="Theme.App" parent="Theme.Material3.*">
    ...
    <item name="colorPrimary">@color/shrine_pink_100</item>
    <item name="colorOnPrimary">@color/shrine_pink_900</item>
    <item name="shapeCornerFamily">cut</item>
</style>

See also:
https://m3.material.io/components/bottom-app-bar/overview#adfd8035-0454-40e6-8ebb-1aee46d9f32a:

M2: Bottom app bar ... did not contain the FAB
M3: Bottom app bar ... contains the FAB

https://github.com/material-components/material-components-android/blob/master/docs/components/BottomAppBar.md#bottom-app-bar-theming-example:

bottomappbar_theming
(The bottom app bar does not contain the FAB.)

@manabu-nakamura manabu-nakamura linked a pull request Nov 17, 2024 that will close this issue
@manabu-nakamura
Copy link
Contributor Author

M3:

<style name="Widget.Material3.MaterialCalendar" parent="Widget.MaterialComponents.MaterialCalendar">
    <item name="daySelectedStyle">@style/Widget.Material3.MaterialCalendar.Day.Selected</item>
</style>

<style name="Widget.Material3.MaterialCalendar.Day.Selected">
</style>

<style name="Widget.Material3.MaterialCalendar.Day" parent="Widget.Material3.MaterialCalendar.Item">
    <item name="itemShapeAppearance">@style/ShapeAppearance.M3.Comp.DatePicker.Modal.Date.Container.Shape</item>
</style>

<style name="ShapeAppearance.M3.Comp.DatePicker.Modal.Date.Container.Shape" parent="ShapeAppearance.M3.Sys.Shape.Corner.Full"/>

<style name="ShapeAppearance.M3.Sys.Shape.Corner.Full" parent="">
    <item name="cornerFamily">?attr/shapeCornerFamily</item>
</style>

    <item name="shapeCornerFamily">@integer/m3_sys_shape_corner_full_corner_family</item>

    <integer name="m3_sys_shape_corner_full_corner_family">0</integer>

M2:

<style name="Widget.MaterialComponents.MaterialCalendar" parent="android:Widget">
    <item name="daySelectedStyle">@style/Widget.MaterialComponents.MaterialCalendar.Day.Selected</item>
</style>

<style name="Widget.MaterialComponents.MaterialCalendar.Day.Selected">
</style>

<style name="Widget.MaterialComponents.MaterialCalendar.Day" parent="Widget.MaterialComponents.MaterialCalendar.Item">
</style>

<style name="Widget.MaterialComponents.MaterialCalendar.Item" parent="">
    <item name="itemShapeAppearance">?attr/shapeAppearanceSmallComponent</item>
</style>

    <item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.MaterialComponents.SmallComponent</item>

<style name="ShapeAppearance.MaterialComponents.SmallComponent">
</style>

<style name="ShapeAppearance.MaterialComponents" parent="">
    <item name="cornerFamily">rounded</item>
</style>

@manabu-nakamura manabu-nakamura linked a pull request Nov 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant