Skip to content

Commit 0748414

Browse files
dsn5ftraajkumars
authored andcommitted
[Docs][Button] Add note about MaterialButton icon button performance and alternatives
PiperOrigin-RevId: 591042198
1 parent a0a1c6e commit 0748414

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/components/Button.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,8 @@ API and source code:
777777
* `CheckBox`
778778
* [Class description](https://developer.android.com/reference/android/widget/CheckBox)
779779

780-
**Note** The `CheckBox` API is just one of several inputs that can implement the
781-
icon button. See other
780+
**Note:** The `CheckBox` API is just one of several inputs that can implement
781+
the icon button. See other
782782
[selection controls](https://material.io/components/selection-controls/) for
783783
more details.
784784

@@ -846,6 +846,14 @@ information.
846846
* Ensure that the tooltip describes the button’s action, rather than
847847
the icon.
848848

849+
**Note:** The examples below show how to create an icon button using `Button`
850+
which will be inflated to `MaterialButton` when using a Material theme. There is
851+
a known performance issue where `MaterialButton` takes longer to initialize when
852+
compared to `ImageButton` or `AppCompatImageButton`, in large part because
853+
`MaterialButton` extends from `AppCompatButton` which supports more than just
854+
icon buttons. Consider using those pure icon button alternatives if the extra
855+
latency causes a noticeable issue for your app.
856+
849857
#### Icon button examples
850858

851859
API and source code:

0 commit comments

Comments
 (0)