Skip to content

Commit

Permalink
[Docs][Button] Add note about MaterialButton icon button performance …
Browse files Browse the repository at this point in the history
…and alternatives

PiperOrigin-RevId: 591042198
  • Loading branch information
dsn5ft authored and raajkumars committed Dec 15, 2023
1 parent a0a1c6e commit 0748414
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/components/Button.md
Expand Up @@ -777,8 +777,8 @@ API and source code:
* `CheckBox`
* [Class description](https://developer.android.com/reference/android/widget/CheckBox)

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

Expand Down Expand Up @@ -846,6 +846,14 @@ information.
* Ensure that the tooltip describes the button’s action, rather than
the icon.

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

#### Icon button examples

API and source code:
Expand Down

0 comments on commit 0748414

Please sign in to comment.