20 Commits

Author SHA1 Message Date
Jeff Verkoeyen
92254ea119 Rename all icons to an ic_<#name#> convention.
PiperOrigin-RevId: 308232277
2020-04-24 04:33:51 -07:00
Cody Weaver
fdf87c5995 [MDC/ColorScheme] Remove usage of init within MDC.
We recommend using `initWithDefaults` and we should follow the recommendation. This change removes all usage of `init` within MDC components in order to let us remove that initializer from the public surface.

PiperOrigin-RevId: 302958447
2020-03-25 13:36:51 -07:00
Bryan Oltman
3b0bc4fda3
[BottomNavigation] Migrate MDCBottomNavigationBarColorThemer use to theming extension (#9142)
Migrate `MDCBottomNavigationBarColorThemer` logic to theming extensions to prepare for the eventual deletion of `MDCBottomNavigationBarColorThemer`.

Part of #9130
2019-12-06 12:43:55 -05:00
Robert Moore
48e95bbf0e
[BottomNavigation] Don't set sizeThatFitsIncludesSafeArea. (#8065)
The default value is false, so setting it to `false`/`NO` is unnecessary.

Part of #6783
2019-07-24 00:43:11 -04:00
Yarden Eitan
efe61588a6
update (#7246)
We need to add @objc annotations to colorScheme and typographyScheme instances in our Swift examples, because we moved to Swift 4.2, the respondsToSelector won't find `setColorScheme:` and `setTypographyScheme:` setters otherwise.
2019-04-23 10:21:14 -04:00
Andrew Overton
c56d5d76d3
Add @objc annotations to get examples to show up in Dragons (#7168)
This is a follow up PR for #7166 adds @objc annotations to Swift catalogMetadata() methods, because the Swift 4 compiler no longer attempts to infer what methods should be visible to Objective-C. As a result of this change in the compiler, no Swift examples were showing up in Dragons after #7166. See this article: https://useyourloaf.com/blog/objc-warnings-upgrading-to-swift-4/ for additional context.
2019-04-17 21:35:43 -04:00
Robert Moore
10ed6188a5
[BottomNavigation] Examples clean-up. (#6718)
This is a collection of internal clean-ups that were overdue on Bottom Navigation examples.  Nearly all examples (8 of 9) were updated. The majority of the improvements focused on visual layout and appearance, but some code clean-up took place as well.

* Making sure buttons/labels remain on-screen after rotations.
* Correctly positioning the BottomNavigationBar with respect to the safe
  area.
* Not adding subviews or configuring views in `-init`
* Allow Catalog/Dragons to inject an App Bar.
* Stop overriding titles.
* Use property access.

## Before/After Screenshots

Not all examples visibly changed as a result of the code clean-up (e.g., "Bottom Navigation" and "Blur Effect"), but the before and after images are present to make it easier to review.

|Example|Before|After|
|---|---|---|
|Badge Value Test|![bn-badgevalue-develop](https://user-images.githubusercontent.com/1753199/53541471-fe4fa680-3ae7-11e9-96f6-7a57bfcc418b.png)|![bn-badgevalue-after](https://user-images.githubusercontent.com/1753199/53541474-027bc400-3ae8-11e9-80d8-3332c2f016bb.png)|
|Blur Effect|![bn-blur-develop](https://user-images.githubusercontent.com/1753199/53541485-0f98b300-3ae8-11e9-9072-8afebb379448.png)|![bn-blur-after](https://user-images.githubusercontent.com/1753199/53541486-11fb0d00-3ae8-11e9-9d07-853091e51a0c.png)|
|Bottom Navigation|![bn-typical-develop](https://user-images.githubusercontent.com/1753199/53541495-1de6cf00-3ae8-11e9-922d-6f981a94b007.png)|![bn-typical-after](https://user-images.githubusercontent.com/1753199/53541498-2212ec80-3ae8-11e9-9aa4-7bfa39573cb0.png)|
|Bottom Navigation (Swift)|![bn-swift-develop](https://user-images.githubusercontent.com/1753199/53541507-2b9c5480-3ae8-11e9-9460-f91c46e2a4fd.png)|![bn-swift-after](https://user-images.githubusercontent.com/1753199/53541509-2e974500-3ae8-11e9-99f6-4df133de640a.png)|
|Bottom Navigation Reorder (Swift)|![bn-reorder-develop](https://user-images.githubusercontent.com/1753199/53541558-6d2cff80-3ae8-11e9-92e0-ba99e48f9e34.png)|![bn-reorder-after](https://user-images.githubusercontent.com/1753199/53541560-7027f000-3ae8-11e9-982a-80ca04587f4d.png)|
|Bottom Navigation Selected|![bn-selected-develop](https://user-images.githubusercontent.com/1753199/53541575-7ddd7580-3ae8-11e9-83ff-def8334a2874.png)|![bn-selected-after](https://user-images.githubusercontent.com/1753199/53541577-803fcf80-3ae8-11e9-8789-0088ab3a9449.png)|
|Bottom Navigation Set Color (Swift)|![bn-setcolor-develop](https://user-images.githubusercontent.com/1753199/53541598-93529f80-3ae8-11e9-9fc9-e71b8530c398.png)|![bn-setcolor-after](https://user-images.githubusercontent.com/1753199/53541602-95b4f980-3ae8-11e9-95cb-eb463ba449e9.png)|
|Bottom Navigation Title Visibility (Swift)|![bn-titlevis-develop](https://user-images.githubusercontent.com/1753199/53541611-a36a7f00-3ae8-11e9-86ca-02aa2a7afc5e.png)|![bn-titlevis-after](https://user-images.githubusercontent.com/1753199/53541619-a9606000-3ae8-11e9-8e9c-3655d77f1d6b.png)|
2019-03-06 08:52:54 -05:00
Bartholomew Furrow
a9c8fab43d [BottomNavigation] Lays out the bar when titleVisibility is changed (#6152)
Closes #6151.
2019-01-24 07:43:56 -05:00
Cody Weaver
e0fef69db3
Fix example (#5242)
### Context
In working on #4042 I discovered that Bottom Navigation (Swift) example isn't working as intended
### The problem
No elements were on screen
### The fix
Call the common init in the initializer

### Screenshots
| Before | After |
| ----- | ----- |
|![simulator screen shot - iphone xs max - 2018-09-25 at 15 18 57](https://user-images.githubusercontent.com/7131294/46037525-5ff18c00-c0d6-11e8-9b70-d43a98626acf.png)|![simulator screen shot - iphone xs max - 2018-09-25 at 15 14 18](https://user-images.githubusercontent.com/7131294/46037533-63851300-c0d6-11e8-8253-cc99f7db504c.png)|
2018-09-26 09:25:19 -04:00
featherless
d5c064fdff
[automated] Fix more copyright stanzas. (#4990)
Our creativity knows no bounds.

### 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\.
 *\*/
```

```
/\*

 *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 ([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 ([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 16:09:12 -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
Robert Moore
175942d9e0
[Catalog] Fix Swift example imports (#4780)
Many of our Swift examples are either missing imports or are importing all of
MaterialComponents. Both of these will cause failures during internal builds.
2018-08-14 13:26:37 -04:00
Cody Weaver
a9d508c681 [BottomNavigation] Add example when we explicitly set color (#4420)
* Add example when we explicitly set color of bottom navigation bar

* Clean up app bar stuff and move code out of init.

* Fix error with appBar

* Remove lines where I set color and remove extra example from this PR.

* Fix whitespace issue

* Adjust colors and tags.

* Change tags and colors, forgot to add this to the last commit.
2018-06-22 15:29:41 -04:00
Yarden Eitan
7f7bc36202
[Catalog] Expose colorScheme + typographyScheme properties for all examples to use app wide theming (#3478)
Made colorScheme and typographyScheme properties in the class interfaces for all our examples.
Moved theming away from example inits and into viewDidLoad
Small update for slider example to allow it to grab the theming properly.
Related Pivotal: https://www.pivotaltracker.com/story/show/156616695
2018-04-25 15:15:17 -04:00
featherless
23110ef116
[Catalog] Make all swift copycat demos be dragons. (#3443)
Also removed "(Swift)" from any examples that remained as non-dragons. The catalog does not need to advertise which language a given demo is in.

Pivotal story: https://www.pivotaltracker.com/story/show/156939611

## Screenshots

Before:
![simulator screen shot - iphone se - 2018-04-23 at 14 04 14](https://user-images.githubusercontent.com/45670/39144588-36095450-46ff-11e8-868d-bdb7e8ee5438.png)

After:
![simulator screen shot - iphone se - 2018-04-23 at 13 53 39](https://user-images.githubusercontent.com/45670/39144567-2ad7bf9a-46ff-11e8-9fd5-ef0739d427b3.png)
2018-04-24 15:52:13 -04:00
John Detloff
f31cd3010d
Update BottomNavigationBar color themer (#3316)
https://www.pivotaltracker.com/story/show/156171489

Before:

https://user-images.githubusercontent.com/1418389/38699258-8753b1b8-3e65-11e8-8681-6998b13b1307.png
https://user-images.githubusercontent.com/1418389/38699259-875ded04-3e65-11e8-81ff-1d75069d6b22.png
https://user-images.githubusercontent.com/1418389/38699260-8768d480-3e65-11e8-93d2-16ad46e816f5.png


After:

https://user-images.githubusercontent.com/1418389/38699244-7ca2f10c-3e65-11e8-8b58-ac385b89e658.png
https://user-images.githubusercontent.com/1418389/38699245-7cad2f46-3e65-11e8-94b6-e326d9ca6854.png
https://user-images.githubusercontent.com/1418389/38699246-7cb5fa86-3e65-11e8-88f2-7359d40a2490.png
2018-04-12 16:14:49 -04:00
Yarden Eitan
29d760c7d6
Added isPresentable to catalog files, ported over ZShadow to dragons. (#2726) 2017-12-15 12:20:35 -05:00
Junius Gunaratne
36cf023a96 Implement viewSafeAreaInsetsDidChange (#2465) 2017-11-17 09:19:04 -05:00
Junius Gunaratne
4ada8e028a
[BottomNavigation] Add color themer to bottom navigation bar (#2239)
* Adding bottom nav component

* Add bottom navigation item

* Add nav item and cell badge classes

* Add badge color

* Update Bottom Nav Item

* Use KVO

* Update centering for orientation change

* Update badgeValue property

* Add nav bar container view for items

* Check text height when setting frame

* Update badge height calculation

* Add select and unselected color, add icons for demo, RTL support

* Add MDCMath as dependency

* Add demo description to example

* Add selection states for hiding item titles on select

* Change hide state name to default

* Rename view to bar

* Update nullability

* Rename properties for consistency with UITabBar

* Rename container view

* Update selected item property name

* Rename properties for consistency with UITabBar

* Rename classes, formatting

* Replace custom badge layer path with corner radius

* Remove MDCMath as dependency, update formatting

* Update layout to accommodate iPhone X

* Remove unused constant

* Move autoresizing to init

* Update landscape mode layout, add interim selection state

* Remove safeAreaInsetsDidChange

* Separate layout from setSelected

* Update landscape item layout

* Add landscape layout states, update sizeThatFits

* Update some setters, properties and formatting

* Update to dot setter syntax

* Change how image tintColor is modified

* Add i18n and a11y support for VoiceOver

* Update s/copy/strong

* Add a11y selected indicator

* Minor formatting updates

* Minor formatting

* Fix order of operations for remove item views

* Only permit badge color change if iOS 10 or higher.

* Add support for RTL for item adjacent titles

* Spelling correction in comments.

* Update title visibility enum names

* Update title visibility enum names

* Update title visibility names

* Remove 3-5 item requirement and change to recommendation

* nullability updates, distribution mode updates

* Add UIAppearance

* Lower bottom nav height when using adjacent titles

* Changing color/font properties to nonnull.

* Add bottom navigation color themer

* Update bottom nav bar main view so it's not an a11y element

* Add shadow to bottom nav

* Make imageview non a11y element.

* Adding tab a11y string

* Remove comment

* Rename distribution enum to alignment, stylistic updates

* Move badgeValue out of setters section

* Add check for iOS 10 when using badge color

* Remove newer availability checks

* Remove unncessary call to viewSafeAreaInsetsDidChange

* Add @available(iOS 11.0, *) check

* Fix badge color iOS version check

* Fix minor typo

* Add shadow layer and elevation dependency to podspec

* Remove (@available(iOS 10.0, *))

* Remove code diff

* Update podspec

* Code style updates, improve comments

* Add theming to swift example
2017-11-01 09:10:42 -04:00
Junius Gunaratne
1f8f13f151
[BottomNavigation] Create Bottom Navigation Swift example (#2288)
* Adding bottom nav component

* Add bottom navigation item

* Add nav item and cell badge classes

* Add badge color

* Update Bottom Nav Item

* Use KVO

* Update centering for orientation change

* Update badgeValue property

* Add nav bar container view for items

* Check text height when setting frame

* Update badge height calculation

* Add select and unselected color, add icons for demo, RTL support

* Add MDCMath as dependency

* Add demo description to example

* Add selection states for hiding item titles on select

* Change hide state name to default

* Rename view to bar

* Update nullability

* Rename properties for consistency with UITabBar

* Rename container view

* Update selected item property name

* Rename properties for consistency with UITabBar

* Rename classes, formatting

* Replace custom badge layer path with corner radius

* Remove MDCMath as dependency, update formatting

* Update layout to accommodate iPhone X

* Remove unused constant

* Move autoresizing to init

* Update landscape mode layout, add interim selection state

* Remove safeAreaInsetsDidChange

* Separate layout from setSelected

* Update landscape item layout

* Add landscape layout states, update sizeThatFits

* Update some setters, properties and formatting

* Update to dot setter syntax

* Change how image tintColor is modified

* Add i18n and a11y support for VoiceOver

* Update s/copy/strong

* Add a11y selected indicator

* Minor formatting updates

* Minor formatting

* Fix order of operations for remove item views

* Only permit badge color change if iOS 10 or higher.

* Add support for RTL for item adjacent titles

* Spelling correction in comments.

* Update title visibility enum names

* Update title visibility enum names

* Update title visibility names

* Remove 3-5 item requirement and change to recommendation

* nullability updates, distribution mode updates

* Add UIAppearance

* Lower bottom nav height when using adjacent titles

* Changing color/font properties to nonnull.

* Update bottom nav bar main view so it's not an a11y element

* Add shadow to bottom nav

* Make imageview non a11y element.

* Adding tab a11y string

* Remove comment

* Rename distribution enum to alignment, stylistic updates

* Move badgeValue out of setters section

* Add check for iOS 10 when using badge color

* Remove newer availability checks

* Remove unncessary call to viewSafeAreaInsetsDidChange

* Add @available(iOS 11.0, *) check

* Add bottom navigation Swift example

* Fix badge color iOS version check

* Fix minor typo

* Add shadow layer and elevation dependency to podspec

* Remove (@available(iOS 10.0, *))

* Stylistic updates
2017-10-30 09:36:47 -04:00