Skip to content

Commit 4a5da9a

Browse files
Material Design Teampaulfthomas
authored andcommitted
[Docs] Updated Material Text View doc to make it more user friendly
PiperOrigin-RevId: 767067397
1 parent 5cb3900 commit 4a5da9a

File tree

1 file changed

+30
-29
lines changed

1 file changed

+30
-29
lines changed

docs/components/MaterialTextView.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,44 @@ iconId: text_view
77
path: /catalog/material-text-view/
88
-->
99

10-
# Material Text View
10+
# Material text view
1111

12-
## Using text views
13-
14-
A MaterialTextView is a derivative of AppCompatTextView that displays text to
15-
the user. To provide user-editable text, see
12+
A material text view is a derivative of `AppCompatTextView` that displays text
13+
to the user. To provide user-editable text, see
1614
[EditText](https://developer.android.com/reference/android/widget/EditText).
1715

18-
## Design and API Documentation
16+
## Key properties
17+
18+
### Attributes
19+
20+
`MaterialTextView` supports all of the standard attributes that can be changed
21+
for a
22+
[`AppCompatTextView`](https://developer.android.com/reference/android/support/v7/widget/AppCompatTextView).
23+
Unlike the `AppCompatTextView` which supports specifying the line height only in
24+
a view layout XML, `MaterialTextView` supports the ability to read the line
25+
height from a `TextAppearance` style, which can be applied to the
26+
`MaterialTextView` either using the `style` attribute or using the
27+
`android:textAppearance` attribute.
28+
29+
The following additional attributes can be changed in `TextAppearance` and
30+
applied to a `MaterialTextView`:
31+
32+
Feature | Relevant attributes
33+
----------- | --------------------
34+
Line Height | `android:lineHeight`
35+
36+
## Code implementation
37+
38+
API and source code:
1939

2040
* `MaterialTextView`
41+
2142
* [Class description](https://developer.android.com/reference/com/google/android/material/textview/MaterialTextView)
2243
* [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/textview/MaterialTextView.java)
2344

24-
## Usage
45+
**Note:** If you use our full themes (which we recommend), `TextView` will
46+
auto-inflate to `MaterialTextView`, otherwise, you will need to specify
47+
`<com.google.android.material.textview.MaterialTextView` in your xml.
2548

2649
Example code of how to include the component in your layout is listed here for
2750
reference.
@@ -38,25 +61,3 @@ reference.
3861
android:text="@string/hello" />
3962
</LinearLayout>
4063
```
41-
42-
**Note:** If you use our full themes (which we recommend), `TextView` will
43-
auto-inflate to `MaterialTextView`, otherwise, you will need to specify
44-
`<com.google.android.material.textview.MaterialTextView` in your xml.
45-
46-
### Attributes
47-
48-
`MaterialTextView` supports all of the standard attributes that can be changed
49-
for a
50-
[`AppCompatTextView`](https://developer.android.com/reference/android/support/v7/widget/AppCompatTextView).
51-
Unlike the `AppCompatTextView` which supports specifying the line height only in
52-
a view layout XML, `MaterialTextView` supports the ability to read the line
53-
height from a `TextAppearance` style, which can be applied to the
54-
`MaterialTextView` either using the `style` attribute or using the
55-
`android:textAppearance` attribute.
56-
57-
The following additional attributes can be changed in `TextAppearance` and
58-
applied to a `MaterialTextView`:
59-
60-
Feature | Relevant attributes
61-
----------- | --------------------
62-
Line Height | `android:lineHeight`

0 commit comments

Comments
 (0)