28 Commits

Author SHA1 Message Date
Cody Weaver
c4e442c1f2 #MDC Delete failing unit tests due to xcode 15.1
PiperOrigin-RevId: 606695775
2024-02-13 11:43:49 -08:00
Jeff Verkoeyen
86a8c97dc7 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400788645
2021-10-04 12:41:07 -07:00
Alyssa Weiss
7fa200758d Delete mdc_adjustsFontForContentSizeCategory from MDCBannerView.
PiperOrigin-RevId: 372545111
2021-05-07 06:42:15 -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
Wenyu Zhang
8bd8b295e2 [Banner] Add contentEdgeInsets support to replace layoutMargins usage in sizeThatFits:.
PiperOrigin-RevId: 348862556
2020-12-23 16:29:52 -08:00
Wenyu Zhang
c1bc33cc42 [Banner] Add Banner snapshots for long text with no action style.
PiperOrigin-RevId: 321803409
2020-07-17 10:22:44 -07:00
Ingerid Fosli
1b69ff6f39 Update sizeThatFits calculation to include layout margins in the height calculation and ensure entire leading button can be clicked when trailing button is hidden, by constraining the buttonContainerView to always be at least as tall as the leading button.
Note: With the update in the height calculation, the additional constraint seems to have no effect, and the banner's layout is correct either way. I prefer to keep it, however, as it'll ensure we don't get the same "button cannot be clicked" error in the future, at least not without breaking constraints. Happy to reconsider this, though!
PiperOrigin-RevId: 321214409
2020-07-14 12:48:44 -07:00
Wenyu Zhang
c13125fb26 [Banner] Support two buttons on a single row style banner.
PiperOrigin-RevId: 316110015
2020-06-12 08:40:14 -07:00
Wenyu Zhang
1591b68564 [Banner] Apply primary color to icon in theming.
PiperOrigin-RevId: 314159312
2020-06-01 10:50:45 -07: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
081fd7a6b4 [Material][Availability] Migrates the Banner to MDCAvailability.
PiperOrigin-RevId: 293864905
2020-02-07 16:05:59 -05:00
Wenyu Zhang
8a2650d5c3
[Banner] Add unit test to test background color change when user interface changes. (#9073)
closes https://github.com/material-components/material-components-ios/issues/9058.

This test ensure not only the block exists when setting it (originally supported behavior), it adds the test to test the real behavior of what should happen to the background color of banner when user interface changes.
2019-12-05 11:43:49 -05:00
Wenyu Zhang
e1ceaf955b
[Banner] Add a snapshot for banner with no action case. (#8968)
Pre-work of fixing https://github.com/material-components/material-components-ios/issues/8954..
2019-11-15 16:45:00 -05:00
Yarden Eitan
dc66b7fe87
[Banner] Add snapshot tests for setting preferredFont with adjustsFontForContentSizeCategory (#8623)
This PR adds 2 snapshot tests to verify the behavior for setting preferredFont on the Banner's text elements when adjustsFontForContentSizeCategory is set to YES.

Closes #8626
2019-10-23 22:13:08 -04:00
Wenyu Zhang
68f5b9d1e4
[Banner] Add theming extension. (#8285)
Closes https://github.com/material-components/material-components-ios/issues/7811. 

This PR adds a theming extension for Banner with elevation support and corresponding tests.
2019-08-15 15:03:11 -04:00
Cody Weaver
534649a1cd
[Banner] Add MaterialElevation support (#8142)
Adds conformance to MDCElevatable and MDCElevationOverriding to
MDCBannerView.

Closes #8028
2019-07-31 09:15:33 -07:00
Wenyu Zhang
e58c550a21
[Banner] use UITextView for text instead of UILabel. (#7993)
closes #7990 

This API change enables more flexibility on the text configuration on banner. Minor visual difference was generated by UITextView's implementation.
2019-07-24 16:23:50 -04:00
Wenyu Zhang
9f09ea01fe
[Banner] Use Arabic for RTL snapshot test (#8010)
Related to https://github.com/material-components/material-components-ios/pull/7993. We need to use real RTL script to avoid Bi-Di issue in TextView.
2019-07-23 13:48:38 -04:00
Wenyu Zhang
e852b398df
[Banner] Add two test cases with icons. (#7989) 2019-07-22 21:43:04 -04:00
Wenyu Zhang
4953449e20
[Snapshot] add support to change TextInput to RTL mode. (#7986)
closes https://github.com/material-components/material-components-ios/issues/7987
2019-07-22 18:43:34 -04:00
Wenyu Zhang
f61504e7f8
[Banner] fix layout margin not being considered for all layout styles. (#7956)
closes https://github.com/material-components/material-components-ios/issues/7959

There was a misalignment issue  on the horizontal axis for non single line style banner. `widthLimit` should be used in all layout styles.
2019-07-19 14:58:15 -04:00
Wenyu Zhang
b8b6780796
[Banner] add snapshot test for middle length text with large layout margin. (#7957)
Prepares a snapshot test to solve https://github.com/material-components/material-components-ios/issues/7959.

The snapshot shows that the banner is not generated with a correct height as the button layout is beyond the banner region slightly.:
![image](https://user-images.githubusercontent.com/8836258/61472991-83cada80-a953-11e9-93e4-f9c57c1cc6c7.png)
2019-07-18 16:38:53 -04:00
Wenyu Zhang
a0c0b2b314
[Banner] Add traitCollectionDidChangeBlock API. (#7948) 2019-07-17 17:24:04 -04:00
Wenyu Zhang
112433335c
[Banner] fix dynamic type support for attributed string. (#7820)
close #7819 

Previously, Banner only looks at the font on the textLabel to make dynamic type changes. After the change, an attributed string displayed on a banner is able to auto adjust its size based on content sizing category.

|Before|After|
|---|---|
|![Simulator Screen Shot - iPhone 8 - 2019-07-09 at 00 27 58](https://user-images.githubusercontent.com/8836258/60859393-75a4ed80-a1e0-11e9-8a45-81e3edbf5910.png)| ![Simulator Screen Shot - iPhone 8 - 2019-07-09 at 00 19 02](https://user-images.githubusercontent.com/8836258/60859313-23fc6300-a1e0-11e9-9ac4-9e6ba62c6557.png)|
2019-07-09 16:20:26 -04:00
Wenyu Zhang
7c1b055ab9
[Banner] Support Dynamic Type in Banner (#7709)
Closes https://github.com/material-components/material-components-ios/issues/7621.

Screenshot:

|Adjusted Sizing Category 1 | Adjusted Sizing Category 2|
|---|---|
|![IMG_0789](https://user-images.githubusercontent.com/8836258/60121196-8a996f80-9750-11e9-818c-b82073d51e2c.PNG)|![IMG_0788](https://user-images.githubusercontent.com/8836258/60121199-8c633300-9750-11e9-824e-6ff2f5c95706.PNG)|
2019-06-26 16:10:48 -04:00
Wenyu Zhang
3f436f9944
[Banner] fix image constraint when it is hidden and on single row mode. (#7649)
After adding support for single row mode on Banner, image constraint needs to be updated. Otherwise it will break the vertical constraints because of the height change.
2019-06-19 15:29:01 -04:00
Wenyu Zhang
0c9e8b427d
[Banner] Elevate Banner component to Beta. (#7065)
closes https://github.com/material-components/material-components-ios/issues/5241.
2019-04-04 16:56:43 -04:00