172 Commits

Author SHA1 Message Date
pekingme
2019bf90be [Tokens] Upgraded to version v0.147.
PiperOrigin-RevId: 492551875
2022-12-02 18:34:12 -05:00
pekingme
17e3581642 [Tokens] Upgraded to v0.145
PiperOrigin-RevId: 492291163
2022-12-02 15:11:37 +00:00
pekingme
b9963a5212 [Tokens][Android] Omitted more comments when configuration specifies no comments.
PiperOrigin-RevId: 492290497
2022-12-02 15:04:22 +00:00
pekingme
8ee6c00f73 [Tokens] Upgraded to v0.142
Added lStar CSLs for new neutral palettes in v31 and above.

PiperOrigin-RevId: 491693724
2022-11-30 17:31:11 -05:00
pekingme
12ef329276 [Tokens] Upgraded to v0.141
PiperOrigin-RevId: 490324728
2022-11-23 15:13:20 -05:00
pekingme
b2b546b205 [Tokens] Internal updates.
PiperOrigin-RevId: 490295053
2022-11-23 15:11:19 -05:00
raajkumars
b9e8fb89fa [Tokens][M3][Button] Integrate M3 Tokens.
PiperOrigin-RevId: 486679417
2022-11-09 22:13:11 +00:00
Material Design Team
3b333ee834 [Buttons] Use Layout to measure text width.
This corrects icon placement when used with Spanned text.

PiperOrigin-RevId: 483047554
2022-10-25 05:42:10 -07:00
Blue
e8bfad5644 [MaterialButtonToggleGroup] handle setEnable childs
Resolves https://github.com/material-components/material-components-android/pull/2974
Resolves https://github.com/material-components/material-components-android/issues/2962
Resolves https://github.com/material-components/material-components-android/issues/1813

GIT_ORIGIN_REV_ID=e8f6b7cb1ca143f0ed1e2ec8d501164568dac2d9
PiperOrigin-RevId: 479403809
2022-10-11 14:00:17 +00:00
pubiqq
b6c6600ad8 [MaterialButtonToggleGroup] Added the default Material3 toggleGroupStyle
Resolves https://github.com/material-components/material-components-android/pull/2961

GIT_ORIGIN_REV_ID=94b9206658d66d0b7eaaaf4222bc2e0935fafa9b
PiperOrigin-RevId: 477243702
2022-09-27 23:57:48 +00:00
Material Design Team
9dd1195ad7 [ButtonGroup] Reduce log tag string length
PiperOrigin-RevId: 470989485
2022-08-30 11:29:46 -04:00
raajkumars
8a4af07979 [Icon Buttons] Added support for toggleable Icon buttons.
PiperOrigin-RevId: 462638190
2022-07-25 11:20:13 -04:00
Material Design Team
c49f9615a8 Automated g4 rollback of changelist 458476376
PiperOrigin-RevId: 458490930
2022-07-06 05:02:20 -07:00
raajkumars
2d83321a91 [Icon Buttons] Added support for toggleable Icon buttons.
PiperOrigin-RevId: 458476376
2022-07-06 05:00:00 -07:00
AshutoshSundresh
cd80b71817 [Resources] Remove unused public.xml resources
Resolves https://github.com/material-components/material-components-android/pull/2761

GIT_ORIGIN_REV_ID=fbc80605591c097ab56f4a8f0c9b4a2a3cbcfe10
PiperOrigin-RevId: 457959343
2022-06-29 14:39:28 +00:00
rightnao
a601107868 [MaterialButton] Add methods to not toggle checked state on buttons on click
Resolves https://github.com/material-components/material-components-android/issues/2291

PiperOrigin-RevId: 453569861
2022-06-07 18:53:01 -07:00
raajkumars
467a2c9f73 [Button] Updated M3 button style to add outlined icon button style. Updated catalog to showcase the same.
PiperOrigin-RevId: 448118229
2022-05-12 17:17:21 -04:00
raajkumars
14578ed68c [Button] Updated M3 button style to add filled tonal icon button style. Updated catalog to showcase the same.
PiperOrigin-RevId: 447784383
2022-05-10 15:05:30 -04:00
raajkumars
25606cf34a [Button] Updated M3 button style to add filled icon button style. Updated catalog to showcase the same.
PiperOrigin-RevId: 447523530
2022-05-09 15:00:34 -04:00
conradchen
363e2b1708 [Button] Always update drawable state when background changed
In certain situations drawable states won't be correctly propagated to the background drawable wrapped in a LayerDrawable during setting view background. Always explicitly updates the drawable state to fix the issue.

Resolves https://github.com/material-components/material-components-android/issues/2670

PiperOrigin-RevId: 446786432
2022-05-06 12:13:07 -04:00
raajkumars
402bdf4bbe [Button] Added materialIconButtonStyle attribute and updated M3 doc to document icon (only) button style and attribute.
PiperOrigin-RevId: 446487810
2022-05-04 18:27:31 -04:00
conradchen
1d3bb00de2 [Button] Migrated shape appearance to new shape system.
PiperOrigin-RevId: 446183150
2022-05-03 12:53:54 -04:00
conradchen
45b99f603e [Button] Fix the issue that button state is not updated
On Lollipop, when first assigned as View's background, RippleDrawable won't/can't propagate states to its content drawable. This causes the issue that the state relevant features like stroke colors are not correctly updated when the background is recreated. Explicitly assigns states to the content drawable to fix the issue.

Resolves https://github.com/material-components/material-components-android/issues/1422

PiperOrigin-RevId: 442676637
2022-04-19 10:57:43 -04:00
conradchen
b6b895a1e4 [Button] Fix icon textStart/End alignment with multiline text
When calculating text width to decide the icon position with textStart/End alignment, we missed accounting for multiline text. Fixes this by calculating each line's width separately and take the widest one to decide the icon position.

Resolves https://github.com/material-components/material-components-android/issues/2007

PiperOrigin-RevId: 440982189
2022-04-11 17:13:57 -04:00
conradchen
19d05000bc [Button] Fix icon position with multiline text
When the icon gravity is textTop, we are using the smaller one of the calculated height from text paint and the text layout height to decide the icon position. This is wrong when there are multiple lines of text since the text paint is always single line and always shorter than the actual height.

Fixes this by returning the actual layout height whenever there are multiple lines of text to fix the issue.

Resolves https://github.com/material-components/material-components-android/issues/2619

PiperOrigin-RevId: 440923733
2022-04-11 15:12:33 -04:00
conradchen
b0f37007aa [Button] Fix icon position not being updated when size is not changed
If a button has a WRAP_CONTENT width and after its text is updated but its size does not change, the icon position won't be updated because at the moment when onTextChanged() is called, getLayout() will return null and a new layout to display text will only be recreated in the next onMeasure() call.

To fix this issue, the change moves updateIconPosition() from onSizeChanged() to onLayout(), which will always be called after onMeasure() or onSizeChanged() is called, and thus covers both of the cases after the text is updated (the button changes its size or not.)

Note: we still need to keep the updateIconPosition() call in onTextChanged(), to cover the case that the button has a fixed width, in which updating text won't trigger remeasuring of the button.

Resolves https://github.com/material-components/material-components-android/issues/2553

PiperOrigin-RevId: 427215840
2022-02-09 15:56:11 +00:00
dsn5ft
96fa85e216 [MaterialButtonToggleGroup] Removed getAccessibilityClassName() override since TalkBack doesn't recognize the class name, in favor of getting identified as a generic list container
PiperOrigin-RevId: 423814546
2022-01-24 15:47:55 -05:00
conradchen
6c41f070e8 [Button] Support icon gravity with text alignments other than centered
Resolves https://github.com/material-components/material-components-android/issues/1371

PiperOrigin-RevId: 421605261
2022-01-18 12:02:02 -05:00
conradchen
3db25be3b6 [ButtonGroup] Simplify MaterialButtonToggleGroup's checking logic
1. Consolidates single selected ID and multiple selected IDs to a single selected
   ID set.
2. Separates View states and internal checked states so we can focus and enforce
   policies much easier on only internal states.

PiperOrigin-RevId: 420087718
2022-01-06 15:44:19 -05:00
conradchen
a17af6ee04 Automated g4 rollback of changelist 418054400
PiperOrigin-RevId: 418062580
2021-12-28 11:44:12 -05:00
conradchen
747bcf25ff [ButtonGroup] Simplify MaterialButtonTogglerGroup's checking logic
1. Consolidates single selected ID and multiple selected IDs to a single selected
   ID set.
2. Separates View states and internal checked states so we can focus and enforce
   policies much easier on only internal states.

Resolves https://github.com/material-components/material-components-android/issues/2263

PiperOrigin-RevId: 418054400
2021-12-28 08:55:31 -05:00
conradchen
672e7440f9 [M3][Dialog] Fix dialog paddings
We missed to include top/bottom insets of button styles into dialog action margin calculation. Also the paddings between titles and messages were not correct.

PiperOrigin-RevId: 417626927
2021-12-22 14:46:19 -05:00
Material Design Team
cfc00aa5a3 Update android core class definitions across material
PiperOrigin-RevId: 414839941
2021-12-08 14:56:25 +00:00
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
pfthomas
3c9b45292d [M3][Button] Add missing attributes to M3 button styles
PiperOrigin-RevId: 411585842
2021-11-29 17:29:47 +00:00
pfthomas
db64adb5fb [M3][Button] Update elevation to match specs
PiperOrigin-RevId: 411148215
2021-11-29 16:59:33 +00:00
pfthomas
f028380fb2 [M3][Button] Update padding to match specs
PiperOrigin-RevId: 410823046
2021-11-29 16:48:32 +00:00
dsn5ft
9ae56ceedd [Javadocs] Remove all broken attr links from Javadocs
PiperOrigin-RevId: 404246710
2021-10-20 19:06:18 +00:00
pekingme
9de9319b1e [Resources] Added styles in res-public.
PiperOrigin-RevId: 403451624
2021-10-18 15:31:13 -04:00
serniebanders
5844d3c134 [Button] Update icon state on Drawable state change.
Resolves: https://github.com/material-components/material-components-android/issues/2322

Follows pattern in View.drawableStateChanged() where drawable properties have states manually set.

PiperOrigin-RevId: 400754477
2021-10-05 09:04:56 -04:00
pfthomas
7729ad4dff [M3][Button] Update button res-public
PiperOrigin-RevId: 395994178
2021-09-16 09:54:19 -07:00
conradchen
fae2d9120f [M3][Snackbar] Remove redundant style settings
PiperOrigin-RevId: 395568908
2021-09-15 12:19:28 -07:00
conradchen
cf395d5729 [M3][Snackbar] Internal change
PiperOrigin-RevId: 395480037
2021-09-08 17:40:46 -04:00
Victor Cervantes
153fdee2f6 [MaterialButton] Material button lollipop shape fix
Resolves https://github.com/material-components/material-components-android/pull/2331
Resolves https://github.com/material-components/material-components-android/issues/1797

GIT_ORIGIN_REV_ID=cd176426395bf93f701c623c00947384aabf0706
PiperOrigin-RevId: 393405994
2021-08-27 17:29:19 -04:00
conradchen
2901012af5 [M3][DatePicker] Create M3 styles
PiperOrigin-RevId: 392982386
2021-08-26 14:43:23 -04:00
pfthomas
6bfa5842b9 [M3][Button] Create M3 styles
PiperOrigin-RevId: 392680177
2021-08-24 15:51:48 -04:00
conradchen
456f135627 [Button] Fix progress indicator is not shown when set as the icon
MaterialButton is using TextViewCompat.setCompoundDrawablesRelative() under the hood to implement setIcon() operation. TextViewCompat won't call its compound drawables' setVisible() method, on which we rely to start progress indicator drawables automatically.

Calls setVisible() explicitly to start progressing.

Also adds a demo to catalog.

Resolves https://github.com/material-components/material-components-android/issues/2095

PiperOrigin-RevId: 383483364
2021-07-08 15:58:13 +00:00
raajkumars
c5c7a74cef [MaterialButton] Updated Material Button style to set the preferred maximum width to 320dp.
PiperOrigin-RevId: 371151853
2021-04-29 14:53:13 -04:00
raajkumars
95da70589c [Catalog][Dialog] Removed full width button style and related dialog themes. Updated catalog dialog demo to showcase how to create dialogs with full width buttons.
PiperOrigin-RevId: 371146951
2021-04-29 14:52:19 -04:00
raajkumars
cd9e6204d8 [Dialog] Added support for full width buttons in dialogs.
PiperOrigin-RevId: 368853063
2021-04-16 18:21:25 -04:00