@@ -7,21 +7,44 @@ iconId: text_view
7
7
path: /catalog/material-text-view/
8
8
-->
9
9
10
- # Material Text View
10
+ # Material text view
11
11
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
16
14
[ EditText] ( https://developer.android.com/reference/android/widget/EditText ) .
17
15
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:
19
39
20
40
* ` MaterialTextView `
41
+
21
42
* [ Class description] ( https://developer.android.com/reference/com/google/android/material/textview/MaterialTextView )
22
43
* [ Class source] ( https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/textview/MaterialTextView.java )
23
44
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.
25
48
26
49
Example code of how to include the component in your layout is listed here for
27
50
reference.
@@ -38,25 +61,3 @@ reference.
38
61
android : text =" @string/hello" />
39
62
</LinearLayout >
40
63
```
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