31 Commits

Author SHA1 Message Date
Nobody
24a0ffbd03 Annotate various Delegate protocols as NS_SWIFT_UI_ACTOR
PiperOrigin-RevId: 708413470
2024-12-20 13:33:55 -08:00
Nobody
142d22b4ad Internal change.
PiperOrigin-RevId: 662202896
2024-08-12 13:19:27 -07:00
Jeff Verkoeyen
c34de39e30 Internal change.
PiperOrigin-RevId: 397316843
2021-09-17 07:45:01 -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
Dave MacLachlan
ebac2a8eb7 As of iOS 9/macOS 10.11 (circa 2015) removing objective C objects from the NSNotificationCenter in - (void)dealloc. is no longer required (the classic example is: [[NSNotificationCenter defaultCenter] removeObserver:self] but there are several variations).
In many cases this is the only thing being done in - (void)dealloc, so we can remove the whole thing.

PiperOrigin-RevId: 307663440
2020-04-21 13:00:30 -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
Robert Moore
09b2619537
[Overlay] Use more Starlark macros. (#8205)
Add more use of Starlark macros to make releases easier.

Part of #8150
2019-08-02 16:36:24 -04: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
featherless
003cf8bcd9
[automated] Make mdc_unit_test_suite's name explicit. (#6080)
This change was automatically generated by running a find replace of the following strings:

```
mdc_unit_test_suite(

mdc_unit_test_suite(
    name = "unit_tests",
```

And then running buildifier to enforce style:

    find . -name BUILD | xargs ~/buildifier
2018-12-20 12:36:05 -05:00
featherless
dae4e37ea5
[automated] Ran buildifier against all BUILD files. (#5999)
This is an automated change generated by running the following command:

    find . -name BUILD | xargs buildifier

buildifier can be installed from https://github.com/bazelbuild/buildtools

This change formats all of our BUILD files with the buildifier formatter in preparation for us having a BUILD format linter as part of our presubmits and so that we can cleanly run buildozer commands against the codebase.
2018-12-13 11:20:12 -05:00
Robert Moore
74a27253e8
Global replace of integral single-precision literals with integer literals. (#5709)
Global replace of integral single-precision literals with integer literals.

Regular expression used:
```perl
/[^\w]([0-9]+)\.[0]*[fF]/$1/
```
2018-11-08 14:02:04 -05:00
featherless
2181084272
[automated] Standardize our open source license stanza to what Xcode generates. (#4985)
Removes the need to copy-paste stanzas from other files anymore as we'll rely on #4478 to generate the correct stanza for us instead.

This was an automated change generated by running a find-and-replace regular expression:

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at

http://www\.apache\.org/licenses/LICENSE-2\.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at
 http://www\.apache\.org/licenses/LICENSE-2\.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
2018-08-31 12:13:07 -04:00
Jeff Verkoeyen
9854044c96 Revert "[automated] Standardize our open source license stanza to what Xcode generates. (#4982)"
This reverts commit b45bc2fdd4dfe12fc76751a45c9cf7b0d6c1261f.
2018-08-31 12:01:24 -04:00
featherless
b45bc2fdd4
[automated] Standardize our open source license stanza to what Xcode generates. (#4982)
Removes the need to copy-paste stanzas from other files anymore as we'll rely on https://github.com/material-components/material-components-ios/pull/4478 to generate the correct stanza for us instead.

This was an automated change generated by running a find-and-replace regular expression:

### Find

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at
 http://www\.apache\.org/licenses/LICENSE-2\.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

### Replace

```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
2018-08-31 11:49:00 -04:00
Yarden Eitan
7b742b5745
[Kokoro / CI] Have Kokoro test multiple iOS versions and simulators on different Xcodes. (#3117)
* Remove dependency on Travis by having Kokoro test multiple iOS versions and simulators on different Xcodes.

* refactor

* refactor

* refactor
2018-03-21 09:40:30 -04:00
Robert Moore
c4d5e18cc5
[Overlay] Add missing QuartzCore dependency (#2692) 2017-12-13 08:08:54 -05:00
Robert Moore
f0e9b19812
[OverlayObserver] Unregister in dealloc (#2686)
When being deallocated, the OverlayObserver should unregister notifications.
On iOS versions before 9 (8 and below), the NSNotificationCenter unsafely
retains references to any observers. On iOS 9 and above, it will keep safe
unretained references.  This bug wasn't found previously because only the
static singleton was ever used by client components and there were no unit
tests for the component.

Closes #2685
2017-12-12 19:09:08 -05:00
Robert Moore
0e8d5f68fe
[Overlay] Add BUILD file and noop test (#2674) 2017-12-11 13:27:22 -05:00
Yurii Samsoniuk
2a96682230 Replace unnecessary imports with forward declarations (#2429)
* [Themes] Remove unnecessary imports.

* [TextFields] Remove unnecessary imports.

* [Typography] Do not use an umbrella header inside of a component.

* [Snackbar] Do not use self umbrella header.

* [ActivityIndicator] Do not use self umbrella header.

* [AppBar] Use umbrella headers.

* [AppBar] Remove self import header.

* [ButtonBar] Removed self umbrella header imports.

* [Buttons] Removed self umbrella header imports.

* [Collections] Update imports.

* [Dialogs] Moved import into an m file.

* [Collections] Fixed imports.

* [FeatureHighlight] Removed self umbrealla imports.

* [HeaderStackView] Reordered imports.

* [Ink] Replaced imports with forward declarations.

* [Slider] Replaced self umbrella import use.

* [Snackbar] Removed self umbrella header import.

* [Tabs] Changed math import. Replaced self umbrella header import.

* [Icons] Removed unnecessary imports.

* [Overlay] Replaced umbrella header import.

* [ShapeLibrary] Replace Shapes imports with an umbrella header.

* [Shapes] Replaced imports with forward declarations.

* [AppBar] Replace import with a forward declaration.

* [Examples] Updated imports.

* Fixed conflicting imports

* Added space between different import categories
2017-11-16 18:25:06 -05:00
Adrian Secord
dc9ee1359f Workaround -Wunused-parameter, since it can't handle usage inside of asserts. (#1986)
* Disable -Wunused-parameter, since it can't handle usage inside of asserts.

* Revert "Disable -Wunused-parameter, since it can't handle usage inside of asserts."

This reverts commit cb62c756b784337aacfdaf79a25eaaebc72497a6.

* Added workaround for debug-only usage of parameters.
2017-09-18 13:51:03 -04:00
Robert Moore
5498005f65 [Catalog] Enabling all "unused" warnings (#1875)
Re-enabling warnings for unused parameters. Turning on every other
unused warning I could find.

Closes #1874
2017-08-29 17:57:41 -04:00
Robert Moore
18d791e463 [Snackbar] Fixing snackbar/overlay during rotation (#1830)
The MDCSnackbarOverlayView was not correctly laying-out its
containingView during rotation. Forcing the containingView to layout
during the overlay view's layoutSubviews method has corrected the
position of the Snackbar for notification recipients. It was also using
the fixedCoordinateSpace of UIScreen, which is incorrect as it does not
account for rotation.

Updating the Snackbar Overlay View example to include an animated FAB to
demonstrate an incompatibility with autoresizing masks.

Closes #1701
2017-08-18 11:25:58 -04:00
Robert Moore
70921a37b5 [OverlayWindow] Weakify self in animation blocks (#1823)
The MDCOverlayObserverTransition will no longer retain itself in its
|animations| array.  This will allow any objects that had actions
attached to the MDCOverlayObserver to be released as well.

Closes #1821
2017-08-16 19:54:39 -04:00
Robert Moore
fa10d655d7 Remove uses of typeof and the ?: operator (#1601)
Make the code base more portable by replacing some GNU extension code
with C99-compatible versions.

* Replace shortcut ?: operator with explicit middle (true) terms
* Remove pointer inequality checks in conditionals
* (Cleanup) Change to #include for <tgmath.h> based on style guide

Closes #846
2017-07-11 17:39:45 -04:00
Randall Li
266a716f60 Fix imports to use umbrella imports (#1529)
* [ColorThemes] Use umbrella header instead of MDCColorScheme

* [Application] Use umbrella header instead of class header

* [Button] use umbrella header in private header

* [Typography] use umbrella header in private header

* icons using umbrella header in individual icon class

* [Icons] added header to umbrella header

* [collection] umbrella header instead of class header in test

* [Collections] use umbrella header in private header

* [ActivityIndicator] use umbrella header in private header

* [ButtonBar] use umbrella header in private header

* [Dialog] use umbrella header in private header

* [featurehighlight] use umbrella header in private header

* [snackbar] use umbrella header in private header

* [textFields] use umbrella header in private header

* [thumbtrack] use umbrella header in private header

* [Overlay] use umbrella header in private header

also removed spurious ’s’ at end of MaterialOverlay.h file

* [slider] use umbrella header in private header

* [buttonBar] use umbrella header in private header

* [slider] use umbrella header in test

* [Overlay] fixed overlay reference to use umbrella header
2017-06-19 15:57:48 -04:00
Adrian Secord
8c3af252be Adding AUTHORS and removing CONTRIBUTORS.txt.
We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has...

Summary:

We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has no legal change, since the contributors always retained their copyright despite the copyright notice, but it's a nice acknowledgement.

Changed copyright statement to include non-Google authors.

Command run:

find * \( -name '*\.m' -or -name '*\.h' -or -name '*\.swift' \) -and -not \( -path 'scripts/external*' -name Pods  \) -print0 | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'

Added non-source files.

Command run:

grep -Rl 'Copyright .* Google Inc' * --exclude-dir scripts/external --null | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'

Reviewers: featherless, O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1415
2016-08-08 08:16:37 -07:00
Adrian Secord
bc75506662 Merge branch 'release-candidate' 2016-06-30 15:03:04 -04:00
Adrian Secord
a045b07bcc Fix internal builds.
Summary:
- Adds missing dependencies to the podspec.
- Fixes private import paths.
- Adds dummy variable to "empty" static library targets to suppress build warnings.
- Suppresses string concatenation warnings in valid contexts.
- Lint changes.

Reviewers: iangordon, O1 Material components iOS

Reviewed By: iangordon, O1 Material components iOS

Subscribers: junius

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1074
2016-06-30 13:19:16 -04:00
Junius Gunaratne
be579f15da Add legal info to snackbar files and umbrella header for keyboard watcher
Reviewers: O1 Material components iOS, ajsecord

Reviewed By: O1 Material components iOS, ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1068
2016-06-29 17:18:26 -04:00
Junius Gunaratne
e8afa47fa6 [Snackbar] Adding Snackbar component and related Overlay Window
Summary:
Adds Snackbar and related Overlay Window component as well as demos for MDCCatalog. The Overlay component, of which Snackbar depends, is private for the time being.

  - Removed dependencies on internal core.
  - Removed i18n string translation, TODO added to replace.
  - Removed RTL, waiting on https://github.com/google/material-components-ios/issues/579
  - Animation curve constants moved inline.
  - Fixed styling to be the material standard instead of configurable.

Reviewers: ajsecord, O1 Material components iOS

Reviewed By: ajsecord, O1 Material components iOS

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1036
2016-06-29 10:44:06 -04:00