246 Commits

Author SHA1 Message Date
Nobody
266bcd2e07 There are two separate systems trying to manage touch events on the MDCButton. First, the button itself uses its standard UIControl event infrastructure to trigger ink ripples. Second, an external MDCInkTouchController attaches its own gesture recognizers to do the same thing. This creates a conflict where both systems respond to the same touch, causing two ink animations to be created and displayed simultaneously, which results in incorrect visual feedback.
PiperOrigin-RevId: 770704081
2025-06-12 10:10:12 -07:00
Nobody
d304ac1651 There are two separate systems trying to manage touch events on the MDCButton. First, the button itself uses its standard UIControl event infrastructure to trigger ink ripples. Second, an external MDCInkTouchController attaches its own gesture recognizers to do the same thing. This creates a conflict where both systems respond to the same touch, causing two ink animations to be created and displayed simultaneously, which results...
PiperOrigin-RevId: 769464891
2025-06-09 23:15:18 -07:00
Nobody
b2d48fceca There are two separate systems trying to manage touch events on the MDCButton. First, the button itself uses its standard UIControl event infrastructure to trigger ink ripples. Second, an external MDCInkTouchController attaches its own gesture recognizers to do the same thing. This creates a conflict where both systems respond to the same touch, causing two ink animations to be created and displayed simultaneously, which results in incorrect visual feedback.
PiperOrigin-RevId: 769406060
2025-06-09 20:04:56 -07:00
Nobody
24a0ffbd03 Annotate various Delegate protocols as NS_SWIFT_UI_ACTOR
PiperOrigin-RevId: 708413470
2024-12-20 13:33:55 -08:00
Nobody
dc3dd5d5a0 Add explicit imports for CoreGraphics in files which use it.
PiperOrigin-RevId: 642291735
2024-06-11 09:16:51 -07:00
Randall Li
1c4e1f8708 [MDCInk] Change deprecation warning to point at guidance and added "🕘 Schedule time to migrate" message.
PiperOrigin-RevId: 491902432
2022-11-30 06:49:44 -08:00
Nobody
36ac243939 Fixed up imports for Ink
PiperOrigin-RevId: 482294231
2022-10-19 13:51:22 -07:00
Nobody
3713e0d61e Add void to functions in C missing parameters to fix -Wstrict-prototypes warnings.
This warning became more strict after updates in the clang compiler.

The error message that this change fixes is:

```
error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
```
PiperOrigin-RevId: 472723024
2022-09-07 07:52:30 -07:00
Jeff Verkoeyen
b2bbd50350 Mark all To Be Deprecated APIs as Deprecated.
PiperOrigin-RevId: 460478209
2022-07-12 09:13:52 -07:00
David Collazo
45aa07aa95 Mark symbols to be deprecated
Use default system highlight behavior instead (go/material-ios-touch-response)

PiperOrigin-RevId: 456369508
2022-06-21 15:54:13 -07:00
Dave MacLachlan
081c3beeef Update - animationDidStop:shapeLayer:finished: to match declaration.
PiperOrigin-RevId: 408414069
2021-11-08 12:38:12 -08:00
Jeff Verkoeyen
c34de39e30 Internal change.
PiperOrigin-RevId: 397316843
2021-09-17 07:45:01 -07:00
Jeff Verkoeyen
ec44b12ee9 Internal change
PiperOrigin-RevId: 394725753
2021-09-03 11:44:01 -07:00
Alyssa Weiss
1b69273926 Delete MDCTypography font opacities.
PiperOrigin-RevId: 394494448
2021-09-02 10:44:20 -07:00
Jeff Verkoeyen
29803522c6 Optimizing imports
PiperOrigin-RevId: 357185525
2021-02-12 07:27:05 -08:00
Jeff Verkoeyen
39c20e15f8 Optimizing imports
PiperOrigin-RevId: 356967514
2021-02-11 07:17:45 -08:00
Jeff Verkoeyen
eb82984224 Internal change
PiperOrigin-RevId: 331764642
2020-09-15 07:31:56 -07:00
Yarden Eitan
8d7bc88a11 [Ink] Official deprecation of Ink.
Please use the Ripple component.

PiperOrigin-RevId: 329771765
2020-09-02 13:07:40 -07:00
Andrew Overton
07c46757cc Replace material.io API doc links with links to the relevant header f…
This PR replaces API links containing "/api-docs/" with links to suitable header files in GitHub because the site previously linked to is being taken down and replaced with something that won't handle API docs.

Closes https://github.com/material-components/material-components-ios/pull/10045

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-components-ios/pull/10045 from andrewoverton:replace-mio-api-docs-with-github-links 0d6e56cc11d0c147366a4f6cde829d8b51567ecc
PiperOrigin-RevId: 323424362
2020-07-27 13:09:23 -07:00
Wenyu Zhang
a3381717f7
Fix the bazel BUILD files and snapshot that were restored unintentionally.(#9983) 2020-04-29 11:00:00 -04:00
Randall Li
0100cfe414 [MDC-iOS/BottomSheet] Fix dismissOnDraggingDownSheet behavior
The bottom sheet incorrectly allowed the sheet to be drag dismissed when `dismissOnDraggingDownSheet` was set to NO.

This change permits the gesture to dismiss to begin but prevents it from actually closing the sheet.

https://github.com/material-components/material-components-ios/issues/9723

Closes https://github.com/material-components/material-components-ios/pull/9885

PiperOrigin-RevId: 307802500
2020-04-22 06:21:26 -07:00
Jeff Verkoeyen
8abbb099a9 Delete all bazel support.
We no longer support bazel.

This PR deletes everything related to bazel support from our repo.

Closes https://github.com/material-components/material-components-ios/pull/9968

PiperOrigin-RevId: 306227127
2020-04-13 07:13:47 -07:00
Bryan Oltman
98b464180b [Ink] Move protocol definitions into separate header files
PiperOrigin-RevId: 301915211
2020-03-19 16:09:33 -07:00
Andrew Overton
830f6dfdc0
Refactor MDCInkView logic grappling with interplay between legacy ink layer and max ripple radius, ink style, etc (#9855)
This PR aims to simplify the logic that grapples with the interplay of usesLegacyInkLayer with properties like maxRippleRadius and inkStyle. I recently merged https://github.com/material-components/material-components-ios/pull/9818 to address this issue, and while I believe it fixes his immediate issue it still leaves other potential issues. Specifically, it does not resolve potential problems related to the ordering of calls to setters for `usesLegacyInkLayer`, `inkStyle`, and `maxRippleRadius` impacting their effectiveness. Hopefully this PR addresses those issues without breaking anything else. I tried to manually test it pretty rigorously by setting all the properties in question in different orders and making sure that everything worked how I expected it to.

Closes #9762.
2020-03-10 17:00:31 -04:00
Andrew Overton
5862e5b7b6
Conditionally maskToBounds on MDCInkView layer (a MDCLegacyInkLayer) when usesLegacyInkRipple is set to NO (#9818)
This change makes it so that the `masksToBounds` property on an MDCButton's MDCInkView's MDCLegacyInkLayer is set according to whether `inkStyle` is `.unbounded` or not, regardless of whether `usesLegacyInkRipple` is set on the MDCButton.

An MDCInkView's layer is always an MDCLegacyInkLayer, even when `usesLegacyInkRipple` is set to NO. In this scenario it acts as the MDCInkView's layer, even if it's not acting as the thing that triggers the ink/ripple animation.

There was a very similar bug to this recently that https://github.com/material-components/material-components-ios/pull/9254 was intended to address. That PR addressed it in the Catalog, as you can see in the before and after gifs in the PR description, but a different client was still experiencing the issue. I built the second client's app to test this PR and it seems to fix it for them.

I wonder if we should try to get rid of MDCLegacyInkLayer, or if we should bypass that and just get rid of MDCInkView entirely, now that we have MDCRippleView.

Closes #9762.
2020-03-02 01:21:50 -05:00
Bryan Oltman
8819916990
[Ink] Remove additional strong reference to self.layer (#9755) 2020-02-18 21:53:50 -05:00
Bryan Oltman
f168dd2806
[Material][Availability] Migrates Ink to MDCAvailability. (#9741)
[Material][Availability] Migrates Ink to MDCAvailability.
2020-02-14 12:52:23 -05:00
Yarden Eitan
60e467f654
[Ink] Update ink color to be null resettable. (#9253)
This allows the API to handle assigning inkColor to nil, which is common practice among properties on UI classes that expose color (see UIKit - i.e. UIView.tintColor, UILabel.textColor, etc)

b/144862050
2019-12-20 15:38:07 -05:00
Andrew Overton
fd63f37684
Fix issue with unbounded ink (#9254)
~Closes [b/129744869](http://b/129744869) and [b/129697125](http://b/129697125).~
Closes #9256.
Closes #9255.


This PR makes it so that setting `inkStyle` to `MDCInkStyleUnbounded` on an MDCButton results in unbounded ink.

Before gif:
![unbounded-before](https://user-images.githubusercontent.com/8020010/70655561-74ac3800-1c26-11ea-8a4b-4569b5d9e63a.gif)

After gif:
![unbounded-after](https://user-images.githubusercontent.com/8020010/70655560-74ac3800-1c26-11ea-8b3a-35a7db9b930e.gif)
2019-12-11 16:03:10 -05:00
Andrew Overton
388fea7ebe
Remove MDCInkColorThemer (#9228)
Delete MDCInkColorThemer. Closes #9107
2019-12-10 12:55:06 -05:00
Andrew Overton
06d9c4a0eb
Deprecate MDCInkColorThemer (#9113)
Related to #9107.
2019-12-06 15:16:34 -05:00
Bryan Oltman
0aa91cca0a
[Ink] Delete deprecated MDCInkTouchControllerLegacyDelegate (#9077) 2019-12-04 20:35:33 -05:00
featherless
baf74b9336
[Ink] Make the ink views accessibility elements. (#8891)
Stacked on top of https://github.com/material-components/material-components-ios/pull/8890

This allows the ink views to be focused by VoiceOver and tapped as buttons to initiate the ink effect.

Closes https://github.com/material-components/material-components-ios/issues/8883
2019-11-15 11:01:11 -05:00
featherless
cdaf097756
[Ink] Consolidate example code into a single file. (#8890)
Cleanup as part of https://github.com/material-components/material-components-ios/issues/8883
2019-11-15 10:15:15 -05:00
Randall Li
1eaff651f9 Reran ./scripts/generate_all_readmes (#8557)
Moved changes from https://github.com/material-components/material-components-ios/pull/7360 to the source Readme file

Also some readme files got a minor addition to add `./` in their generation comment
2019-10-11 10:44:43 -04:00
Robert Moore
1ca983726f
[Ink] Remove use of NS_ASSUME_NONNULL_BEGIN. (#8298)
The project overwhelmingly uses explicit nullability annotations. This PR
switches an internal Ink file to use the same convention.

Part of #8297
2019-08-13 12:52:18 -04:00
Robert Moore
77c5ebbe7e
[Ink] Use Starlark macros. (#8172)
Use more Starlark macros in the BUILD file. This makes it easier for releasing
each week. Also removed the `includes` requirement by making testing imports
relative.

Part of #8150
2019-08-02 10:05:18 -04:00
Cody Weaver
4be077a61b
[Ink, Ripple] Use static default colors (#8146)
Instead of reallocating new colors every time a default is required, using a static color can reduce memory use and allocations.

Impact: “memory watermark would be dropped in terms of KB. Memory fragmentation, cache performance, malloc contention will also be reduced slightly.”

Closes #8141
PiperOrigin-RevId: 260767570
2019-07-31 10:25:03 -07: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
99f2aec3e2
[Ink] Fix documentation for enum types. (#8090)
The comment position for the enumeration types of bounded/unbounded ink attached the documentation to the wrong values.

PiperOrigin-RevId: 259979073
2019-07-25 15:18:28 -04:00
Cody Weaver
b19962a747
[Ink] Add traitCollectionDidChange block (#8064)
Adds a traitCollectionDidChangeBlock to MDCInkView, called when its trait collection changes.

Closes #8048
2019-07-23 22:19:14 -07:00
Yarden Eitan
6eb335a0f9
[Ink] Dynamic color support (#7974)
Adding dynamic color support to the Ink component.

Ink comprises of multiple MDCInkLayer sublayer instances, and they all should update their colors when the style of the system turns to Dark.

Closes #7871
2019-07-22 10:14:31 -04:00
Yarden Eitan
89cd08dc88
[Ink] Update Readme to use the script generator and move migration guide. (#7370)
Ink readme wasn't using the script generator and ready templates we already use in our other components. This fixes that and moves the migration guide from Ripple to Ink.
2019-05-12 17:25:59 +03:00
Michael Schneider
c00921720b [Ink] Add animation delegate callbacks for MDCLegacyInkLayer (#7339)
Add animation delegate callbacks for MDCLegacyInkLayer

We would like to observer the start and stop animations of an MDCInkTouchController by setting the animationDelegate of the MDCInkTouchController's MDCInkView. If [MDCInkView usesLegacyInkRipple] == YES the MDCLegacyInkLayer does not call any animation callbacks right now.
2019-05-09 16:18:01 +03:00
Michael Schneider
932c32f7c5 [Ink] Combine initialization method for MDCLegacyInkLayer (#7316) 2019-05-01 17:28:46 -04:00
Michael Schneider
780b916748 [Ink] Add fail the ripple gesture when other scroll view gestures are competing unless they are tap or long press gestures to MDCInkTouchController (#7315)
Mirroring #6487
2019-05-01 17:06:30 -04:00
featherless
ad894ac9f6
[Ink] Annotate themer APIs with the recommended APIs. (#7225)
Part of https://github.com/material-components/material-components-ios/issues/7108
2019-04-22 19:58:47 +03:00
Robert Moore
aad941178a
[Ink] Add basic snapshot tests. (#6920)
Add snapshot tests for new Ink using bounded and unbounded styles.

Closes #6814
2019-03-18 08:06:33 -04:00
Yarden Eitan
c4d24627ee
updated jazzy yaml files to include framework root (#6750)
We have had errors when generating the docs using jazzy specifically around components giving a fatal error around not finding imports when depending on other components. This is because each component for jazzy is isolated and on its own unless we provide the framework root. This caused our website generator to crash each time and fail to generate a new website.

This should resolve this problem.

QA=
Before the fix when running the website generator we got these errors:
```
/material-components-ios/components/BottomAppBar/src/MDCBottomAppBarView.h:17:9: fatal error: 'MaterialButtons.h' file not found
building site
building search index
^C/Library/Ruby/Gems/2.3.0/gems/rouge-3.1.1/lib/rouge/lexer.rb:458:in `load': Interrupt
	from /Library/Ruby/Gems/2.3.0/gems/rouge-3.1.1/lib/rouge/lexer.rb:458:in `load_lexer'
	from /Library/Ruby/Gems/2.3.0/gems/rouge-3.1.1/lib/rouge.rb:50:in `block in <top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/rouge-3.1.1/lib/rouge.rb:49:in `each'
	from /Library/Ruby/Gems/2.3.0/gems/rouge-3.1.1/lib/rouge.rb:49:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/jazzy_markdown.rb:2:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/jazzy_markdown.rb:2:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/doc.rb:7:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/doc.rb:7:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/config.rb:5:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/config.rb:5:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy.rb:1:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy.rb:1:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/bin/jazzy:13:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/bin/jazzy:13:in `<top (required)>'
	from /usr/local/bin/jazzy:22:in `load'
	from /usr/local/bin/jazzy:22:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in `load'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in `kernel_load'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:28:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:463:in `exec'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:27:in `dispatch'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:18:in `start'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/exe/bundle:30:in `block in <top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/exe/bundle:22:in `<top (required)>'
	from /usr/local/bin/bundle:22:in `load'
	from /usr/local/bin/bundle:22:in `<main>'
/material-components-site-generator/scripts/lib/reporter.js:36
      throw e;
      ^

Error: Command failed: bundle exec jazzy         --output "/material-components-site-generator/.stage/ios/catalog/bottomnavigation/api-docs/"         --theme "/material-components-site-generator/ios-api-docs-src/theme"         --head '/components'         --use-safe-filenames
    at checkExecSyncError (child_process.js:601:13)
    at execSync (child_process.js:641:13)
    at JazzyApiGenerator.build (/material-components-site-generator/scripts/lib/jazzy-api-generator.js:34:5)
    at PlatformSite.generateApiDocs (/material-components-site-generator/scripts/lib/platform-site.js:212:17)
    at platformSites.forEach (/material-components-site-generator/scripts/build:86:14)
    at Array.forEach (<anonymous>)
    at reporter.step (/material-components-site-generator/scripts/build:85:21)
    at Reporter.step (/material-components-site-generator/scripts/lib/reporter.js:32:22)
    at Object.<anonymous> (/material-components-site-generator/scripts/build:84:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
```
Now we no longer get fatal errors or crash when running the script.
2019-03-01 16:52:02 -05:00
Robert Moore
800188a649
{clang-format} Format the components. (#6347)
This is a follow-up to https://github.com/material-components/material-components-ios/pull/6027

```
find components \( -name "*.h" -or -name "*.m" \) | xargs clang-format -i
```
2019-01-23 11:08:43 -05:00