[MaterialButton] Add support for TOP & BOTTOM icon gravity
See original GitHub issueIs your feature request related to a problem? Please describe.
Up until release 1.1.0-alpha06
back in May 2019, the only way to change the icon position was done using TextViewCompat.setCompoundDrawablesRelative
.
After introducing new method setIconGravity
in release 1.1.0-alpha06
it was finally possible to properly set the icon position, although only on the right or left, and close to the text or not.
This now excludes the possibility to place the icon either on top or bottom relative to the text.
Describe the solution you’d like
Please kindly add TOP & BOTTOM gravity as part of @IconGravity
.
Describe alternatives you’ve considered
As said at the beginning, before release 1.1.0-alpha06
, the only way to change the icon position was using TextViewCompat.setCompoundDrawablesRelative
.
This no longer works, as it triggers a requestLayout
which, at some point, will trigger updateIconPosition
and then updateIcon
where only START/TEXT & END/TEXT are supported.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:20 (13 by maintainers)
Top GitHub Comments
Actually, in Gmail, there are buttons which have the icon on the left, but when insufficient width is there, they push the icon on the top. Seems pretty useful.
I’ve sent a PR adding top gravity only, let’s wait if it is approved!