170 Commits

Author SHA1 Message Date
Nobody
9e1c0c0a45 Internal change
PiperOrigin-RevId: 477458164
2022-09-28 08:26:32 -07:00
Nobody
7b8b54a3cf [MDCButton] titleFontForState: return value is never null, mark as nonnull.
PiperOrigin-RevId: 425549752
2022-02-01 00:14:07 -08:00
Alyssa Weiss
2c8d5d5fe8 Remove custom pointer interaction handling from MDCButton.
PiperOrigin-RevId: 410787812
2021-11-18 06:42:53 -08:00
Jeff Verkoeyen
86a8c97dc7 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400788645
2021-10-04 12:41:07 -07:00
Randall Li
502bc5d910 Ran a Swift formatter
PiperOrigin-RevId: 395947664
2021-09-10 09:48:14 -07:00
Alyssa Weiss
6ccb268a37 Move FontScaler APIs in MDCTypography to a separate directory.
PiperOrigin-RevId: 390642325
2021-08-13 10:33:45 -07:00
Alyssa Weiss
07075f8e7a Remove adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable property from MDCButton.
PiperOrigin-RevId: 377352366
2021-06-03 12:53:33 -07:00
Jeff Verkoeyen
a8e4831fd0 Flattening all unit tests into single directories as per convention.
PiperOrigin-RevId: 367426300
2021-04-08 07:33:29 -07:00
Alyssa Weiss
924c49e43b Remove all iOS 10 availability checks from material_components_ios now that only iOS 10+ is supported.
PiperOrigin-RevId: 366437050
2021-04-02 06:33:16 -07:00
Jeff Verkoeyen
1c14fb5e7b Internal change.
PiperOrigin-RevId: 363294413
2021-03-16 16:23:36 -07:00
Andrew Overton
8f2917d525 [Buttons] Add inferMinimumAndMaximumSizeWhenMultiline
PiperOrigin-RevId: 356970306
2021-02-11 07:35:48 -08:00
Andrew Overton
105c4f4ab0 [Material-iOS/Buttons] Internal change
PiperOrigin-RevId: 356799194
2021-02-10 12:27:51 -08:00
Jeff Verkoeyen
25c9049d5a Optimizing imports
PiperOrigin-RevId: 356791916
2021-02-10 12:00:57 -08:00
Bill Griesau
9a8399a566 [Buttons] Fix bug where updating MDCButton's title case does not affect attributed titles.
PiperOrigin-RevId: 345738853
2020-12-04 12:59:45 -08:00
Wenyu Zhang
a25c55ee80 [MDC-iOS/FAB] Add shape API to allow changing FAB's shape after it is initialized.
PiperOrigin-RevId: 340492344
2020-11-03 11:52:40 -08:00
Wenyu Zhang
615f273a41 [MDC-iOS/FAB] Remove deprecated setVisibleAreaInsets:forShape:inMode: API.
PiperOrigin-RevId: 340446430
2020-11-03 08:14:18 -08:00
Yarden Eitan
0de498c394 [Buttons] Add visibleAreaLayoutGuide for providing anchors to the visible area when centerVisibleArea is set to YES.
PiperOrigin-RevId: 340229540
2020-11-02 07:28:50 -08:00
Bryan Oltman
da4b8f7c7f Fix mdc_elevationDidChangeBlock block parameter types for Xcode 12
PiperOrigin-RevId: 331843566
2020-09-15 13:39:15 -07:00
Cody Weaver
2a5996b407 [MDC/Button] Add rippleMaximumRadius API.
This commit adds the ripple maximum radius API to match the inkMaxRippleRadius API that are soon to be deprecated. This also moves those APIs to a "ToBeDeprecated" category. In this commit I set an ivar instead of having pass through properties because in a follow up I think it would be a good optimization to have the ripple be lazy until a user interacts with the button. This will lower initialization time and make the setters potentially faster. Since we don't have pass through properties I defaulted it to 0 to match the legacy API from `MDCStatefulRippleView` to match here.

PiperOrigin-RevId: 323011293
2020-07-24 09:34:26 -07:00
Cody Weaver
9039d47602 [MDC/Button] Add rippleColor and rippleStyle APIs
This commit adds the ripple color and ripple style APIs to match the inkColor and inkStyle APIs that are soon to be deprecated. This also moves those APIs to a "ToBeDeprecated" category. In this commit I set an ivar instead of having pass through properties because in a follow up I think it would be a good optimization to have the ripple be lazy until a user interacts with the button. This will lower initialization time and make the setters potentially faster. Since we don't have pass through properties I mirrored the default rippleColor from `MDCStatefulRippleView` to match here.

PiperOrigin-RevId: 322585578
2020-07-22 09:05:16 -07:00
Bryan Oltman
7b45e787db [Buttons] Remove unused TitleColorAccessibilityMutator.
PiperOrigin-RevId: 322411522
2020-07-21 12:05:57 -07:00
Cody Weaver
330125967a [MDC/Button] Add rippleEdgeInsets API.
Currently we make the ripple the entire size of the button. This limits clients being able to customize if the ripple is inset or outset on a particular side of the button. Since MDCFloatingButton sets its contentEdgeInsets this API is needed to allow for the two values to be independent.

https://developer.apple.com/documentation/uikit/uibutton/1624036-contentedgeinsets

PiperOrigin-RevId: 322199718
2020-07-20 12:28:27 -07:00
Wenyu Zhang
222ae37fc9 [Floating Button] Add centerVisibleArea support for the FAB and deprecate visibleAreaMode
API.

PiperOrigin-RevId: 320291504
2020-07-08 16:44:05 -07:00
Wenyu Zhang
59c44fb3bd [Buttons] Add centerVisibleArea to MDCButton and mark visibleAreaInsets as to be deprecated.
PiperOrigin-RevId: 320085469
2020-07-07 16:36:33 -07:00
Yarden Eitan
afb87e9860 [Floating Button] Add visibleAreaInsets support for the FAB.
Like the MDCButton, this is opt-in, and the dictionary for the visibleAreaInsets per mode/shape combination is initially empty.

PiperOrigin-RevId: 315152916
2020-06-07 05:34:33 -07:00
Yarden Eitan
e8a1c4e7e1 [MDCButton] Add a visibleAreaInsets API.
This API allows clients to inset the visible content and allow it to be smaller than the frame.
In turn, clients can have a touch target that is bigger than the visible content.

PiperOrigin-RevId: 313556504
2020-05-28 03:17:34 -07:00
Wenyu Zhang
b19e4e964d [ShadowLayer] Add prepareShadowPath to MDCShadowLayer to allow its subclass preparing shadow path before MDCShadowLayer lays out its sublayers.
PiperOrigin-RevId: 313383830
2020-05-27 07:20:37 -07:00
Nobody
e035d70f50 Project import generated by Copybara.
PiperOrigin-RevId: 309039129
2020-04-29 17:00:59 +00:00
Bryan Oltman
f7f154d483 [Buttons] Move button alpha tests into their own file.
PiperOrigin-RevId: 308681214
2020-04-27 13:03:44 -07:00
Bryan Oltman
4f75f7c33f [Buttons] Disable pointer interactions for MDCFloatingButton during animation.
PiperOrigin-RevId: 305879022
2020-04-13 09:23:13 -04:00
Bryan Oltman
5a2b2caae0 [Button] Add custom UIButtonPointerStyleProvider to MDCButton for better iPadOS pointer interaction.
Note: MDCButton does not enable pointer interactivity by default.

This also adds an example to demonstrate MDCButtons with the default UIPointerInteraction enabled. The example exposes an issue with MDCFloatButton's collapse/expand animations (b/153666859), which will be addressed in a future CL.

PiperOrigin-RevId: 305872547
2020-04-13 09:20:43 -04:00
Jeff Verkoeyen
6ac7e6c3d8 [Buttons] Add support to MDCFloatingButton for animating mode changes.
The new API allows the floating button to animate changes between normal and expanded states.

PiperOrigin-RevId: 305703859
2020-04-09 09:57:44 -07:00
Jeff Verkoeyen
bc113b658c [Buttons] Add a snapshot test for floating buttons in normal mode with a label.
This snapshot test demonstrates the incorrect behavior of the title label being visible while the button is in normal mode.

PiperOrigin-RevId: 305668064
2020-04-09 05:49:02 -07:00
Jeff Verkoeyen
57ec631be2 [Buttons] Standardize all test names on <Symbol><TestCategory>Tests.
PiperOrigin-RevId: 305667188
2020-04-09 05:39:30 -07:00
Bryan Oltman
df522841a2 [Buttons] Add inkViewOffset property to allow adjustment of inkView/rippleView. This is pre-work to address an issue in MDCButtonBar, where buttons are assigned asymmetric contentEdgeInsets by MDCAppBarButtonBarBuilder
PiperOrigin-RevId: 304256452
2020-04-01 14:01:07 -07:00
Cody Weaver
fdf87c5995 [MDC/ColorScheme] Remove usage of init within MDC.
We recommend using `initWithDefaults` and we should follow the recommendation. This change removes all usage of `init` within MDC components in order to let us remove that initializer from the public surface.

PiperOrigin-RevId: 302958447
2020-03-25 13:36:51 -07:00
Bryan Oltman
14c9d903cf
[Buttons] Deletes deprecated MDCFloatingButtonShapeThemer (#9746)
* [Buttons] Deletes deprecated MDCFloatingButtonShapeThemer

* Remove MDCFloatingButtonShapeThemer from tests

* Update docs

* clang
2020-02-18 10:12:36 -05:00
Bryan Oltman
1118f14124
[Buttons] Delete deprecated MDCOutlinedButtonThemer (#9688)
MDCOutlinedButtonThemer is deprecated and has no internal usage.

Fixes #9687
2020-02-11 18:20:18 -05:00
Bryan Oltman
0efb82cf5f
[Buttons] Delete deprecated MDCFloatingActionButtonThemer (#9662)
Deletes the deprecated and unused MDCFloatingActionButtonThemer.

Fixes #9663
2020-02-11 13:34:13 -05:00
Randall Li
fa62718bc5
add deps on availability for a bunch of components (#9679)
* add Availability build file

* add Button deps on availability

* added elevation

* corrected include statements to use import of the umbrella files

* revert unwanted changes

* spaces

* clangformat

* add availability dep

* added buttom nav deps on availibility

* Add FeatureHighlight build dep for Availability

* Add Availability build dep to FeatureHighlight private

* Add missing =

* fixed tabs spacing

Co-authored-by: Bryan Oltman <bryanoltman@gmail.com>
2020-02-11 13:14:09 -05:00
Nobody
421770ca2e [Material][Availability] Migrates Buttons to MDCAvailability.
PiperOrigin-RevId: 293865037
2020-02-07 16:07:05 -05:00
Wenyu Zhang
623986d513 [Buttons] Set contentEdgeInsets in theming for MDCFloatingButton with normal shape.
PiperOrigin-RevId: 292240032
2020-01-29 16:17:08 -08:00
Robert Moore
9c96aa9968
[Buttons] Support non-stateful fonts in theming. (#8650)
The Theming Extensions should support non-state-based title font APIs as
clients migrate to the non-state-based APIs.

Part of #8601
2019-10-24 20:48:31 -04:00
Robert Moore
86ebced717
[Buttons] Add API to disable state-based fonts. (#8606)
Introduces a new API to disable the `titleFont:forState:` APIs. This is the
first step toward removing those APIs.

State-based fonts make it impossible to support UIContentSizeCategoryAdjusting
behavior on the button's `titleLabel`. Providing support for automatic font
resizing for Dynamic Type means removing state-based font APIs.

Part of #8595
2019-10-18 22:37:03 -04:00
Wenyu Zhang
e3784afe25
[Buttons] overwrite intrinsicContentSize method. (#8370)
The `instrinsicContentSize` of `MDCButton` was not aware of `minimumSize` property, which is wrong.
2019-08-27 13:20:54 -04:00
Yarden Eitan
f4352d73e6
[Buttons] Add missing self to traitCollectionDidChangeBlock (#8276)
As part of our work of adding traitCollectionDidChangeBlocks to components, we add self as a parameter to the block, buttons is the only component that seems to be missing it.

This is essentially a breaking change based on our breaking changes conventions.
2019-08-12 10:50:49 -04:00
featherless
af29d5d737
[Buttons] Replace mdc_legacyFontScaling usage with adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable. (#8244)
Part of https://github.com/material-components/material-components-ios/issues/8243
2019-08-08 18:05:19 +00:00
Robert Moore
54fe07bd2e
[Buttons] Use Starlark macros. (#8162)
Updates the BUILD file to use more Starlark macros. This makes it easier to
perform releases. Also fixes a test import so `includes` amendments aren't
required.

Part of #8150
2019-08-01 16:19:02 -04:00
Robert Moore
66435f1b68
[Color] Create umbrella header. (#8091)
All components should have a top-level umbrella header for their includes.
This allows easier refactoring of classes and files within the component.
Creating an umbrella for Color and using it outside the component.

Part of #8086
2019-07-25 15:41:26 -04:00
Robert Moore
403c1b6a29
[Buttons] Support MaterialElevation. (#8073)
Adds protocol conformance for `MDCElevatable` and `MDCElevationOverriding`.

Closes #8023
2019-07-25 09:24:35 -04:00