93 Commits

Author SHA1 Message Date
marianomartin
e56b141dd5 [MaterialButtonToggleGroup] SelectionRequired attribute doesn`t enforce checkedButtonId to be a valid id (returns -1)
Resolves https://github.com/material-components/material-components-android/issues/956

PiperOrigin-RevId: 292334820
2020-01-31 11:10:08 -05:00
Material Design Team
4389a18128 Add CollectionInfos and CollectionItemInfos to MaterialButtonToggleGroup and MaterialButton for accessibility.
PiperOrigin-RevId: 286922716
2019-12-23 15:43:46 -05:00
Zhaonian Luan
be8fb0f1ff [MaterialButtonToggleGroup] Clean up
Resolves https://github.com/material-components/material-components-android/pull/796

Co-authored-by: wcshi <38438920+wcshi@users.noreply.github.com>

GIT_ORIGIN_REV_ID=77f2471c1fbd9b44a8df1d252a41d582ddcbee0f
PiperOrigin-RevId: 284044596
2019-12-08 14:18:17 -05:00
marianomartin
a4b90321e3 Add selection required option to MaterialButtonToggleGroup
Setting selectionRequired = true. Makes it so that the last option on the Group cannot be unselected. Similar to how a Text Alignment toggle works.

PiperOrigin-RevId: 281366158
2019-11-20 14:36:15 -05:00
marianomartin
9fc1377755 [MaterialButtonToggleGroup] Fix corners after changing view visibility
People might want to set some of the buttons to GONE, this cl makes sure
the shape appearances remain coherent after doing so dynamically.

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

PiperOrigin-RevId: 276508915
2019-11-01 13:28:40 -07:00
marianomartin
115313c0c0 Expose a class for themeoverlay in style
This moves functionality from ThemeEnforcement into a stand alone class.

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

PiperOrigin-RevId: 275481343
2019-10-21 10:24:19 -04:00
marianomartin
24ab59af6c Support orientation VERTICAL in MaterialButtonToggleGroup
Resolves https://github.com/material-components/material-components-android/issues/476

PiperOrigin-RevId: 273514626
2019-10-08 10:35:08 -04:00
marianomartin
a405dd9664 Change MaterialButtonToggleGroup to extend LinearLayout
PiperOrigin-RevId: 272989081
2019-10-04 20:39:01 -04:00
ldjesper
294f12498d Rename setCornerRadius to setAllCornerSizes
PiperOrigin-RevId: 272959729
2019-10-04 20:08:43 -04:00
cketcham
0547d2a06b Uncouple CornerSize from CornerTreatment
This allows for more easily updating the CornerSize independently from the CornerTreatment and makes it possible to create different types of CornerSizes such as percentage based corners. However, this means corner sizes can be different depending on the bounds of the shape, so the bounds need to be provided. MaterialShapeDrawable has bounds and the ShapeAppearanceModel, so there are new convenience methods there which return the current corner size for the current bounds of the drawable.

PiperOrigin-RevId: 272908508
2019-10-04 15:23:16 -04:00
Sam
a610215b77 [MaterialButton] Fixed issue 531 by removing unnecessary calls to set compound drawables
Resolves https://github.com/material-components/material-components-android/pull/589

GIT_ORIGIN_REV_ID=3f167e1a3f5a369fc3bfda152f28b80c3cb25181
PiperOrigin-RevId: 270331104
2019-09-24 12:17:58 -04:00
marianomartin
d3d8c0a9fb Remove corner adjustment flag and code
PiperOrigin-RevId: 269652871
2019-09-18 14:20:44 -04:00
marianomartin
167663ae45 Internal cleanup
PiperOrigin-RevId: 268698913
2019-09-12 14:29:01 -04:00
marianomartin
bec86a0c34 Cleanup
PiperOrigin-RevId: 268343765
2019-09-12 14:02:14 -04:00
marianomartin
ca2db830d2 Remove corner adjustment from MaterialButton and ExtendedFloatingActionButton.
ExtendedFloatingActionButton extends from MaterialButton so removing MaterialButton's corner size adjustment removes the adjustment from ExtendedFloatingActionButton, as well.

PiperOrigin-RevId: 268282804
2019-09-12 13:59:27 -04:00
marianomartin
215a839598 Internal cleanup
PiperOrigin-RevId: 267504117
2019-09-12 13:48:16 -04:00
Connie
9ed90216a3 Revert "Fixed issue 531 by removing unnecessary calls to set compound drawables"
This reverts commit faf60b15bea73588e8c76fc348ace50dd430cf55.
2019-08-29 15:55:46 -04:00
Connie
b814e8ef74 Revert "Changed naming"
This reverts commit b467b494d9f87581c20009706bce4dc9a7cb8c44.
2019-08-29 15:55:46 -04:00
Sam
b467b494d9 Changed naming 2019-08-29 15:53:24 -04:00
Sam
faf60b15be Fixed issue 531 by removing unnecessary calls to set compound drawables 2019-08-29 15:53:24 -04:00
cketcham
7bb525ff59 Update usages of ShapeAppearanceModel to use Builder pattern
PiperOrigin-RevId: 266144471
2019-08-29 15:39:51 -04:00
marianomartin
0d4515cb46 Internal cleanup
PiperOrigin-RevId: 265971745
2019-08-29 14:59:20 -04:00
cketcham
1068e1029d Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 264899198
2019-08-26 14:40:54 -04:00
ldjesper
910c940717 Disable MaterialDatePicker ok/confirm button when the selection is not valid
PiperOrigin-RevId: 262573417
2019-08-16 15:49:56 -04:00
dniz
52c1a4d50d Add materialButtonOutlinedStyle and materialButtonToggleGroupStyle to public.xml
Resolves https://github.com/material-components/material-components-android/pull/453

PiperOrigin-RevId: 259959541
2019-07-25 13:14:06 -04:00
dniz
0512f776c5 Remove sub-package AndroidManifest.xml files from lib directory
PiperOrigin-RevId: 258390736
2019-07-16 13:18:32 -04:00
dniz
68ddfee0ed Remove Material's legacy androidx core_ui and core_utils dependencies in favor of more granular dependencies (coordinatorlayout, graphics, interpolator, customview)
PiperOrigin-RevId: 257452569
2019-07-10 15:17:12 -04:00
marianomartin
164bf0fabd Internal cleanup
PiperOrigin-RevId: 255609320
2019-07-03 14:02:53 -04:00
dniz
5df3bebd63 Update elevation overlays to be based absolute elevation, factoring in the elevation of all parent views
Will follow-up with TabLayout absolute elevation separately

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

PiperOrigin-RevId: 255404830
2019-07-03 13:55:49 -04:00
Jaeyoung
841d660439 Update MaterialButtonToggleGroup.java
fix wrong closing tag

Resolves https://github.com/material-components/material-components-android/pull/410

GIT_ORIGIN_REV_ID=2d55ec5261ba986863ac7b3a6cdd277a11d64784
PiperOrigin-RevId: 255404599
2019-07-03 13:52:59 -04:00
isabellekim
36b760d220 Change ripples on MaterialButton to use the alphas provided in the ColorStateList.
RippleDrawable on different API levels will modulate the alphas differently
for the pressed / focused / hovered states. Therefore, in order to get the
desired alphas for pressed / focused / hovered states, we are using the
mtrl_(low|high)_ripple_(pressed|focused|hovered|default)_alpha values which have
been defined to account for the different implementations of RippleDrawable.

This will allow developers to specify different colors for focused vs. pressed if desired.

PiperOrigin-RevId: 255306749
2019-07-03 13:50:29 -04:00
gauthams
cda68edcaf Add uncheck(int id) API for unchecking single button to MaterialButtonToggleGroup
PiperOrigin-RevId: 252723596
2019-06-18 13:16:05 -04:00
gauthams
e869edd032 Document return value of getCheckedButtonIds() in MaterialButtonToggleGroup
PiperOrigin-RevId: 252702693
2019-06-18 12:05:19 -04:00
marianomartin
455ba2557b Internal cleanup
PiperOrigin-RevId: 249490219
2019-05-24 14:22:06 -04:00
marianomartin
90837ec485 Internal cleanup
PiperOrigin-RevId: 249243403
2019-05-21 12:15:07 -04:00
gauthams
dbbf2c6eec Add additional info to Javadoc for MaterialButton's setShapeAppearanceModel method
PiperOrigin-RevId: 249091100
2019-05-21 12:12:52 -04:00
Material Design Team
32a28f5acf Annotate arg MaterialButton.setIcon(@Nullable)
PiperOrigin-RevId: 245728195
2019-04-29 15:59:08 -07:00
gauthams
71048025ef Update MaterialButton documentation to clarify usage of '.Icon' styles
PiperOrigin-RevId: 245317272
2019-04-29 15:52:46 -07:00
cketcham
e081f9d005 Use platform widget classes for the a11y class name
PiperOrigin-RevId: 245300502
2019-04-29 15:44:22 -07:00
gauthams
c42eb1e239 Add support for end-aligned iconGravity in MaterialButton
PiperOrigin-RevId: 244431572
2019-04-19 22:07:04 -04:00
gauthams
64ad735c12 Add MaterialButtonToggleGroup docs
PiperOrigin-RevId: 243345601
2019-04-19 16:22:36 -04:00
gauthams
d5bbc9cf43 Implement Shapeable interface in MaterialButton
PiperOrigin-RevId: 242559479
2019-04-19 13:00:59 -04:00
gauthams
64d7de8020 Add checkedId tracking for singleSelection mode of MaterialButtonToggleGroup
PiperOrigin-RevId: 242558776
2019-04-19 13:00:04 -04:00
gauthams
3f2d205344 Log a warning rather than an info when setting background on a MaterialButton.
PiperOrigin-RevId: 239880506
2019-03-26 17:29:07 -04:00
dniz
833258417d Add @RequiresApi(VERSION_CODES.LOLLIPOP) to overriden setElevation() methods
that call super.setElevation()

PiperOrigin-RevId: 239171863
2019-03-22 16:50:21 -04:00
marianomartin
fd01672af5 Fix nullness in FAB
PiperOrigin-RevId: 238990635
2019-03-22 16:21:40 -04:00
gauthams
5848f1fa2d Add elevation overlay support for MaterialButton
PiperOrigin-RevId: 238535050
2019-03-22 16:11:04 -04:00
Material Design Team
3bce1b6f46 Set MaterialButton's accessibility class name to match the platform Button widget so that a11y services can verbalize instances as Buttons. For instance, a button with content description "foo" should be verbalized as "foo Button"
PiperOrigin-RevId: 238032322
2019-03-22 16:05:13 -04:00
gauthams
c7d081a9e8 Use getEllipsizedWidth rather than getWidth when measuring text in MaterialButton
PiperOrigin-RevId: 237853613
2019-03-22 16:03:58 -04:00
marianomartin
77ac869283 Add single selection attr to resources package
PiperOrigin-RevId: 236851563
2019-03-08 09:58:19 -05:00