Skip to content

Commit

Permalink
Merge branch 'release-candidate' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanoltman committed May 18, 2020
2 parents fe665ce + e9b346c commit c90e40e
Show file tree
Hide file tree
Showing 53 changed files with 843 additions and 444 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# 109.4.0

This minor release adds Theming extension support to MDCBottomDrawerViewController and includes bug fixes and minor refactoring.

## New features

- MDCBottomDrawerViewController now has Theming extension support.

## Component changes

### AppBar

* [Add NavigationController example with AppBar initially hidden.](https://github.com/material-components/material-components-ios/commit/dbb9ab1170fda2c4fd571fe682d1af6a84278a8e) (Jeff Verkoeyen)

### FlexibleHeader

* [Change links in FlexibleHeader README](https://github.com/material-components/material-components-ios/commit/a31b69ecd1bb89c33bcae5843a309808872889e4) (Andrew Overton)
* [Extract a shifter logical unit.](https://github.com/material-components/material-components-ios/commit/bebb73f5e55ec5b2fe9e6ba8bec57ca2e6b4b4aa) (Jeff Verkoeyen)

### Tabs

* [Add support for custom accessibility labels for tab bar items.](https://github.com/material-components/material-components-ios/commit/7335fb5ca9c46a4b27f731724f23c2c4cbdbeec3) (Yarden Eitan)

## Multi-component changes

* [ - 51170612999194997e160654411ac87bb61d4764 Automatic changelog preparation for release. by Galia Kaufman <galiak@google.com> - 85feb7896b37c0a93b8c5b5dbcde72403b379dee [Tabs] Update podspec to include new folders. by Galia Kaufman <galiak@google.com> - fbd3f81309b46b9d8e0a6a9dd03e4b63c7794f27 Hand-modified CHANGELOG.md API diff. by Galia Kaufman <galiak@google.com> - 27927ce42748c7afb3ac270b6d6ec64d1c50d3bc Bumped version number to 109.3.1. by Galia Kaufman <galiak@google.com>](https://github.com/material-components/material-components-ios/commit/2d0d6a8faa6fe7acea7921552a8afe1f656c9088) (Galia Kaufman)
* [Ensure that the FlexibleHeader's position reacts to safeAreaInsets changes when hidden.](https://github.com/material-components/material-components-ios/commit/a502ce66b98101fcc155f98696a974ff91083557) (Jeff Verkoeyen)
* [Fix broken links This CL fixes some longstanding and some newly broken links.](https://github.com/material-components/material-components-ios/commit/0a36a3a12be81c9d2d1d84f15452ed6153c97f74) (Andrew Overton)
* [Fix broken links This CL fixes some longstanding and some newly broken links.](https://github.com/material-components/material-components-ios/commit/1fa6c77ee83f13b2e9711ae182cef5999152f36b) (Andrew Overton)
* [Internal change](https://github.com/material-components/material-components-ios/commit/70716800b8db661d8efa744ab8a3f41e15b99f57) (Nobody)
* [Internal change](https://github.com/material-components/material-components-ios/commit/efea2ddce69e4fdde643fe2e367b1f16b16c9880) (Jeff Verkoeyen)

---

# 109.3.1

This hotfix patch release fixes the podspec. Updating the podpsec with new folders that were added in the previous release.
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponents.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load 'scripts/generated/icons.rb'

Pod::Spec.new do |mdc|
mdc.name = "MaterialComponents"
mdc.version = "109.3.1"
mdc.version = "109.4.0"
mdc.authors = "The Material Components authors."
mdc.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
mdc.homepage = "https://github.com/material-components/material-components-ios"
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsBeta.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |mdc|
mdc.name = "MaterialComponentsBeta"
mdc.version = "109.3.1"
mdc.version = "109.4.0"
mdc.authors = "The Material Components authors."
mdc.summary = "A collection of stand-alone alpha UI libraries that are not yet guaranteed to be ready for general production use. Use with caution."
mdc.homepage = "https://github.com/material-components/material-components-ios"
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsEarlGreyTests.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialComponentsEarlGreyTests"
s.version = "109.3.1"
s.version = "109.4.0"
s.authors = "The Material Components authors."
s.summary = "This spec is an aggregate of all the Material Components EarlGrey tests."
s.description = "This spec is made for use in the MDC Catalog."
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsExamples.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialComponentsExamples"
s.version = "109.3.1"
s.version = "109.4.0"
s.authors = "The Material Components authors."
s.summary = "This spec is an aggregate of all the Material Components examples."
s.description = "This spec is made for use in the MDC Catalog. Used in conjunction with CatalogByConvention we create our Material Catalog."
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsSnapshotTests.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ end

Pod::Spec.new do |s|
s.name = "MaterialComponentsSnapshotTests"
s.version = "109.3.1"
s.version = "109.4.0"
s.authors = "The Material Components authors."
s.summary = "This spec is an aggregate of all the Material Components snapshot tests."
s.homepage = "https://github.com/material-components/material-components-ios"
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
109.3.1
109.4.0
4 changes: 2 additions & 2 deletions catalog/MDCCatalog/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>109.3.1</string>
<string>109.4.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>109.3.1</string>
<string>109.4.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIAppFonts</key>
Expand Down
4 changes: 2 additions & 2 deletions catalog/MDCDragons/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>109.3.1</string>
<string>109.4.0</string>
<key>CFBundleVersion</key>
<string>109.3.1</string>
<string>109.4.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
2 changes: 1 addition & 1 deletion catalog/MaterialCatalog/MaterialCatalog.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialCatalog"
s.version = "109.3.1"
s.version = "109.4.0"
s.summary = "Helper Objective-C classes for the MDC catalog."
s.description = "This spec is made for use in the MDC Catalog."
s.homepage = "https://github.com/material-components/material-components-ios"
Expand Down
1 change: 0 additions & 1 deletion components/ActionSheet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ the screen and displays actions a user can take.
## Design & API documentation

<ul class="icon-list">
<li class="icon-list-item icon-list-item--spec"><a href="https://material.io/go/design-action-sheet">Material Design guidelines: ActionSheet</a></li>
<li class="icon-list-item icon-list-item--link">Class: <a href="https://material.io/components/ios/catalog/action-sheet/api-docs/Classes/MDCActionSheetAction.html">MDCActionSheetAction</a></li>
<li class="icon-list-item icon-list-item--link">Class: <a href="https://material.io/components/ios/catalog/action-sheet/api-docs/Classes/MDCActionSheetController.html">MDCActionSheetController</a></li>
<li class="icon-list-item icon-list-item--link">Protocol: <a href="https://material.io/components/ios/catalog/action-sheet/api-docs/Protocols/MDCActionSheetControllerDelegate.html">MDCActionSheetControllerDelegate</a></li>
Expand Down
33 changes: 33 additions & 0 deletions components/ActionSheet/examples/ActionSheetTypicalUseExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ @interface ActionSheetTypicalUseExampleViewController
: UIViewController <MDCActionSheetControllerDelegate>

@property(nonatomic, strong) MDCButton *showButton;
@property(nonatomic, strong) MDCActionSheetController *actionSheet;
@property(nonatomic, strong) id<MDCContainerScheming> containerScheme;

@end
Expand Down Expand Up @@ -92,6 +93,7 @@ - (void)showActionSheet {
[actionSheet addAction:emailAction];
[actionSheet applyThemeWithScheme:self.containerScheme];
actionSheet.delegate = self;
self.actionSheet = actionSheet;
[self presentViewController:actionSheet animated:YES completion:nil];
}

Expand All @@ -113,3 +115,34 @@ + (NSDictionary *)catalogMetadata {
}

@end

@implementation ActionSheetTypicalUseExampleViewController (SnapshotTestingByConvention)

- (void)testDefaults {
// Given
[self resetStates];
MDCContainerScheme *containerScheme = [[MDCContainerScheme alloc] init];
self.containerScheme = containerScheme;

// When
[self showActionSheet];
}

- (void)testDynamic201907ColorScheme {
// Given
[self resetStates];
MDCContainerScheme *containerScheme = [[MDCContainerScheme alloc] init];
containerScheme.colorScheme =
[[MDCSemanticColorScheme alloc] initWithDefaults:MDCColorSchemeDefaultsMaterial201907];
self.containerScheme = containerScheme;

// When
[self showActionSheet];
}

- (void)resetStates {
[self.actionSheet dismissViewControllerAnimated:NO completion:nil];
self.actionSheet = nil;
}

@end
21 changes: 18 additions & 3 deletions components/AppBar/examples/AppBarNavigationControllerExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ class AppBarNavigationControllerExampleViewController:
self.view.backgroundColor = self.containerScheme.colorScheme.backgroundColor

self.navigationItem.rightBarButtonItem =
UIBarButtonItem(title: "Present", style: .done, target: self, action: #selector(presentModal))
UIBarButtonItem(title: "Present",
style: .done,
target: self,
action: #selector(presentModalAnimated))
}

@objc func presentModal() {
@objc func presentModalAnimated() {
presentModal(animated: true)
}

func presentModal(animated: Bool) {
let contentViewController = PresentedViewController()
let navigationController = MDCAppBarNavigationController()
navigationController.shouldSetNavigationBarHiddenHideAppBar = true
Expand All @@ -58,7 +65,7 @@ class AppBarNavigationControllerExampleViewController:
// Explicitly use the full-screen style to validate safe area insets behavior.
navigationController.modalPresentationStyle = .fullScreen

self.present(navigationController, animated: true, completion: nil)
self.present(navigationController, animated: animated, completion: nil)
}

@objc func dismissModal() {
Expand Down Expand Up @@ -135,3 +142,11 @@ extension AppBarNavigationControllerExampleViewController {
]
}
}

// MARK: Snapshot testing by convention
extension AppBarNavigationControllerExampleViewController {

@objc func testPresented() {
presentModal(animated: false)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
// Copyright 2020-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.

import Foundation
import MaterialComponents.MaterialAppBar
import MaterialComponents.MaterialAppBar_Theming
import MaterialComponents.MaterialContainerScheme

class AppBarNavigationControllerWithAppBarInitiallyHiddenExample:
UIViewController,
MDCAppBarNavigationControllerDelegate {

@objc var containerScheme: MDCContainerScheming = MDCContainerScheme()

init() {
super.init(nibName: nil, bundle: nil)

self.title = "Navigation Controller"
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}

override func viewDidLoad() {
super.viewDidLoad()

self.view.backgroundColor = self.containerScheme.colorScheme.backgroundColor

self.navigationItem.rightBarButtonItem =
UIBarButtonItem(title: "Present",
style: .done,
target: self,
action: #selector(presentModalAnimated))
}

@objc func presentModalAnimated() {
presentModal(animated: true)
}

func presentModal(animated: Bool) {
let contentViewController = PresentedViewController()
let navigationController = MDCAppBarNavigationController()
navigationController.shouldSetNavigationBarHiddenHideAppBar = true
navigationController.delegate = self
navigationController.pushViewController(contentViewController, animated: false)

contentViewController.navigationItem.rightBarButtonItem =
UIBarButtonItem(title: "Dismiss",
style: .done,
target: self,
action: #selector(dismissModal))

// Explicitly use the full-screen style to validate safe area insets behavior.
navigationController.modalPresentationStyle = .fullScreen

self.present(navigationController, animated: animated, completion: nil)
}

@objc func dismissModal() {
dismiss(animated: true)
}

// MARK: - MDCAppBarNavigationControllerDelegate

func appBarNavigationController(_ navigationController: MDCAppBarNavigationController,
willAdd appBarViewController: MDCAppBarViewController,
asChildOf viewController: UIViewController) {
appBarViewController.applyPrimaryTheme(withScheme: self.containerScheme)
}
}

private class PresentedViewController: UITableViewController {

init() {
super.init(nibName: nil, bundle: nil)

self.title = "Presented"

self.navigationItem.leftBarButtonItem =
UIBarButtonItem(title: "Toggle",
style: .done,
target: self,
action: #selector(toggleVisibility))
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}

override func viewDidLoad() {
super.viewDidLoad()

navigationController?.setNavigationBarHidden(true, animated: false)
}

// MARK - Actions

@objc func toggleVisibility() {
guard let navigationController = navigationController else {
return
}
navigationController.setNavigationBarHidden(!navigationController.isNavigationBarHidden,
animated: true)
}

// MARK: - UITableViewDataSource

override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 50
}

override func tableView(_ tableView: UITableView,
cellForRowAt indexPath: IndexPath) -> UITableViewCell {

return self.tableView.dequeueReusableCell(withIdentifier: "cell") ??
UITableViewCell(style: .default, reuseIdentifier: "cell")
}

// MARK - UITableViewDelegate

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
toggleVisibility()

tableView.deselectRow(at: indexPath, animated: true)
}
}

// MARK: Catalog by convention
extension AppBarNavigationControllerWithAppBarInitiallyHiddenExample {

@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["App Bar", "Navigation Controller (app bar hidden)"],
"primaryDemo": false,
"presentable": false,
]
}
}

// MARK: Snapshot testing by convention
extension AppBarNavigationControllerWithAppBarInitiallyHiddenExample {

@objc func testPresented() {
// TODO(b/152510959): The AppBar is expected to be hidden, but it is not.
presentModal(animated: false)
}
}
Loading

0 comments on commit c90e40e

Please sign in to comment.