diff --git a/docs/components/BottomNavigation.md b/docs/components/BottomNavigation.md index 0b21f3870..41e487beb 100644 --- a/docs/components/BottomNavigation.md +++ b/docs/components/BottomNavigation.md @@ -9,14 +9,20 @@ path: /catalog/bottom-navigation/ # Bottom navigation (Navigation bar) -**Note:** Bottom navigation has been renamed to navigation bar. - [Navigation bar](https://m3.material.io/components/navigation-bar/overview) lets people switch between UI views on smaller devices. -Navigation bar with 4 icons. +**Note:** The design name of this component has been changed from **Bottom +navigation** to **Navigation bar**. However, Material's Android implementation +remains as `BottomNavigationView`. + +Navigation bar with 4 icons. Navigation bar on compact and medium window sizes +Navigation bars can have three to five destinations. The nav bar is positioned +at the bottom of screens for convenient access. Each destination is represented +by an icon and label text. + **Note:** Images use various dynamic color schemes. ## Design & API documentation @@ -26,7 +32,7 @@ Navigation bar on compact and medium window sizes ## Anatomy -![Navigation bar anatomy diagram](assets/bottomnav/navigationbar_anatomy.png) +![Navigation bar anatomy diagram](assets/bottomnav/bottomnav-anatomy.png) 1. Container 2. Icon @@ -39,7 +45,9 @@ Navigation bar on compact and medium window sizes More details on anatomy items in the [component guidelines](https://m3.material.io/components/navigation-bar/guidelines#895b5b49-a166-4d30-90be-c71a4c970f04). -## M3 Expressive update +## M3 Expressive + +### M3 Expressive update Before you can use `Material3Expressive` component styles, follow the [`Material3Expressive` themes setup instructions](https://github.com/material-components/material-components-android/tree/master/docs/getting-started.md#material3expressive-themes). @@ -48,14 +56,35 @@ A new expressive style for the bottom navigation bar has been introduced that's shorter and supports horizontal navigation items in medium-sized windows. [More on M3 Expressive](https://m3.material.io/blog/building-with-m3-expressive) -Flexible horizontal navigation bar -The updated expressive navigation bar is shorter and can be used in medium -windows with horizontal nav items +Flexible horizontal navigation bar **Color:** * Active label changed from **on-surface-variant** to **secondary** +### M3 Expressive styles + +Changes from M3: + +* Height: From 80dp to 64dp +* Color: New expressive colors! +* Top item padding: From 12dp to 6dp +* Bottom item padding: From 16dp to 6dp +* Label text is no longer bolded when selected +* Active indicator: From 64dp to 56dp +* New horizontal item configuration on medium and larger window sizes (greater + than or equal to 600dp): + * Icon moves from top to start of item + * Instead of being a set width based on the item count, item width is + based on content with a max width + * Item gravity: From top center to center + +The default style for bottom navigation bar is: + +```xml +@style/Widget.Material3Expressive.BottomNavigationView +``` + ## Key properties ### Container attributes @@ -304,7 +333,7 @@ Here's an example: app:menu="@menu/bottom_navigation_menu"/> ``` -Horizontal navigation bar larger screens +Horizontal navigation bar larger screens ### Making navigation bar accessible diff --git a/docs/components/CommonButton.md b/docs/components/CommonButton.md index 181db0ffb..b09affc6c 100644 --- a/docs/components/CommonButton.md +++ b/docs/components/CommonButton.md @@ -13,12 +13,12 @@ path: /catalog/buttons/ take actions, and make choices, with a single tap. There are two variants of common buttons. -![2 types of common buttons](assets/buttons/commonbutton_types.png) +![2 types of common buttons](assets/buttons/commonbutton-types.png) 1. Default button 2. Toggle button -![Diagram of button styles and toggle behaviors](assets/buttons/commonbutton_styles.png) +![Diagram of button styles and toggle behaviors](assets/buttons/commonbutton-styles.png) There are five button styles, in order of emphasis: @@ -43,7 +43,7 @@ C. Toggle (selected)
## Anatomy -![Elevated button anatomy diagram](assets/buttons/commonbutton_anatomy.png) +![Elevated button anatomy diagram](assets/buttons/commonbutton-anatomy.png) 1. Container 2. Label text @@ -52,12 +52,14 @@ C. Toggle (selected)
More details on anatomy items in the [component guidelines](https://m3.material.io/components/buttons/guidelines#653b660b-e9d8-48ad-9f53-67fb3d76e09e). -## M3 Expressive update +## M3 Expressive + +### M3 Expressive update Before you can use `Material3Expressive` component styles, follow the [`Material3Expressive` themes setup instructions](https://github.com/material-components/material-components-android/tree/master/docs/getting-started.md#material3expressive-themes). -4 button changes in the expressive update. +4 button changes in the expressive update 1. Five sizes 2. Toggle (selection) @@ -93,6 +95,240 @@ can change shape when selected * 16dp (recommended to match padding of new sizes) * 24dp (deprecated) +### M3 Expressive styles + +#### Buttons + +
Filled
+ +Default
| Checked
| Unchecked
+---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------- +![Default expressive filled button example in dark theme](assets/buttons/default-filled-button-dark.png) | ![Checked expressive filled button in dark theme](assets/buttons/checked-filled-button-dark.png) | ![Unchecked expressive filled button in light theme](assets/buttons/unchecked-button-light.png) +![Default expressive filled button example in light theme](assets/buttons/default-filled-button-light.png) | ![Checked expressive filled button in light theme](assets/buttons/checked-filled-button-light.png) | ![Unchecked expressive filled button in dark theme](assets/buttons/unchecked-button-dark.png) + +By default, the filled button is uncheckable. To make it checkable, enable the +`android:checkable` attribute in style or layout. + +```xml +
+ +
Filled tonal
+ +Default
| Checked
| Unchecked
+------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------- +![Default expressive filled tonal button in light theme](assets/buttons/default-filled-tonal-light.png) | ![Checked expressive filled tonal button in dark theme](assets/buttons/checked-filled-tonal-dark.png) | ![Unchecked expressive filled tonal button in light theme](assets/buttons/unchecked-filled-tonal-light.png) +![Default expressive filled tonal button in dark theme](assets/buttons/default-filled-tonal-dark.png) | ![Checked expressive filled tonal button in light theme](assets/buttons/checked-filled-tonal-light.png) | ![Unchecked expressive filled tonal button in dark theme](assets/buttons/unchecked-filled-tonal-dark.png) + +By default, the tonal button is uncheckable. To make it checkable, enable the +`android:checkable` attribute in style or layout. + +```xml +
+ +
Outlined
+ +Default
| Checked
| Unchecked
+------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ----------------------------------------- +![Default expressive outlined button button in light theme](assets/buttons/default-outlined-button-light.png) | ![Checked expressive outlined button in dark theme](assets/buttons/checked-outlined-button-dark.png) | ![Unchecked expressive outlined button in light theme](assets/buttons/unchecked-outlined-button-light.png) +![Default expressive outlined button button in dark theme](assets/buttons/default-outlined-button-dark.png) | ![Checked expressive outlined button in light theme](assets/buttons/checked-outlined-button-light.png) | ![Unchecked expressive outlined button in dark theme](assets/buttons/unchecked-outlined-button-dark.png) + +By default, the outlined button is uncheckable. To make it checkable, enable the +`android:checkable` attribute in style or layout. + +```xml +
+ +
Text
+ +Expressive text button in dark theme with dark text and no outline
| Expressive text button in light theme with light text and no outline
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +The text button appears as only text until pressed. It does not have a solid +fill or outline by default. + +```xml +
+ +
Elevated
+ +Default
| Checked
| Unchecked
+----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------- +![Default expressive elevated button in light theme](assets/buttons/default-elevated-light.png) | ![Checked expressive elevated button in dark theme](assets/buttons/checked-elevated-dark.png) | ![Unchecked expressive elevated button in light theme](assets/buttons/unchecked-elevated-light.png) +![Default expressive elevated button in dark theme](assets/buttons/default-elevated-dark.png) | ![Checked expressive elevated button in light theme](assets/buttons/checked-elevated-light.png) | ![Unchecked expressive elevated button in dark theme](assets/buttons/unchecked-elevated-dark.png) + +By default, the elevated button is uncheckable. To make it checkable, enable the +`android:checkable` attribute in style or layout. + +```xml +
+ +
Filled button with icons
+ +Default
| Checked
| Unchecked
+------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------- +![Default expressive filled icon button in light theme](assets/buttons/default-filled-icon-button-light.png) | ![Checked expressive filled icon button in dark theme](assets/buttons/checked-filled-icon-button-dark.png) | ![Unchecked expressive filled icon button in light theme](assets/buttons/unchecked-filled-icon-button-light.png) +![Default expressive filled icon button in dark theme](assets/buttons/default-filled-icon-button-dark.png) | ![Checked expressive filled icon button in light theme](assets/buttons/checked-filled-icon-button-light.png) | ![Unchecked expressive filled icon button in dark theme](assets/buttons/unchecked-filled-icon-button-dark.png) + +Icons visually communicate the button’s action and help draw attention. They +should be placed on the leading side of the button, before the label text. + +```xml +
+ +#### Shapes + +
Round
+ +Default
| Checked
| Unchecked
+---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------- +![Default expressive round filled button with icon in light theme](assets/buttons/default-round-shape.png) | ![Checked expressive round filled button with icon in light theme](assets/buttons/checked-round-shaped.png) | ![Unchecked expressive square round button with icon in light theme](assets/buttons/unchecked-round-shape.png) + +```xml +
+ +
Square
+ +Default
| Checked
| Unchecked
+------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------- +![Default expressive square filled button with icon in light theme](assets/buttons/default-square-shape.png) | ![Checked expressive square filled button with icon in light theme](assets/buttons/checked-square-shape.png) | ![Unchecked expressive square filled button with icon in light theme](assets/buttons/unchecked-square-shape.png) + +```xml +
+ +#### Sizes + +**Note:** Images below show the label buttons in different sizes relatively. The +actual sizes in px on mobile devices depends on the screen pixel density. + +
Extra small
+ + + +```xml +
+ +
Small
+ + + +```xml +
+ +
Medium
+ + + +```xml +
+ +
Large
+ + + +```xml +
+ +
Extra Large
+ + + +```xml +
+ ## Key properties
@@ -388,7 +624,7 @@ page. * The default and toggle buttons use different colors * Toggle buttons don’t use the text style -![5 types of common buttons](assets/buttons/commonbuttons_types.png) +![5 types of common buttons](assets/buttons/commonbuttons-types.png) 1. Elevated button 2. Filled button @@ -421,7 +657,7 @@ In the layout: ```xml