Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Commit d2e5a2a

Browse files
committed
Merge branch 'release-candidate'
2 parents 43c7f94 + 3b9426b commit d2e5a2a

File tree

58 files changed

+1388
-562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1388
-562
lines changed

.swiftlint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ excluded:
22
- Carthage
33
- Pods
44
- third_party
5+
- catalog/third_party
56

67
disabled_rules:
78
- cyclomatic_complexity
9+
- force_cast
10+
- todo
11+
- type_name
12+
13+
line_length: 100
814

915
force_cast: warning
1016
force_try: warning

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ env:
1515
- DESTINATION="platform=iOS Simulator,name=iPhone 7,OS=10.2" SDK="iphonesimulator10.2"
1616
before_install:
1717
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
18-
- brew update
19-
- brew install swiftlint || true # If already installed, don't fail.
18+
- scripts/install_contributor_tools
2019
# The travis_wait prefix ensures that the build doesn't error out because too much time went past
2120
# without any output being produced.
2221
script:

CHANGELOG.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,77 @@
1+
# 20.1.0
2+
3+
## API diffs
4+
5+
### Snackbar
6+
7+
* Message View Styling
8+
9+
## Component changes
10+
11+
### AppBar
12+
13+
#### Changes
14+
15+
* [- Added Modal Presentation App Bar Example (#1153)](https://github.com/material-components/material-components-ios/commit/8ab5505d0e438d7e9a7a31cf9e1ffea113e3be7c) (Justin Shephard)
16+
* [More SwiftLint fixes for unit tests and example apps. (#1154)](https://github.com/material-components/material-components-ios/commit/8bcb19781cd8387464f46be51cdd72787d3f12ef) (Adrian Secord)
17+
18+
### Buttons
19+
20+
#### Changes
21+
22+
* [More SwiftLint fixes for unit tests and example apps. (#1154)](https://github.com/material-components/material-components-ios/commit/8bcb19781cd8387464f46be51cdd72787d3f12ef) (Adrian Secord)
23+
24+
### Collections
25+
26+
#### Changes
27+
28+
* [Added custom Storyboard cell to the Storyboard example. (#1152)](https://github.com/material-components/material-components-ios/commit/6843303f9d54a5a11a70abae6976f0b4d011636f) (Adrian Secord)
29+
* [More SwiftLint fixes for unit tests and example apps. (#1154)](https://github.com/material-components/material-components-ios/commit/8bcb19781cd8387464f46be51cdd72787d3f12ef) (Adrian Secord)
30+
31+
### Dialogs
32+
33+
#### Changes
34+
35+
* [More SwiftLint fixes for unit tests and example apps. (#1154)](https://github.com/material-components/material-components-ios/commit/8bcb19781cd8387464f46be51cdd72787d3f12ef) (Adrian Secord)
36+
37+
### FeatureHighlight
38+
39+
#### Changes
40+
41+
* [Build fix: CGFloat casts missing from MDCFeatureHighlightView.m.](https://github.com/material-components/material-components-ios/commit/99d59f3fc6e2be46ebbe93c2784965516615a4ba) (Adrian Secord)
42+
* [More SwiftLint fixes for unit tests and example apps. (#1154)](https://github.com/material-components/material-components-ios/commit/8bcb19781cd8387464f46be51cdd72787d3f12ef) (Adrian Secord)
43+
* [[Feature highlight] Dynamically size inner highlight (#1151)](https://github.com/material-components/material-components-ios/commit/771496f6c6044866ea30622006646e7a7193e070) (Sam Morrison)
44+
45+
### FlexibleHeader
46+
47+
#### Changes
48+
49+
* [More SwiftLint fixes for unit tests and example apps. (#1154)](https://github.com/material-components/material-components-ios/commit/8bcb19781cd8387464f46be51cdd72787d3f12ef) (Adrian Secord)
50+
51+
### PageControl
52+
53+
#### Changes
54+
55+
* [More SwiftLint fixes for unit tests and example apps. (#1154)](https://github.com/material-components/material-components-ios/commit/8bcb19781cd8387464f46be51cdd72787d3f12ef) (Adrian Secord)
56+
57+
### Palettes
58+
59+
#### Changes
60+
61+
* [More SwiftLint fixes for unit tests and example apps. (#1154)](https://github.com/material-components/material-components-ios/commit/8bcb19781cd8387464f46be51cdd72787d3f12ef) (Adrian Secord)
62+
63+
### ShadowLayer
64+
65+
#### Changes
66+
67+
* [More SwiftLint fixes for unit tests and example apps. (#1154)](https://github.com/material-components/material-components-ios/commit/8bcb19781cd8387464f46be51cdd72787d3f12ef) (Adrian Secord)
68+
69+
### Snackbar
70+
71+
#### Changes
72+
73+
* [Message View Styling. (#1120)](https://github.com/material-components/material-components-ios/commit/95891e1130e6ee9351d5e7bad8f1ceb68bc22500) (Sean O'Shea)
74+
175
# 20.0.0
276

377
## API changes
@@ -296,6 +370,7 @@ This point release removes the examples from `private/ThumbTrack`; they didn't f
296370

297371
* [Remove all references to removed components (#1067)](https://github.com/material-components/material-components-ios/commit/03059189e5c929d877a6fd83d33c1a5614273527) (Adrian Secord)
298372
* [Removed old refs to API docs. (#1084)](https://github.com/material-components/material-components-ios/commit/e8c45d53942908ceece95bfadbc98db7a92089b0) (Adrian Secord)
373+
299374
# 19.0.1
300375

301376
This point release fixes stale references to MDFFontDiskLoader, MDFSpritedAnimationView, and MDFRobotoFontLoader in our CocoaPods podspec.

MaterialComponents.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load 'scripts/generated/icons.rb'
22

33
Pod::Spec.new do |s|
44
s.name = "MaterialComponents"
5-
s.version = "20.0.0"
5+
s.version = "20.1.0"
66
s.authors = "The Material Components authors."
77
s.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
88
s.homepage = "https://github.com/material-components/material-components-ios"

MaterialComponentsCatalog.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "MaterialComponentsCatalog"
3-
s.version = "20.0.0"
3+
s.version = "20.1.0"
44
s.authors = "The Material Components authors."
55
s.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
66
s.homepage = "https://github.com/material-components/material-components-ios"

MaterialComponentsUnitTests.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "MaterialComponentsUnitTests"
3-
s.version = "20.0.0"
3+
s.version = "20.1.0"
44
s.authors = "The Material Motion authors."
55
s.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
66
s.homepage = "https://github.com/material-components/material-components-ios"

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Material Components for iOS are written in Objective-C and support Swift and Int
1818
- [MDC-iOS on Stack Overflow](https://www.stackoverflow.com/questions/tagged/material-components+ios) (external site)
1919
- [Material.io](https://www.material.io) (external site)
2020
- [Material Design Guidelines](https://material.google.com) (external site)
21-
21+
2222
## Trying out Material Components
2323

2424
Our [catalog](catalog/) showcases Material Components. You can use the `pod try` command from anywhere on your machine to try the components, even if you haven't checked out the repo yet:
@@ -33,6 +33,9 @@ In case you have already checked out the repo, run the following command:
3333
pod install --project-directory=catalog/
3434
~~~
3535

36+
If you want to take a look at the implementation of the components, you can find the code inside the `Development Pods` folder.
37+
Use `cmd-1` to open the project navigator within Xcode. Peal open the `Pods` project and inside the `Development Pods` folder you will find the component source code.
38+
3639
## Installation
3740

3841
### Getting Started with a New Project

catalog/MDCCatalog.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@
507507
);
508508
runOnlyForDeploymentPostprocessing = 0;
509509
shellPath = /bin/sh;
510-
shellScript = "${SRCROOT}/../scripts/lint.sh";
510+
shellScript = "${SRCROOT}/../scripts/lint_all";
511511
};
512512
72ACDAA295D1F2087113246F /* [CP] Embed Pods Frameworks */ = {
513513
isa = PBXShellScriptBuildPhase;

catalog/MDCCatalog/AppDelegate.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2323

2424
var window: UIWindow?
2525

26-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
26+
func application(_ application: UIApplication, didFinishLaunchingWithOptions
27+
launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
2728
self.window = MDCCatalogWindow(frame: UIScreen.main.bounds)
2829

2930
let tree = CBCCreateNavigationTree()

catalog/MDCCatalog/MDCCatalogComponentsController.swift

Lines changed: 61 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ class MDCCatalogComponentsController: UICollectionViewController, MDCInkTouchCon
4444

4545
let layout = UICollectionViewFlowLayout()
4646
let sectionInset: CGFloat = spacing
47-
layout.sectionInset = UIEdgeInsets(top: sectionInset, left: sectionInset, bottom: sectionInset, right: sectionInset)
47+
layout.sectionInset = UIEdgeInsets(top: sectionInset,
48+
left: sectionInset,
49+
bottom: sectionInset,
50+
right: sectionInset)
4851
layout.minimumInteritemSpacing = spacing
4952
layout.minimumLineSpacing = spacing
5053

@@ -102,41 +105,10 @@ class MDCCatalogComponentsController: UICollectionViewController, MDCInkTouchCon
102105
titleLabel.translatesAutoresizingMaskIntoConstraints = false
103106

104107
containerView.addSubview(titleLabel)
105-
_ = NSLayoutConstraint(
106-
item: titleLabel,
107-
attribute: .leading,
108-
relatedBy: .equal,
109-
toItem: containerView,
110-
attribute: .leading,
111-
multiplier: 1.0,
112-
constant: titleInsets.left).isActive = true
113-
114-
_ = NSLayoutConstraint(
115-
item: titleLabel,
116-
attribute: .trailing,
117-
relatedBy: .equal,
118-
toItem: containerView,
119-
attribute: .trailing,
120-
multiplier: 1.0,
121-
constant: 0).isActive = true
122-
123-
_ = NSLayoutConstraint(
124-
item: titleLabel,
125-
attribute: .bottom,
126-
relatedBy: .equal,
127-
toItem: containerView,
128-
attribute: .bottom,
129-
multiplier: 1.0,
130-
constant: -titleInsets.bottom).isActive = true
131-
132-
_ = NSLayoutConstraint(
133-
item: titleLabel,
134-
attribute: .height,
135-
relatedBy: .equal,
136-
toItem: nil,
137-
attribute: .notAnAttribute,
138-
multiplier: 1.0,
139-
constant: titleSize.height).isActive = true
108+
constrainLabel(label: titleLabel,
109+
containerView: containerView,
110+
insets: titleInsets,
111+
height: titleSize.height)
140112

141113
self.headerViewController.headerView.addSubview(containerView)
142114

@@ -183,11 +155,13 @@ class MDCCatalogComponentsController: UICollectionViewController, MDCInkTouchCon
183155

184156
// MARK: MDCInkTouchControllerDelegate
185157

186-
func inkTouchController(_ inkTouchController: MDCInkTouchController, shouldProcessInkTouchesAtTouchLocation location: CGPoint) -> Bool {
158+
func inkTouchController(_ inkTouchController: MDCInkTouchController,
159+
shouldProcessInkTouchesAtTouchLocation location: CGPoint) -> Bool {
187160
return self.collectionView!.indexPathForItem(at: location) != nil
188161
}
189162

190-
func inkTouchController(_ inkTouchController: MDCInkTouchController, inkViewAtTouchLocation location: CGPoint) -> MDCInkView {
163+
func inkTouchController(_ inkTouchController: MDCInkTouchController,
164+
inkViewAtTouchLocation location: CGPoint) -> MDCInkView {
191165
if let indexPath = self.collectionView!.indexPathForItem(at: location) {
192166
let cell = self.collectionView!.cellForItem(at: indexPath)
193167
return self.inkViewForView(cell!)
@@ -197,9 +171,11 @@ class MDCCatalogComponentsController: UICollectionViewController, MDCInkTouchCon
197171

198172
// MARK: UICollectionViewDelegate
199173

200-
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
201-
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MDCCatalogCollectionViewCell",
202-
for: indexPath)
174+
override func collectionView(_ collectionView: UICollectionView,
175+
cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
176+
let cell =
177+
collectionView.dequeueReusableCell(withReuseIdentifier: "MDCCatalogCollectionViewCell",
178+
for: indexPath)
203179
cell.backgroundColor = UIColor.white
204180

205181
let componentName = self.node.children[indexPath.row].title
@@ -213,7 +189,9 @@ class MDCCatalogComponentsController: UICollectionViewController, MDCInkTouchCon
213189
return cell
214190
}
215191

216-
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: IndexPath) -> CGSize {
192+
func collectionView(_ collectionView: UICollectionView,
193+
layout collectionViewLayout: UICollectionViewLayout,
194+
sizeForItemAtIndexPath indexPath: IndexPath) -> CGSize {
217195
let pad = CGFloat(1)
218196
var cellWidth = (self.view.frame.size.width - 3 * pad) / 2
219197
if self.view.frame.size.width > self.view.frame.size.height {
@@ -234,6 +212,47 @@ class MDCCatalogComponentsController: UICollectionViewController, MDCInkTouchCon
234212
self.navigationController?.pushViewController(vc, animated: true)
235213
}
236214

215+
// MARK: Private
216+
func constrainLabel(label: UILabel,
217+
containerView: UIView,
218+
insets: UIEdgeInsets,
219+
height: CGFloat) {
220+
_ = NSLayoutConstraint(
221+
item: label,
222+
attribute: .leading,
223+
relatedBy: .equal,
224+
toItem: containerView,
225+
attribute: .leading,
226+
multiplier: 1.0,
227+
constant: insets.left).isActive = true
228+
229+
_ = NSLayoutConstraint(
230+
item: label,
231+
attribute: .trailing,
232+
relatedBy: .equal,
233+
toItem: containerView,
234+
attribute: .trailing,
235+
multiplier: 1.0,
236+
constant: 0).isActive = true
237+
238+
_ = NSLayoutConstraint(
239+
item: label,
240+
attribute: .bottom,
241+
relatedBy: .equal,
242+
toItem: containerView,
243+
attribute: .bottom,
244+
multiplier: 1.0,
245+
constant: -insets.bottom).isActive = true
246+
247+
_ = NSLayoutConstraint(
248+
item: label,
249+
attribute: .height,
250+
relatedBy: .equal,
251+
toItem: nil,
252+
attribute: .notAnAttribute,
253+
multiplier: 1.0,
254+
constant: height).isActive = true
255+
}
237256
}
238257

239258
// UIScrollViewDelegate

0 commit comments

Comments
 (0)