Skip to content

Commit 9ce3d15

Browse files
nickroutpekingme
authored andcommitted
[Documentation] Composite revamp.
PiperOrigin-RevId: 353052233
1 parent 2a639a3 commit 9ce3d15

File tree

12 files changed

+70
-67
lines changed

12 files changed

+70
-67
lines changed

docs/components/Button.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ unnecessary.
4545
For more information on content labels, go to the
4646
[Android accessibility help guide](https://support.google.com/accessibility/android/answer/7158690).
4747

48-
## Types
48+
### Types
4949

5050
There are four types of buttons: 1\. [Text button](#text-button), 2\.
5151
[Outlined button](#outlined-button), 3\. [Contained button](#contained-button),

docs/components/Chip.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ val text = editText.text!!
213213
text.setSpan(span, 0, text.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
214214
```
215215

216-
## Types
216+
### Types
217217

218218
There are four types of chips: 1\. [input (entry)](#input-chip), 2\.
219219
[choice](#choice-chip), 3\. [filter](#filter-chip), 4\. [action](#action-chip)
@@ -232,14 +232,14 @@ API and source code:
232232
* [Class definition](https://developer.android.com/reference/com/google/android/material/chip/ChipDrawable)
233233
* [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/chip/ChipDrawable.java)
234234

235-
### Input chip
235+
## Input chip
236236

237237
Input chips (refered to as **entry** chips in Android) represent a complex piece
238238
of information in compact form, such as an entity (person, place, or thing) or
239239
text. They enable user input and verify that input by converting text into
240240
chips.
241241

242-
#### Input chip example
242+
### Input chip example
243243

244244
The following example shows three input chips.
245245

@@ -270,14 +270,14 @@ In the layout:
270270
</com.google.android.material.chip.ChipGroup>
271271
```
272272

273-
### Choice chip
273+
## Choice chip
274274

275275
Choice chips allow selection of a single chip from a set of options.
276276

277277
Choice chips clearly delineate and display options in a compact area. They are a
278278
good alternative to toggle buttons, radio buttons, and single select menus.
279279

280-
#### Caveats
280+
### Caveats
281281

282282
If you add choice chips to a dialog (which has 24dp elevation), disable the
283283
chips' elevation overlays to ensure that there is sufficient color contrast when
@@ -298,7 +298,7 @@ the chips are checked.
298298
</style>
299299
```
300300

301-
#### Choice chip example
301+
### Choice chip example
302302

303303
The following example shows four choice chips.
304304

@@ -335,14 +335,14 @@ In the layout:
335335
</com.google.android.material.chip.ChipGroup>
336336
```
337337

338-
### Filter chip
338+
## Filter chip
339339

340340
Filter chips use tags or descriptive words to filter content.
341341

342342
Filter chips clearly delineate and display options in a compact area. They are a
343343
good alternative to toggle buttons or checkboxes.
344344

345-
#### Filter chip example
345+
### Filter chip example
346346

347347
The following example shows six filter chips.
348348

@@ -390,15 +390,15 @@ In the layout:
390390
</com.google.android.material.chip.ChipGroup>
391391
```
392392

393-
### Action chip
393+
## Action chip
394394

395395
Action chips offer actions related to primary content. They should appear
396396
dynamically and contextually in a UI.
397397

398398
An alternative to action chips are buttons, which should appear persistently and
399399
consistently.
400400

401-
#### Action chip example
401+
### Action chip example
402402

403403
The following example shows four action chips.
404404

docs/components/Dialog.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ such as an icon on a title having a content description via the
4343
`android:contentDescription` attribute set in the
4444
`MaterialAlertDialog.MaterialComponents.Title.Icon` style or descendant.
4545

46-
## Types
46+
### Types
4747

4848
There are four types of dialogs: 1\. [Alert dialog](#alert-dialog), 2\.
4949
[Simple dialog](#simple-dialog), 3\.
@@ -69,7 +69,7 @@ API and source code:
6969
* [Class description](https://developer.android.com/reference/com/google/android/material/dialog/MaterialAlertDialogBuilder)
7070
* [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/dialog/MaterialAlertDialogBuilder.java)
7171

72-
#### Alert dialog
72+
## Alert dialog
7373

7474
Alert dialogs interrupt users with urgent information, details, or actions.
7575

@@ -95,7 +95,7 @@ MaterialAlertDialogBuilder(context)
9595
.show()
9696
```
9797

98-
#### Simple dialog
98+
## Simple dialog
9999

100100
Simple dialogs can display items that are immediately actionable when selected.
101101
They don’t have text buttons.
@@ -121,7 +121,7 @@ MaterialAlertDialogBuilder(context)
121121
.show()
122122
```
123123

124-
#### Confirmation dialog
124+
## Confirmation dialog
125125

126126
Confirmation dialogs give users the ability to provide final confirmation of a
127127
choice before committing to it, so they have a chance to change their minds if
@@ -170,7 +170,7 @@ MaterialAlertDialogBuilder(context)
170170
.show()
171171
```
172172

173-
#### Full-screen dialog
173+
## Full-screen dialog
174174

175175
Full-screen dialogs group a series of tasks, such as creating a calendar entry
176176
with the event title, date, location, and time. Because they take up the entire

docs/components/FloatingActionButton.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,28 +93,24 @@ Or, you can set a custom size via the `app:fabCustomSize` attribute. If set,
9393
`app:fabSize` will be ignored, unless the custom size is cleared via the
9494
`clearCustomSize` method.
9595

96-
## Types
96+
### Types
9797

9898
There are three types of FABS: 1\. [Regular FABs](#regular-fabs), 2\.
9999
[Mini FABs](#mini-fabs), 3\. [Extended FABs](#extended-fabs)
100100

101101
![FAB types](assets/fabs/FAB_types.png)
102102

103-
## FABs
103+
## Regular FABs
104104

105-
Floating action buttons come in a default and mini size.
105+
Regular FABs are FABs that are not expanded and are a regular size.
106106

107107
API and source code:
108108

109109
* `FloatingActionButton`
110110
* [Class description](https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton)
111111
* [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/floatingactionbutton/FloatingActionButton.java)
112112

113-
### Regular FABs
114-
115-
Regular FABs are FABs that are not expanded and are a regular size.
116-
117-
#### Regular FAB example
113+
### Regular FAB example
118114

119115
The following example shows a regular FAB with a plus icon.
120116

@@ -159,13 +155,19 @@ A regular FAB has a container and an icon.
159155
1. Container
160156
1. Icon
161157

162-
### Mini FABs
158+
## Mini FABs
163159

164160
A mini FAB should be used on smaller screens.
165161

166162
Mini FABs can also be used to create visual continuity with other screen
167163
elements.
168164

165+
API and source code:
166+
167+
* `FloatingActionButton`
168+
* [Class description](https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton)
169+
* [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/floatingactionbutton/FloatingActionButton.java)
170+
169171
### Mini FAB example
170172

171173
The following example shows a mini FAB with a plus icon.

docs/components/Menu.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ menu. While optional, their use is strongly encouraged. For more information
8080
about this component's accessibility, check out
8181
[the text field's a11y section](TextField.md#making-text-fields-accessible).
8282

83-
## Types
83+
### Types
8484

8585
Menus allow users to make a selection from multiple options. They are less
8686
prominent and take up less space than selection controls, such as a set of radio
@@ -452,7 +452,7 @@ _**Note:** The exposed dropdown menu is implemented through the
452452
[Material text fields](https://material.io/design/components/text-fields.html)
453453
and their usage, see the [TextInputLayout documentation](TextField.md)._
454454

455-
#### Exposed dropdown menu example
455+
### Exposed dropdown menu example
456456

457457
API and source code:
458458

@@ -522,13 +522,13 @@ To have an outlined variation of the exposed dropdown menu, set the `style` to
522522

523523
![Menu with purple outlined text field element and 4 options. Option 1 selected.](assets/menu/menus_exposed_dropdown_outlined.png)
524524

525-
##### Non editable variation
525+
#### Non editable variation
526526

527527
Disable the user input in the `AutoCompleteTextView` to have a non editable
528528
variation of the menu by setting `android:inputType="none"` on the
529529
`AutoCompleteTextView`.
530530

531-
##### Setting a default value
531+
#### Setting a default value
532532

533533
In order to have a pre-selected value displayed, you can call
534534
`setText(CharSequence text, boolean filter)` on the `AutoCompleteTextView` with
@@ -582,6 +582,10 @@ and
582582

583583
## Theming menus
584584

585+
Menus drawers support
586+
[Material Theming](https://material.io/components/text-fields/#theming) and can
587+
be customized in terms of color, typography and shape.
588+
585589
### Menu theming examples
586590

587591
Popup, overflow, and list popup window menus support
@@ -605,7 +609,7 @@ The following example shows a menu with Material Theming.
605609

606610
![White menu container with brown text showing 3 options](assets/menu/menus_theming.png)
607611

608-
#### Implementing menu theming
612+
### Implementing menu theming
609613

610614
Using default style theme attributes (affects all menus but does not affect
611615
other components):
@@ -682,7 +686,7 @@ Material Theming.
682686
button 1 is grey,, button 2 has a pink
683687
outline](assets/menu/menus_exposed_dropdown_theming.png)
684688

685-
#### Implementing exposed dropdown menu theming
689+
### Implementing exposed dropdown menu theming
686690

687691
Using default style theme attributes, styles and theme overlays (themes all
688692
menus but does not affect other components):

docs/components/NavigationDrawer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Default style theme attribute: `?attr/navigationViewStyle`
300300

301301
Default style theme attribute: `?attr/drawerLayoutStyle`
302302

303-
## Types
303+
### Types
304304

305305
There are three types of navigation drawers: 1\.
306306
[Standard navigation drawer](#standard-navigation-drawer), 2\.

docs/components/ProgressIndicator.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,19 @@ to set the target visibility as `Visibiltiy.INVISIBLE` (default) or
134134
Progress indicators can have rounded corners via `app:trackCornerRadius` or the
135135
`setTrackCornerRadius` method.
136136

137-
## Types
137+
### Types
138138

139-
Material Design offers two visually distinct types of progress indicators:
140-
141-
1. [linear](#linear-progress-indicators)
142-
2. [circular](#circular-progress-indicators)
139+
Material Design offers two visually distinct types of progress indicators: 1\.
140+
[linear](#linear-progress-indicators) 2\.
141+
[circular](#circular-progress-indicators)
143142

144143
Only one type should represent each kind of activity in an app. For example, if
145144
a refresh action displays a circular indicator on one screen, that same action
146145
shouldn’t use a linear indicator elsewhere in the app.
147146

148-
![Composite image of progress indicator types](assets/progressindicator/indeterminate_composite.gif)
147+
![Composite image of progress indicator types](assets/progressindicator/types.gif)
149148

150-
### Linear progress indicators
149+
## Linear progress indicators
151150

152151
Linear progress indicators display progress by animating an indicator along the
153152
length of a fixed, visible track. The behavior of the indicator is dependent on
@@ -204,7 +203,7 @@ For linear progress indicator, there are two indeterminate animation types:
204203
* `contiguous` - animates as repeated cycles with three adjacent segments in
205204
iterative different colors.
206205

207-
### Circular progress indicators
206+
## Circular progress indicators
208207

209208
Circular progress indicators display progress by animating an indicator along an
210209
invisible circular track in a clockwise direction. They can be applied directly
@@ -264,33 +263,33 @@ indicators:
264263

265264
&nbsp; | Attribute | Related method(s) | Default value
266265
----------------------------- | --------------------------- | --------------------------------------------------------- | -------------
267-
**track thickness** | `app:trackThickness` | `setTrackThickness`</br>`getTrackThickness` | `4dp`
268-
**indicator color** | `app:indicatorColor` | `setIndicatorColor`</br>`getIndicatorColor` | `colorPrimary`
269-
**track color** | `app:trackColor` | `setTrackColor`</br>`getTrackColor` | `indicatorColor` at `disabledAlpha`
270-
**track corner radius** | `app:trackCornerRadius` | `setTrackCornerRadius`</br>`getTrackCornerRadius` | `0dp`
271-
**show animation behavior** | `app:showAnimationBehavior` | `setShowAnimationBehavior`</br>`getShowAnimationBehavior` | `none`
272-
**hide animation behavior** | `app:hideAnimationBehavior` | `setHideAnimationBehavior`</br>`getHideAnimationBehavior` | `none`
273-
**delay (in ms) to show** | `app:showDelay` | N/A | 0
274-
**min delay (in ms) to hide** | `app:minHideDelay` | N/A | 0
266+
**Track thickness** | `app:trackThickness` | `setTrackThickness`</br>`getTrackThickness` | `4dp`
267+
**Indicator color** | `app:indicatorColor` | `setIndicatorColor`</br>`getIndicatorColor` | `colorPrimary`
268+
**Track color** | `app:trackColor` | `setTrackColor`</br>`getTrackColor` | `indicatorColor` at `disabledAlpha`
269+
**Track corner radius** | `app:trackCornerRadius` | `setTrackCornerRadius`</br>`getTrackCornerRadius` | `0dp`
270+
**Show animation behavior** | `app:showAnimationBehavior` | `setShowAnimationBehavior`</br>`getShowAnimationBehavior` | `none`
271+
**Hide animation behavior** | `app:hideAnimationBehavior` | `setHideAnimationBehavior`</br>`getHideAnimationBehavior` | `none`
272+
**Delay (in ms) to show** | `app:showDelay` | N/A | 0
273+
**Min delay (in ms) to hide** | `app:minHideDelay` | N/A | 0
275274

276275
#### Linear type specific attributes
277276

278277
Linear type progress indicators also have the following attributes:
279278

280279
&nbsp; | Attribute | Related method(s) | Default value
281280
-------------------------------- | -------------------------------- | ------------------------------------------------------------------- | -------------
282-
**indeterminate animation type** | `app:indeterminateAnimationType` | `setIndeterminateAnimationType`</br>`getIndeterminateAnimationType` | `disjoint`
283-
**indicator direction** | `app:indicatorDirectionLinear` | `setIndicatorDirection`</br>`getIndicatorDirection` | `leftToRight`
281+
**Indeterminate animation type** | `app:indeterminateAnimationType` | `setIndeterminateAnimationType`</br>`getIndeterminateAnimationType` | `disjoint`
282+
**Indicator direction** | `app:indicatorDirectionLinear` | `setIndicatorDirection`</br>`getIndicatorDirection` | `leftToRight`
284283

285284
#### Circular type specific attributes
286285

287286
Circular type progress indicators also have the following attributes:
288287

289288
&nbsp; | Attribute | Related method(s) | Default value
290289
--------------------------------- | -------------------------------- | --------------------------------------------------- | -------------
291-
**spinner size (outer diameter)** | `app:indicatorSize` | `setIndicatorSize`</br>`getIndicatorSize` | `40dp`
292-
**inset** | `app:indicatorInset` | `setIndicatorInset`</br>`getIndicatorInset` | `4dp`
293-
**indicator direction** | `app:indicatorDirectionCircular` | `setIndicatorDirection`</br>`getIndicatorDirection` | `clockwise`
290+
**Spinner size (outer diameter)** | `app:indicatorSize` | `setIndicatorSize`</br>`getIndicatorSize` | `40dp`
291+
**Inset** | `app:indicatorInset` | `setIndicatorInset`</br>`getIndicatorInset` | `4dp`
292+
**Indicator direction** | `app:indicatorDirectionCircular` | `setIndicatorDirection`</br>`getIndicatorDirection` | `clockwise`
294293

295294
#### Styles
296295

docs/components/Slider.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ rangeSlider.setLabelFormatter { value: Float ->
168168
}
169169
```
170170

171-
## Types
171+
### Types
172172

173173
There are two types of sliders: 1\. [Continuous slider](#continuous-slider), 2\.
174174
[Discrete slider](#discrete-slider)
@@ -177,7 +177,7 @@ There are two types of sliders: 1\. [Continuous slider](#continuous-slider), 2\.
177177

178178
A slider with two thumbs is called a range slider.
179179

180-
### Continuous slider
180+
## Continuous slider
181181

182182
Continuous sliders allow users to make meaningful selections that don’t require
183183
a specific value.
@@ -205,7 +205,7 @@ In the layout:
205205
android:valueTo="100.0" />
206206
```
207207

208-
#### Continuous range slider
208+
### Continuous range slider
209209

210210
API and source code:
211211

@@ -230,7 +230,7 @@ In the layout:
230230
android:valueTo="100.0" />
231231
```
232232

233-
### Discrete slider
233+
## Discrete slider
234234

235235
Discrete sliders display a numeric value label upon pressing the thumb, which
236236
allows a user to input an exact value.
@@ -253,7 +253,7 @@ In the layout:
253253
android:stepSize="5.0" />
254254
```
255255

256-
#### Discrete range slider
256+
### Discrete range slider
257257

258258
API and source code:
259259

0 commit comments

Comments
 (0)