Skip to content

Commit c3cec9d

Browse files
committed
Merge branch 'release-candidate' into stable
2 parents 2c73e2d + bbfbff5 commit c3cec9d

19 files changed

+192
-88
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# 123.0.0
2+
3+
In this major release we have made the MDCBottomNavigationBarController class and its APIs only be available from iOS 12 and up.
4+
5+
## Breaking changes
6+
7+
The MDCBottomNavigationBarController class now only supports iOS 12 and up.
8+
9+
## Component changes
10+
11+
### ActivityIndicator
12+
13+
* [Add unit tests.](https://github.com/material-components/material-components-ios/commit/2416f191aa1b80b52bc4131d653e373ba83fd4dd) (Cody Weaver)
14+
15+
### BottomNavigation
16+
17+
* [Annotate APIs as only supporting iOS 12+.](https://github.com/material-components/material-components-ios/commit/b190b1c3344b209e48e0553a2832a3972c6bab71) (Jeff Verkoeyen)
18+
19+
### Dialogs
20+
21+
* [Adds dismissOnAction property to MDCAlertAction to allow callers to control when the dialog dismisses.](https://github.com/material-components/material-components-ios/commit/9c91e26f04cd5829cb996818a6d0119b23c944fa) (Nobody)
22+
23+
---
24+
125
# 122.0.1
226

327
This patch release fixes a bug and generally cleans up import statements.

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 |mdc|
44
mdc.name = "MaterialComponents"
5-
mdc.version = "122.0.1"
5+
mdc.version = "123.0.0"
66
mdc.authors = "The Material Components authors."
77
mdc.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
88
mdc.homepage = "https://github.com/material-components/material-components-ios"

MaterialComponentsEarlGreyTests.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 = "MaterialComponentsEarlGreyTests"
3-
s.version = "122.0.1"
3+
s.version = "123.0.0"
44
s.authors = "The Material Components authors."
55
s.summary = "This spec is an aggregate of all the Material Components EarlGrey tests."
66
s.description = "This spec is made for use in the MDC Catalog."

MaterialComponentsExamples.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 = "MaterialComponentsExamples"
3-
s.version = "122.0.1"
3+
s.version = "123.0.0"
44
s.authors = "The Material Components authors."
55
s.summary = "This spec is an aggregate of all the Material Components examples."
66
s.description = "This spec is made for use in the MDC Catalog. Used in conjunction with CatalogByConvention we create our Material Catalog."

MaterialComponentsSnapshotTests.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ end
5353

5454
Pod::Spec.new do |s|
5555
s.name = "MaterialComponentsSnapshotTests"
56-
s.version = "122.0.1"
56+
s.version = "123.0.0"
5757
s.authors = "The Material Components authors."
5858
s.summary = "This spec is an aggregate of all the Material Components snapshot tests."
5959
s.homepage = "https://github.com/material-components/material-components-ios"

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
122.0.1
1+
123.0.0

catalog/MDCCatalog/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>122.0.1</string>
18+
<string>123.0.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>122.0.1</string>
22+
<string>123.0.0</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UIAppFonts</key>

catalog/MDCDragons/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>122.0.1</string>
18+
<string>123.0.0</string>
1919
<key>CFBundleVersion</key>
20-
<string>122.0.1</string>
20+
<string>123.0.0</string>
2121
<key>LSRequiresIPhoneOS</key>
2222
<true/>
2323
<key>UILaunchStoryboardName</key>

catalog/MaterialCatalog/MaterialCatalog.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 = "MaterialCatalog"
3-
s.version = "122.0.1"
3+
s.version = "123.0.0"
44
s.summary = "Helper Objective-C classes for the MDC catalog."
55
s.description = "This spec is made for use in the MDC Catalog."
66
s.homepage = "https://github.com/material-components/material-components-ios"

components/ActivityIndicator/tests/unit/ActivityIndicatorTests.m

Lines changed: 97 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -26,67 +26,66 @@ @interface MDCActivityIndicator (Private)
2626
@end
2727

2828
@interface ActivityIndicatorTests : XCTestCase
29-
29+
@property(nonatomic, strong, nullable) MDCActivityIndicator *indicator;
3030
@end
3131

3232
@implementation ActivityIndicatorTests
3333

34-
- (void)testSetRadiusMin {
35-
// Given
36-
MDCActivityIndicator *indicator = [[MDCActivityIndicator alloc] init];
34+
- (void)setUp {
35+
[super setUp];
36+
37+
self.indicator = [[MDCActivityIndicator alloc] init];
38+
}
39+
40+
- (void)tearDown {
41+
self.indicator = nil;
3742

43+
[super tearDown];
44+
}
45+
46+
- (void)testSetRadiusMin {
3847
// When
39-
indicator.radius = 2;
48+
self.indicator.radius = 2;
4049

4150
// Then
42-
XCTAssertGreaterThanOrEqual(indicator.radius, 5);
51+
XCTAssertGreaterThanOrEqual(self.indicator.radius, 5);
4352
}
4453

4554
- (void)testSetRadius {
46-
// Given
47-
MDCActivityIndicator *indicator = [[MDCActivityIndicator alloc] init];
48-
4955
// When
5056
CGFloat random = randomNumber();
51-
indicator.radius = random;
57+
self.indicator.radius = random;
5258

5359
// Then
54-
XCTAssertGreaterThanOrEqual(indicator.radius, 8);
55-
XCTAssertEqual(indicator.radius, random);
60+
XCTAssertGreaterThanOrEqual(self.indicator.radius, 8);
61+
XCTAssertEqual(self.indicator.radius, random);
5662
}
5763

5864
- (void)testDefaultColorCycle {
59-
// Given
60-
MDCActivityIndicator *indicator = [[MDCActivityIndicator alloc] init];
61-
6265
// Then
63-
XCTAssertGreaterThan(indicator.cycleColors.count, 0U,
66+
XCTAssertGreaterThan(self.indicator.cycleColors.count, 0U,
6467
@"The default value for |cycleColors| should be a non-empty array.");
6568
}
6669

6770
- (void)testSetCycleColorsEmptyReturnsDefault {
68-
// Given
69-
MDCActivityIndicator *indicator = [[MDCActivityIndicator alloc] init];
70-
7171
// When
72-
indicator.cycleColors = @[];
72+
self.indicator.cycleColors = @[];
7373

7474
// Then
75-
XCTAssertGreaterThan(indicator.cycleColors.count, 0U,
75+
XCTAssertGreaterThan(self.indicator.cycleColors.count, 0U,
7676
@"Assigning an empty array for |cycleColors| should result in a default"
7777
" value being used instead.");
7878
}
7979

8080
- (void)testSetCycleColorNonEmpty {
8181
// Given
82-
MDCActivityIndicator *indicator = [[MDCActivityIndicator alloc] init];
8382
NSArray<UIColor *> *cycleColors = @[ [UIColor redColor], [UIColor whiteColor] ];
8483

8584
// When
86-
indicator.cycleColors = cycleColors;
85+
self.indicator.cycleColors = cycleColors;
8786

8887
// Then
89-
XCTAssertEqualObjects(indicator.cycleColors, cycleColors,
88+
XCTAssertEqualObjects(self.indicator.cycleColors, cycleColors,
9089
@"With a non-empty array, the |cycleColors| property should override the"
9190
" default value.");
9291
}
@@ -95,72 +94,65 @@ - (void)testSetProgressValue {
9594
// Make sure that setting progress with or without animation work regardless of whether indicator
9695
// mode is determinate or indeterminate, and make sure that setting progress value doesn't change
9796
// the mode.
98-
MDCActivityIndicator *indicator = [[MDCActivityIndicator alloc] init];
99-
100-
indicator.indicatorMode = MDCActivityIndicatorModeDeterminate;
101-
[self verifySettingProgressOnIndicator:indicator animated:NO];
102-
[self verifySettingProgressOnIndicator:indicator animated:YES];
103-
XCTAssertEqual(indicator.indicatorMode, MDCActivityIndicatorModeDeterminate);
104-
105-
indicator.indicatorMode = MDCActivityIndicatorModeIndeterminate;
106-
[self verifySettingProgressOnIndicator:indicator animated:NO];
107-
[self verifySettingProgressOnIndicator:indicator animated:YES];
108-
XCTAssertEqual(indicator.indicatorMode, MDCActivityIndicatorModeIndeterminate);
97+
self.indicator.indicatorMode = MDCActivityIndicatorModeDeterminate;
98+
[self verifySettingProgressOnIndicator:self.indicator animated:NO];
99+
[self verifySettingProgressOnIndicator:self.indicator animated:YES];
100+
XCTAssertEqual(self.indicator.indicatorMode, MDCActivityIndicatorModeDeterminate);
101+
102+
self.indicator.indicatorMode = MDCActivityIndicatorModeIndeterminate;
103+
[self verifySettingProgressOnIndicator:self.indicator animated:NO];
104+
[self verifySettingProgressOnIndicator:self.indicator animated:YES];
105+
XCTAssertEqual(self.indicator.indicatorMode, MDCActivityIndicatorModeIndeterminate);
109106
}
110107

111108
- (void)testSetProgressStrokeNonanimated {
112109
// Make sure that the stroke layer updates accordingly when we set determinate progress.
113-
MDCActivityIndicator *indicator = [[MDCActivityIndicator alloc] init];
114-
indicator.indicatorMode = MDCActivityIndicatorModeDeterminate;
110+
self.indicator.indicatorMode = MDCActivityIndicatorModeDeterminate;
115111

116-
[indicator setProgress:(float)0.33 animated:NO];
117-
XCTAssertEqual(indicator.strokeLayer.strokeStart, 0.0);
118-
XCTAssertEqual(indicator.strokeLayer.strokeEnd, (float)0.33);
112+
[self.indicator setProgress:(float)0.33 animated:NO];
113+
XCTAssertEqual(self.indicator.strokeLayer.strokeStart, 0.0);
114+
XCTAssertEqual(self.indicator.strokeLayer.strokeEnd, (float)0.33);
119115
}
120116

121117
- (void)testSetProgressStrokeAnimated {
122118
// Make sure that the stroke layer updates accordingly when we set determinate progress.
123-
MDCActivityIndicator *indicator = [[MDCActivityIndicator alloc] init];
124-
indicator.indicatorMode = MDCActivityIndicatorModeDeterminate;
125-
[indicator startAnimating];
119+
self.indicator.indicatorMode = MDCActivityIndicatorModeDeterminate;
120+
[self.indicator startAnimating];
126121

127-
[indicator setProgress:(float)0.55 animated:YES];
128-
XCTAssertEqual(indicator.strokeLayer.strokeStart, 0.0);
129-
XCTAssertEqual(indicator.strokeLayer.strokeEnd, (float)0.55);
122+
[self.indicator setProgress:(float)0.55 animated:YES];
123+
XCTAssertEqual(self.indicator.strokeLayer.strokeStart, 0.0);
124+
XCTAssertEqual(self.indicator.strokeLayer.strokeEnd, (float)0.55);
130125
}
131126

132127
- (void)testSetAccessibiltyLabelProperty {
133128
// Given
134-
MDCActivityIndicator *indicator = [[MDCActivityIndicator alloc] init];
135129
NSString *testString = @"test this label";
136130

137131
// When
138-
indicator.accessibilityLabel = testString;
132+
self.indicator.accessibilityLabel = testString;
139133

140134
// Then
141-
XCTAssertEqualObjects(indicator.accessibilityLabel, testString);
135+
XCTAssertEqualObjects(self.indicator.accessibilityLabel, testString);
142136
}
143137

144138
- (void)testStopsAnimatingWhenHidden {
145139
// Given
146-
MDCActivityIndicator *indicator = [[MDCActivityIndicator alloc] init];
147-
[indicator startAnimating];
140+
[self.indicator startAnimating];
148141

149142
// When
150-
indicator.hidden = YES;
143+
self.indicator.hidden = YES;
151144

152145
// Then
153-
XCTAssertFalse(indicator.animating);
146+
XCTAssertFalse(self.indicator.animating);
154147
}
155148

156149
- (void)testTraitCollectionDidChangeBlockCalledWithExpectedParameters {
157150
// Given
158-
MDCActivityIndicator *activityIndicator = [[MDCActivityIndicator alloc] init];
159151
XCTestExpectation *expectation =
160152
[[XCTestExpectation alloc] initWithDescription:@"traitCollectionDidChange"];
161153
__block UITraitCollection *passedTraitCollection;
162154
__block MDCActivityIndicator *passedActivityIndicator;
163-
activityIndicator.traitCollectionDidChangeBlock =
155+
self.indicator.traitCollectionDidChangeBlock =
164156
^(MDCActivityIndicator *_Nonnull indicator,
165157
UITraitCollection *_Nullable previousTraitCollection) {
166158
[expectation fulfill];
@@ -170,12 +162,60 @@ - (void)testTraitCollectionDidChangeBlockCalledWithExpectedParameters {
170162
UITraitCollection *testTraitCollection = [UITraitCollection traitCollectionWithDisplayScale:7];
171163

172164
// When
173-
[activityIndicator traitCollectionDidChange:testTraitCollection];
165+
[self.indicator traitCollectionDidChange:testTraitCollection];
174166

175167
// Then
176168
[self waitForExpectations:@[ expectation ] timeout:1];
177169
XCTAssertEqual(passedTraitCollection, testTraitCollection);
178-
XCTAssertEqual(passedActivityIndicator, activityIndicator);
170+
XCTAssertEqual(passedActivityIndicator, self.indicator);
171+
}
172+
173+
- (void)testTrackEnabledDefaultsToNo {
174+
// Then
175+
XCTAssertFalse(self.indicator.trackEnabled);
176+
}
177+
178+
- (void)testTrackEnabledUpdatesWhenSet {
179+
// When
180+
self.indicator.trackEnabled = YES;
181+
182+
// Then
183+
XCTAssertTrue(self.indicator.trackEnabled);
184+
}
185+
186+
- (void)testDefaultStrokeWidth {
187+
// Then
188+
XCTAssertEqualWithAccuracy(self.indicator.strokeWidth, 2.5, 0.001);
189+
}
190+
191+
- (void)testSetStrokeWidthToCustomValue {
192+
// Given
193+
CGFloat expectedWidth = 5;
194+
195+
// When
196+
self.indicator.strokeWidth = expectedWidth;
197+
198+
// Then
199+
XCTAssertEqualWithAccuracy(self.indicator.strokeWidth, expectedWidth, 0.001);
200+
}
201+
202+
- (void)testDefaultAccessibilityTraits {
203+
// Then
204+
XCTAssertEqual(self.indicator.accessibilityTraits, UIAccessibilityTraitUpdatesFrequently);
205+
}
206+
207+
- (void)testAccessibilityElementWhenAnimating {
208+
// When
209+
self.indicator.animating = YES;
210+
211+
// Then
212+
XCTAssertTrue(self.indicator.isAccessibilityElement);
213+
}
214+
215+
- (void)testDefaultIsAccessibilityElement {
216+
// Then
217+
XCTAssertFalse(self.indicator.animating);
218+
XCTAssertFalse(self.indicator.isAccessibilityElement);
179219
}
180220

181221
#pragma mark - Helpers

components/BottomNavigation/examples/BottomNavigationHideShowExample.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import MaterialComponents.MaterialBottomNavigation_BottomNavigationController
1818
import MaterialComponents.MaterialBottomNavigation_Theming
1919
import MaterialComponents.MaterialContainerScheme
2020

21+
@available(iOS 12.0, *)
2122
class BottomNavigationHideShowExample: UIViewController {
2223
static let cellReuseIdentifier = "cell"
2324
static let numberOfCells = 40
@@ -73,6 +74,7 @@ class BottomNavigationHideShowExample: UIViewController {
7374
}
7475
}
7576

77+
@available(iOS 12.0, *)
7678
extension BottomNavigationHideShowExample: UITableViewDataSource {
7779
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
7880
return BottomNavigationHideShowExample.numberOfCells
@@ -88,6 +90,7 @@ extension BottomNavigationHideShowExample: UITableViewDataSource {
8890
}
8991

9092
// MARK: Catalog by convention
93+
@available(iOS 12.0, *)
9194
extension BottomNavigationHideShowExample {
9295
@objc class func catalogMetadata() -> [String: Any] {
9396
return [
@@ -96,9 +99,14 @@ extension BottomNavigationHideShowExample {
9699
"presentable": false,
97100
]
98101
}
102+
103+
@objc class func minimumOSVersion() -> OperatingSystemVersion {
104+
return OperatingSystemVersion(majorVersion: 12, minorVersion: 0, patchVersion: 0)
105+
}
99106
}
100107

101108
// MARK: Snapshot Testing by Convention
109+
@available(iOS 12.0, *)
102110
extension BottomNavigationHideShowExample {
103111
@objc func testAdjustsContentInsetsForHiddenBottomBar() {
104112
toggleBottomBar(animated: false)

components/BottomNavigation/src/MDCBottomNavigationBarController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
preserved. Upon decoding, if the view controllers array contains a reference to the previous
3838
selected view controller, that view controller is set to selected.
3939
*/
40+
API_AVAILABLE(ios(12.0))
4041
@interface MDCBottomNavigationBarController : UIViewController <MDCBottomNavigationBarDelegate>
4142

4243
/**

0 commit comments

Comments
 (0)