472 Commits

Author SHA1 Message Date
Cody Weaver
eb212f39b5 Internal change
PiperOrigin-RevId: 747980927
2025-04-15 12:38:41 -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
8f69468a2f Update Material iOS to compile for visionOS
PiperOrigin-RevId: 641364760
2024-06-07 14:52:13 -07:00
Cody Weaver
8b1de7d929 #FlexibleHeader Delete failing tests
PiperOrigin-RevId: 555553638
2023-08-10 10:34:26 -07:00
Janette James
4579e74a25 Mark FlexibleHeader "To Be Deprecated"
PiperOrigin-RevId: 513316192
2023-03-01 12:58:14 -08:00
Darren Mo
1b7f529826 Add accessibility identifier to MDCFlexibleHeaderView.
Developers may want to write UI tests that involve the flexible header. For example, they may want to write a test to verify that content does not overlap with the flexible header. To enable such tests, `MDCFlexibleHeaderView` needs an accessibility identifier.

PiperOrigin-RevId: 501357485
2023-01-11 13:05:24 -08:00
Nobody
319c5fe79b Fixed up imports for FlexibleHeader
PiperOrigin-RevId: 483506215
2022-10-24 15:52:56 -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
3aa7500685 [FlexibleHeader] Replace MDCPageControl with UIPageControl in the examples.
PiperOrigin-RevId: 461076012
2022-07-14 16:30:38 -07:00
Jeff Verkoeyen
4c6aea2a4e [Buttons+Dialogs] Disable deprecation warnings in headers.
This avoids propagation of warnings to non-Material compilation units which may have deprecation warnings enabled as errors.

PiperOrigin-RevId: 460832988
2022-07-13 16:47:50 -07:00
Jeff Verkoeyen
7ae4498a05 [FlexibleHeader] Delete the unused canAlwaysExpandToMaximumHeight API.
PiperOrigin-RevId: 457775121
2022-06-28 11:11:40 -07:00
Yarden Eitan
028e5b1cfd Internal Change
PiperOrigin-RevId: 407342300
2021-11-03 08:32:52 -07:00
Jeff Verkoeyen
2719769efb Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 401246074
2021-10-06 08:09:04 -07:00
Jeff Verkoeyen
2552ca63d2 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 401066322
2021-10-05 13:51:32 -07:00
Jeff Verkoeyen
c6530c3dab Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 401010431
2021-10-05 10:01:22 -07:00
Jeff Verkoeyen
8fe77c63a1 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 401010384
2021-10-05 09:59:21 -07:00
Jeff Verkoeyen
dc067749f1 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400786978
2021-10-04 12:36:05 -07:00
Jeff Verkoeyen
c34de39e30 Internal change.
PiperOrigin-RevId: 397316843
2021-09-17 07:45:01 -07:00
Randall Li
502bc5d910 Ran a Swift formatter
PiperOrigin-RevId: 395947664
2021-09-10 09:48:14 -07:00
Jeff Verkoeyen
ec44b12ee9 Internal change
PiperOrigin-RevId: 394725753
2021-09-03 11:44:01 -07:00
Jeff Verkoeyen
9638b0bfa4 Annotate APIs with tvOS availability.
PiperOrigin-RevId: 368748687
2021-04-15 17:17:22 -07:00
Nobody
39911e5e75 [Material-iOS/FeatureHighlight, Material-iOS/FlexibleHeader, Material-iOS/HeaderStackView, Material-iOS/PageControl, Material-iOS/ShadowElevation] Fix broken images in iOS/Supporting APIs dev docs
PiperOrigin-RevId: 368295102
2021-04-13 14:30:45 -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
Jeff Verkoeyen
9a49fd96f9 Internal change.
PiperOrigin-RevId: 366342462
2021-04-01 15:26:22 -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
9f9b452b3a Optimizing imports
PiperOrigin-RevId: 356850973
2021-02-10 16:15:17 -08:00
Randall Li
22cb5afa87 [MDCFlexibleHeader] Redefine topSafeAreaGuide as a UIView.
Was of type id. This allows for friendlier use by clients.

PiperOrigin-RevId: 356403425
2021-02-08 18:49:27 -08:00
Yarden Eitan
caafdae217 [FlexibleHeader] Deprecate pre iOS 8 ToBeDeprecated APIs.
PiperOrigin-RevId: 333367145
2020-09-23 14:19:34 -07:00
Yarden Eitan
39e7aed49c [FlexibleHeader] Deprecate MDCFlexibleHeaderMinMaxHeight API.
PiperOrigin-RevId: 333366623
2020-09-23 14:04:35 -07:00
Jeff Verkoeyen
fbb1f20aa2 Internal change
PiperOrigin-RevId: 332151481
2020-09-16 21:01:21 -07:00
Bryan Oltman
da4b8f7c7f Fix mdc_elevationDidChangeBlock block parameter types for Xcode 12
PiperOrigin-RevId: 331843566
2020-09-15 13:39:15 -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
Nobody
8bd70a377e Respect UIRefreshControl in tracked scroll view in flexible header.
This is necessary for UIRefreshControl to work correctly with MDCFlexibleHeaderView on iOS 13, as it no longer adjusts the contentInset directly (https://developer.apple.com/documentation/ios_ipados_release_notes/ios_13_release_notes?language=objc).

PiperOrigin-RevId: 319378754
2020-07-02 02:43:00 -07:00
Jeff Verkoeyen
d0809e93bf [FlexibleHeader] Mark more apis as to-be-deprecated.
PiperOrigin-RevId: 318869606
2020-06-29 12:38:18 -07:00
Jeff Verkoeyen
0c4d185958 [FlexibleHeader] Remove ShiftBehaviorWithStatusBar from the public API.
PiperOrigin-RevId: 313372668
2020-05-27 05:47:40 -07:00
Jeff Verkoeyen
b5aa93e81c Internal change
PiperOrigin-RevId: 312773402
2020-05-21 17:44:22 -07:00
Jeff Verkoeyen
9fde103ea5 [FlexibleHeader] Extract hidesStatusBarWhenShiftedOffscreen to the shifter.
Also adds unit tests for the API.

PiperOrigin-RevId: 312531709
2020-05-20 12:26:58 -07:00
Jeff Verkoeyen
643170dea9 [FlexibleHeader] Move the shift behavior types to separate targets.
PiperOrigin-RevId: 312473972
2020-05-20 07:00:00 -07:00
Jeff Verkoeyen
5b8abd6659 [FlexibleHeader] Turn MDCFlexibleHeaderShiftBehavior into an extensible enum.
PiperOrigin-RevId: 312267643
2020-05-19 06:33:11 -07:00
Jeff Verkoeyen
3fc4f0cb47 [FlexibleHeader] Move ShiftBehaviorForCurrentAppContext into the MDCFlexibleHeaderShifter.
This is a step towards moving more of the shift behavior-related logic into a smaller, better tested logical unit.

PiperOrigin-RevId: 312260829
2020-05-19 05:34:39 -07:00
Jeff Verkoeyen
bebb73f5e5 [FlexibleHeader] Extract a shifter logical unit.
This logical unit will house all logic related to the shift behavior. It is being extracted as a distinct logical unit so that it can be better unit tested and validated in terms of behavior. This change introduces an initial test for the basic skeletal object accordingly.

In subsequent changes, we will move logic from MDCFlexibleHeaderView into this new object.

PiperOrigin-RevId: 311203197
2020-05-13 14:46:12 +00:00
Andrew Overton
a31b69ecd1 [FlexibleHeader] Change links in FlexibleHeader README
This CL fixes in advance links that would otherwise be broken the next time material.io is deployed.

PiperOrigin-RevId: 311137322
2020-05-13 14:42:42 +00:00
Jeff Verkoeyen
a502ce66b9 [FlexibleHeader] Ensure that the FlexibleHeader's position reacts to safeAreaInsets changes when hidden.
## The bug

Repro steps:

1. Open MDCDragons on an iPhone with a notch.
2. Open App Bar -> Presented hidden.
3. Present the App Bar.
4. Observe.

Expected behavior:
- The AppBar is completely hidden.

Actual behavior:
- The AppBar is partially hidden.

## Root cause analysis

When the FlexibleHeader is hidden using shiftHeaderOffScreenAnimated:, the expectation is that the header will be shifted entirely off-screen. If this method is invoked before the FlexibleHeader is attached to a window hierarchy, then the offset applied to shift the header off-screen may not correctly include the necessary safe area insets to hide the header fully.

When flexibleHeaderSafeAreaTopSafeAreaInsetDidChange was being invoked after the safe area insets were made available to the FlexibleHeader, we were not taking into consideration whether the FlexibleHeader was supposed to be hidden which resulted in the FlexibleHeader getting stuck in a partially hidden state.

## The fix

In flexibleHeaderSafeAreaTopSafeAreaInsetDidChange, we now check whether the FlexibleHeader wants to be hidden and, if it does (and we're not already animating it), we immediately snap the FlexibleHeader to the new necessary offset.

PiperOrigin-RevId: 311104051
2020-05-13 14:40:20 +00:00
Jeff Verkoeyen
cb574d4141 [FlexibleHeader] Add a safe area layout guide example.
This example demonstrates a bug where the safe area layout guide does not appear to be working as expected (i.e. the content does not pin to the bottom of the FlexibleHeader).

PiperOrigin-RevId: 310220555
2020-05-06 13:51:53 -07:00
Jeff Verkoeyen
4a22863ca0 [FlexibleHeader] Add example snapshot tests.
PiperOrigin-RevId: 309345809
2020-04-30 19:32:23 -07:00
Andrew Overton
7814b0c460 Replace App Bar docs
This PR replaces the AppBar README. The content is mostly the same, I just had to restructure it in order to fit the new template.

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

PiperOrigin-RevId: 309097690
2020-04-29 14:32:52 -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
Yarden Eitan
9ef494d52e [AppBar] Round content offset clamp to nearest integer.
An issue was found regarding UIKit re-setting the content offset when the value is a fractional number due to screen densities. By rounding the offset clamp to the nearest integer we are assuring the contentOffset value will be valid and UIKit would not try to alter it causing an infinite loop and thus a crash.

PiperOrigin-RevId: 307810013
2020-04-22 07:16:03 -07: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