9 Commits

Author SHA1 Message Date
Jeff Verkoeyen
1437067081 Optimizing imports
PiperOrigin-RevId: 356851164
2021-02-10 16:18:20 -08:00
Jeff Verkoeyen
25471afea0 Rename "flaky" to "skip_snapshots".
PiperOrigin-RevId: 308259307
2020-04-24 08:34:12 -07:00
Jeff Verkoeyen
776dacc084 [AppBar] Mark the webview examples as flaky.
PiperOrigin-RevId: 308252919
2020-04-24 07:51:05 -07: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
Robert Moore
372d6b24f9
No longer using -init for Color Scheme. (#5734)
{MDC iOS} No longer using `-init` for Color Scheme.

Based on the discussions in go/mdc-ios-theming, we should not use the `-init` default initializer. Instead, we should use an explicit set of defaults.

Search regex: '\[\[MDCSemanticColorScheme alloc\] init\]'
2018-11-12 12:54:47 -05:00
Robert Moore
03f3351ad5
Global replace of single-precision floats with CGFloat casts. (#5718)
Replacing all non-integral, single-precision floating point literals with double-precision values explicitly cast to CGFloat.  For example, `0.1f` should become `(CGFloat)0.1`.

Regex used:
```
([0-9]*\.)([0-9]*?)([1-9]+)([0-9]*?)[fF]
```

PiperOrigin-RevId: 220683126
2018-11-12 10:50:01 -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
Yarden Eitan
3480c50c67
updated to newest CbC standard (#4956)
Move to the new CbC standard released in CatalogByConvention v2.5.0. See PR: material-foundation/cocoapods-catalog-by-convention#27 for more info on the change.
2018-08-29 20:45:13 -04:00
featherless
4e658a5aee
[FlexibleHeader] Fix a bug with WKWebView as a tracking scroll view. (#4701)
Repro case:
- Open MDCDragons.
- Open the App Bar -> WKWebView small content bug

Expected behavior: the web view does not allow the content to be scrolled up and down.
Actual behavior: the web view's scroll view's content size height appears to have extra padding, allowing the content to be scrolled.

---

This change introduces a runtime check for WKWebView. If the tracking scroll view is a scroll view of a WKWebView, we disable the content inset adjustment behavior in favor of using additionalSafeAreaInsets on iOS 11 and up. On older iOS devices, clients must instead rely on the topLayoutGuide and position their web view below the header accordingly. This is demonstrated in the two added examples.

This bug stems from the fact that UIKit's implementations of its various UIScrollView subclasses each have individual quirks. UITableView reacts differently to additionalSafeAreaInsets than WKWebView's scroll view, and a pure UIScrollView reacts differently from either of them. The most notable difference in behavior is how and when the contentOffset is adjusted in reaction to changes in the additionalSafeAreaInsets.

My original attempt at this fix included a public behavioral flag that would allow clients to opt in to using additionalSafeAreaInsets for any tracking scroll view, but the various quirks of UITableView and friends was expanding the scope of the fix too much. I would like to move the Flexible Header towards relying solely on additionalSafeAreaInsets in the future, but for now it is out of scope of this particular bug fix. As such, I've introduced a more focused behavioral flag that only enables itself if the tracking scroll view is a WKWebView's scroll view.

Closes https://github.com/material-components/material-components-ios/issues/4377
2018-08-15 09:24:43 -04:00