Wenyu Zhang
22020cdccf
[Banner] Remove AppBar example snapshot tests because the animation involved causes flakiness.
...
PiperOrigin-RevId: 324623184
2020-08-03 09:55:38 -07:00
Wenyu Zhang
0f8c5f7f3c
[Banner] Add setUp and tearDown to AppBarBannerExample to avoid flaky testing result.
...
PiperOrigin-RevId: 324601984
2020-08-03 07:47:05 -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
f2f99a4520
[Banner] Add example snapshot tests for verifying MDCColorSchemeDefaultsMaterial201907 color scheme.
...
PiperOrigin-RevId: 314125715
2020-06-01 07:24:18 -07:00
Wenyu Zhang
be3c97421b
[Banner] Apply container theme in examples.
...
PiperOrigin-RevId: 313820573
2020-05-29 11:45:45 -07:00
Nobody
70716800b8
Internal change
...
PiperOrigin-RevId: 312085611
2020-05-18 16:41:12 +00:00
Jeff Verkoeyen
a9512e0dba
[Banner] Add snapshot test hooks to the examples.
...
PiperOrigin-RevId: 308163954
2020-04-23 17:32:40 -07:00
Jeff Verkoeyen
fb7a6f4f26
[Banner] Make the primary demo presentable.
...
The primary demo was previously not presentable, meaning it was not appearing in the Banner list of examples and one of the other examples was being selected as the "primary" example. This was breaking testing automation because the expectation for each component is that it has a primary demo and that it is presentable.
PiperOrigin-RevId: 306297190
2020-04-13 13:28:59 -07:00
Robert Moore
8eb7296dab
[Catalog] Fix container scheme properties. ( #9192 )
...
Making remaining examples use protocol for container schemes to match the
project's expected convention.
Found while reviewing #9188
2019-12-09 10:48:25 -05:00
Wenyu Zhang
d1b7468f33
[Banner] Add a Swift example. ( #9173 )
...
closes https://github.com/material-components/material-components-ios/issues/9174 .
2019-12-09 01:37:59 -05:00
Wenyu Zhang
0fcef85a44
[Banner] Post accessibility notification when Banner shows on the screen in examples. ( #9111 )
...
closes https://github.com/material-components/material-components-ios/issues/9079 .
2019-12-05 12:00:51 -05:00
Wenyu Zhang
5e98e17c97
[Banner] Fix top layout constraint in Autolayout example on pre iOS 11 OSes. ( #9042 )
...
closes https://github.com/material-components/material-components-ios/issues/8824 .
Previously, the banner under autolayout constraints relied on `layoutMarginsGuide` which takes `addtionSafeAreaInsets` from flexibleHeader for iOS 11+. This fix switches it back to using `topLayoutGuide` to make it compatible with iOS 7+ when iOS11 is not avaliable.
| Screenshot on iPhone7 10.2 after the fix |
| --- |
|  |
2019-12-03 11:03:02 -05:00
Bryan Oltman
bd0d571ae3
[Catalog] Fix Banner positioning in example for iOS 10 ( #8829 )
...
* [Catalog] Fix Banner positioning in example for iOS 10
* PR feedback
2019-11-14 17:16:04 -05:00
Wenyu Zhang
070865bfa4
[Banner] Add an example to show how Banner can be used as bottom bar in AppBar. ( #8785 )
...
Closes https://github.com/material-components/material-components-ios/issues/8677 .
This PR adds an example to show how Banner could be used as a bottomBar in AppBar.
|Screenshot|
|-----|
||
2019-11-12 21:19:06 -05:00
Wenyu Zhang
52361f8ac8
[Banner] update constraint when frame is changed. ( #8765 )
...
Because Banner needs to update constraints when there is a bound change, and when some view controller in the view hierarchy changes Banner's frame, it might forget to update constraint. Setting it in the frame setter would help making sure it is not missed.
2019-11-11 11:39:01 -05:00
Wenyu Zhang
93f9527e94
[Banner] Refactor typical example view controller. ( #8373 )
...
closes https://github.com/material-components/material-components-ios/issues/6842 .
There is a minor behavior change here that the background of content view changes from blue to grey.
2019-08-28 11:46:05 -04:00
Wenyu Zhang
8428e0690c
[Banner] Add an example to show super long text case. ( #8372 )
...
closes https://github.com/material-components/material-components-ios/issues/7017 .
|Screenshot|
|---|
||
2019-08-27 15:34:13 -04:00
Wenyu Zhang
7f98089580
[Banner] Add a missing button title in example. ( #8369 )
...
Closes https://github.com/material-components/material-components-ios/issues/8368 .
A button is missing from the example. Note: these two buttons are not aligned well. To be fixed in https://github.com/material-components/material-components-ios/pull/8319 .
| Before | After |
| --- | --- |
|  |  |
2019-08-27 10:31:49 -04:00
Wenyu Zhang
42fbedcc4a
[Banner] Apply text theme to button in the typical example. ( #8337 )
...
closes https://github.com/material-components/material-components-ios/issues/7531 .
Originally the text theme was not applied in the example. It is fixed in this PR.
2019-08-22 11:41:11 -04: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
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|
|---|---|
|| |
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|
|---|---|
|||
2019-06-26 16:10:48 -04:00
Wenyu Zhang
37a495b04a
[Banner] Add intrinsicContentSize support with an example. ( #7620 )
...
Previously, `intrinsicContentSize` was not supported in MDCBannerView, which means users have to specify layout constraints for width and height manually. After adding `intrinsicContentSize` support, users will only need to specify width constraints for banner to show it properly. This implementation and behavior matches UITextView.
Screenshot:

2019-06-25 13:11:49 -04:00
Wenyu Zhang
e90426bb0a
[Banner] Fix horizontal constraint between text label and button. ( #7648 )
...
Fix the issue that label are not correctly laid out and shrunk because of low compression priority.
An example content view update issue is fixed to show a correct example screenshot.
Note: this issue doesn't happen on iPhone X and only happens on some OS of iPhone 7.
| Before | After |
| --- | --- |
|  |  |
| |  |
2019-06-19 14:40:08 -04:00
Wenyu Zhang
5f23995620
[Banner] Remove a redundant header file of a typical example. ( #7610 )
2019-06-17 16:49:10 -04:00
Wenyu Zhang
23497ebc80
[Banner] Rename layoutMode to layoutStyle. ( #7605 )
2019-06-14 17:06:26 -04:00
Wenyu Zhang
f717bd3b37
[Banner] set trailingButton default to hidden under SingleRow layout ( #7604 )
...
Only one button (leading button) is allowed under Single Row mode. This PR is meant for reducing configuration steps for clients.
2019-06-14 15:22:41 -04:00
Wenyu Zhang
9aa61a98a6
[Banner] Expose LayoutMode and add an automatic layout mode. ( #7572 )
...
An MDCBannerViewLayoutMode variable was used to control the automatically calculated layout style previously. Because users need to manually control the layout style in some case, a `bannerViewLayoutMode` property is exposed to enable this functionality. An `MDCBannerViewLayoutModeAutomatic` enum has been added to preserve the original automatically layout behavior.
Two examples are added in this PR to show the difference between the automatic style mode and the manual style selection.
Screenshots:
Automatic:

Manual:

2019-06-13 13:12:43 -04:00
Wenyu Zhang
2c47d9514e
[Banner] Add support for divider in MDCBannerView. ( #7567 )
...
This PR adds support for a divider showing at the bottom of a banner view. Snapshot tests will be added in a following PR.
Screenshot:

2019-06-12 14:51:06 -04:00
Wenyu Zhang
595bf04899
[Banner] Make BannerView only iOS 9 available and update examples. ( #7021 )
2019-04-05 14:31:52 -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
Wenyu Zhang
417d32e4d5
[Banner] Fix broken Banner snapshot tests ( #7018 )
...
Banner's snapshot tests were broken caused by https://github.com/material-components/material-components-ios/pull/6991 .
This PR fixes the snapshot tests by adding new API support (e.g. layoutMargins), uses layoutMargins to set the banner view's margin and updates the golden images.
2019-04-02 12:19:43 -04:00
Wenyu Zhang
3d7ef8fb02
[Banner] Use autolayout internally for BannerView. ( #6991 )
...
Major changes for review:
- Remove `MDCBannerViewLayout` class to reduce confusion on `layout` and simplify code structure.
- Use Autolayout to layout subviews in MDCBannerView to simplify the layout calculation logic
Note:
- This class is intended to only support iOS9+ following up the design meeting, though support for iOS8 could be recovered.
- This PR is a follow-up to https://github.com/material-components/material-components-ios/pull/6963 . The API of this MDCBannerView has been reviewed. This PR serves as implementation details.
- This PR is also a follow-up PR split from https://github.com/material-components/material-components-ios/pull/6830 . The original version was approved, this is a much simpler version with less code.
Constraints Screenshot:
(1) Single Line:

(2) MultiLine Stacked Buttons

(3) MultiLine Aligned Buttons

* [Banner] Update BannerTypicalUseExample with latest API changes (#6994 )
Major changes:
- This PR updates the example for typical BannerView usage with latest BannerView API changes.
- This PR add a separate example to each of three existing examples with no icon displayed on the banner view.
- This PR updated some constants in BannerTypicalUseExample.
Screenshots Before Changes:


Screenshots After Changes:



2019-04-01 11:58:33 -04:00
Wenyu Zhang
b8e17555e9
[Banner] add basic banner snapshot tests ( #6896 )
...
* [Banner] add basic banner snapshot tests
* fix format
* [CRC changes] Update the banner snapshot test file name
2019-03-20 15:08:06 -04:00
Wenyu Zhang
9eba591db1
[Banner] Add an umbrella header for Banner ( #6932 )
2019-03-19 11:53:36 -04:00
Wenyu Zhang
7605e3aae2
[Banner] Fix banner revert ( #5833 )
...
* Revert "Revert "[Banner] Banner MVP (#5536 )""
This reverts commit b81ab6a9d0b2cc82594f2328aba89d0c4cd38b5d.
* fix BUILD and import
2018-11-29 10:33:45 -05:00
Yarden Eitan
b81ab6a9d0
Revert "[Banner] Banner MVP ( #5536 )"
...
This reverts commit 6d76a63ea982b930f448389de3dcab14dc55abe1.
2018-11-21 12:48:49 -05:00
Wenyu Zhang
6d76a63ea9
[Banner] Banner MVP ( #5536 )
...
* Add MDCBannerViewLayout class
* Add MDCBannerView class
* Add three examples to the Banner example
Screenshots:



2018-11-16 15:21:58 -05:00
Wenyu Zhang
190453e518
[Banners] Prepare component for prototyping ( #5252 )
...
Spec Link: https://material.io/design/components/banners.html#
2018-10-01 11:10:31 -04:00