@@ -55,7 +55,8 @@ widget in your layout:
55
55
android : layout_width =" wrap_content"
56
56
android : layout_height =" wrap_content"
57
57
android : layout_gravity =" bottom|right"
58
- android : layout_margin =" 16dp" />
58
+ android : layout_margin =" 16dp"
59
+ app : srcCompat =" @drawable/ic_plus_24" />
59
60
60
61
</android .support.design.widget.CoordinatorLayout>
61
62
```
@@ -71,14 +72,28 @@ covered by an [AppBarLayout](AppBarLayout.md) or
71
72
The updated Material FloatingActionButton consists of updated elevation, ripple,
72
73
and motion changes.
73
74
74
- ``` java
75
- style= " @/style/Widget.MaterialComponents.FloatingActionButton"
75
+ ``` xml
76
+ <android .support.design.widget.FloatingActionButton
77
+ android : id =" @+id/floating_action_button"
78
+ style =" @/style/Widget.MaterialComponents.FloatingActionButton"
79
+ android : layout_width =" wrap_content"
80
+ android : layout_height =" wrap_content"
81
+ android : layout_gravity =" bottom|right"
82
+ android : layout_margin =" 16dp"
83
+ app : srcCompat =" @drawable/ic_plus_24" />
76
84
```
77
85
78
86
### Material Styles (Legacy)
79
87
80
- ``` java
81
- style= " @/style/Widget.Design.FloatingActionButton"
88
+ ``` xml
89
+ <android .support.design.widget.FloatingActionButton
90
+ android : id =" @+id/floating_action_button"
91
+ style =" @/style/Widget.Design.FloatingActionButton"
92
+ android : layout_width =" wrap_content"
93
+ android : layout_height =" wrap_content"
94
+ android : layout_gravity =" bottom|right"
95
+ android : layout_margin =" 16dp"
96
+ app : srcCompat =" @drawable/ic_plus_24" />
82
97
```
83
98
84
99
### Attributes
@@ -109,7 +124,7 @@ FloatingActionButton floatingActionButton =
109
124
110
125
floatingActionButton. setOnClickListener(new OnClickListener () {
111
126
@Override
112
- public void onClick (View v ) {
127
+ public void onClick (View view ) {
113
128
// Handle the click.
114
129
}
115
130
});
0 commit comments