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
Robert Moore committed Aug 12, 2019
2 parents 1bd9804 + c3b692f commit d8969a9
Show file tree
Hide file tree
Showing 85 changed files with 1,639 additions and 480 deletions.
12 changes: 10 additions & 2 deletions .kokoro
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ run_bazel() {
tmp_img_dir="$(mktemp -d)"

# Install git lfs if we're performing tests on kokoro
if [ -n "$KOKORO_BUILD_NUMBER" ]; then
if [ -n "$KOKORO_BUILD_NUMBER" ] || [ -n "$AUTOBOT_BUILD_NUMBER" ]; then
if [ "$COMMAND" == "test" ]; then
brew_install git-lfs
git lfs install
Expand All @@ -373,10 +373,18 @@ run_bazel() {
fi
fi

# Configure CI mode
if [ -n "$KOKORO_BUILD_NUMBER" ]; then
ci_mode="kokoro"
elif [ -n "$AUTOBOT_BUILD_NUMBER" ]; then
ci_mode="autobot"
fi

bazel $COMMAND $TARGET --xcode_version $xcode_version --ios_minimum_os=9.0 \
--ios_multi_cpus=i386,x86_64 $extra_args $verbosity_args \
--test_env="FB_REFERENCE_IMAGE_DIR=$snapshot_dir" \
--test_env="IMAGE_DIFF_DIR=$tmp_img_dir"
--test_env="IMAGE_DIFF_DIR=$tmp_img_dir" \
--define ci_mode=$ci_mode
}

run_cocoapods() {
Expand Down
92 changes: 92 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,95 @@
# 86.1.0

This minor release introduces new theming APIs for `MDCActionSheetAction` and
bug fixes. It also includes improvements to the Contained Input Fields and
Bottom Navigation Bar Controller beta component extensions.

## New features

You can now set title and icon tint colors on individual Action Sheet actions.

```objc
MDCActionSheetAction *action = [MDCActionSheetAction actionWithTitle:@"An action"
image:nil
handler:nil];
action.titleColor = UIColor.darkTextColor;
action.tintColor = UIColor.darkTextColor;
```

## API changes

### ActionSheet

#### MDCActionSheetAction

*new* property: `tintColor` in `MDCActionSheetAction`

*new* property: `titleColor` in `MDCActionSheetAction`

### TextFields+ContainedInputView

#### MDCBaseTextField

*new* property: `trailingView` in `MDCBaseTextField`

*new* property: `leadingViewMode` in `MDCBaseTextField`

*new* property: `leadingView` in `MDCBaseTextField`

*new* property: `trailingViewMode` in `MDCBaseTextField`

## Changes

### ActionSheet

* [Allow clients to customize the tint color of actions (#8227)](https://github.com/material-components/material-components-ios/commit/7d208af2466d57f0c3c4fd1a840c630d74b15b8e) (Cody Weaver)
* [Allow clients to customize the title color of actions (#8226)](https://github.com/material-components/material-components-ios/commit/efc2f9214eb89e2c148e58ca24e95a7979f55bb2) (Cody Weaver)
* [Disable a iOS13 failing test. (#8246)](https://github.com/material-components/material-components-ios/commit/a25909f77d32b9f40a82056451b5c954f6edc88e) (Wenyu Zhang)

### ActivityIndicator

* [Rewrite tests in ObjC to prevent the failing unit tests on iOS 13. (#8248)](https://github.com/material-components/material-components-ios/commit/97dfca80033853897173f4bbd5088ec4532e01b8) (Wenyu Zhang)

### AppBar

* [Rewrite tests in ObjC to prevent the failing unit tests on iOS 13. (#8253)](https://github.com/material-components/material-components-ios/commit/3565b6506ea67b0ccec35c2671ac23f6c4eb1924) (Wenyu Zhang)

### Banner

* [Make default textView background color clear (#8258)](https://github.com/material-components/material-components-ios/commit/64a7f84e5558e6342cd1bcf1b138167020d74f8a) (Cody Weaver)

### BottomNavigation

* [Adds state restoration support to the bottom navigation bar controller. (#8117)](https://github.com/material-components/material-components-ios/commit/815d3745eb72369096ad6c76cc7b925b22e92b80) (Eric Lee)
* [Don't assign `accessibilityIdentifier` to the item view (#8240)](https://github.com/material-components/material-components-ios/commit/e50b9be8bca5fe311ed635aad74b815d11b98476) (Robert Moore)
* [Propagate `accessibilityHint` to the accessibility element. (#8241)](https://github.com/material-components/material-components-ios/commit/30de3a875647c993e913ece302d84149e6f7b755) (Robert Moore)

### Buttons

* [Replace mdc_legacyFontScaling usage with adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable. (#8244)](https://github.com/material-components/material-components-ios/commit/af29d5d7372bbc39453e7a6d54863f06aa5567de) (featherless)

### Dialogs

* [Rewrite tests in ObjC to prevent the failing unit tests on iOS 13 (#8257)](https://github.com/material-components/material-components-ios/commit/3c9355711cea0725c246ca95c44ef150373a7aaa) (Wenyu Zhang)

### LibraryInfo

* [Rewrite tests in ObjC to prevent the failing unit tests on iOS 13. (#8251)](https://github.com/material-components/material-components-ios/commit/861f6361653beb4cd56fcca4235e2676d5964bdf) (Wenyu Zhang)

### Palettes

* [Rewrite tests in ObjC to prevent the failing unit tests on iOS 13. (#8255)](https://github.com/material-components/material-components-ios/commit/707b49dd0ea34badde67ae3c3df1b1f7b4e279d5) (Wenyu Zhang)

### TextFields

* [Add some RTL functionality to MDCBaseTextField (#7705)](https://github.com/material-components/material-components-ios/commit/f0cb9b406f2d45f629a105834b403227e9a64abd) (Andrew Overton)

## Multi-component changes

* [Fixes beta components CocoaPods build. (#8134)](https://github.com/material-components/material-components-ios/commit/d389bcc3461712b5dbfaf4b51d6e60fb73f4f800) (Eric Lee)

---

# 86.0.0

In this major release we have provided improvements to our Elevation code for Dark Mode as well as internal clean up.
Expand Down
4 changes: 3 additions & 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 = "86.0.0"
mdc.version = "86.1.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 Expand Up @@ -1884,6 +1884,8 @@ Pod::Spec.new do |mdc|
"components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/private/*.{h,m}"
]

extension.dependency "MDFInternationalization"

extension.test_spec 'UnitTests' do |unit_tests|
unit_tests.source_files = [
"components/#{extension.base_name.split('+')[0]}/tests/unit/#{extension.base_name.split('+')[1]}/*.{h,m,swift}",
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 = "86.0.0"
mdc.version = "86.1.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 = "86.0.0"
s.version = "86.1.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
Expand Up @@ -15,7 +15,7 @@ experimental_resources = [

Pod::Spec.new do |s|
s.name = "MaterialComponentsExamples"
s.version = "86.0.0"
s.version = "86.1.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 = "86.0.0"
s.version = "86.1.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 @@
86.0.0
86.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@
ReferencedContainer = "container:Pods/Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "722E8BB6AD8C6485B800B83BA2E5089F"
BuildableName = "MaterialComponents-Unit-TextFields+ContainedInputView-UnitTests.xctest"
BlueprintName = "MaterialComponents-Unit-TextFields+ContainedInputView-UnitTests"
ReferencedContainer = "container:Pods/Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
Expand Down
6 changes: 3 additions & 3 deletions catalog/MDCCatalog/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MDCAppBarNavigationContro
}

@objc func themeDidChange(notification: NSNotification) {
let colorScheme = AppTheme.globalTheme.colorScheme
let colorScheme = AppTheme.containerScheme.colorScheme
for viewController in navigationController.children {
guard let appBar = navigationController.appBar(for: viewController) else {
continue
Expand All @@ -82,9 +82,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MDCAppBarNavigationContro
func appBarNavigationController(_ navigationController: MDCAppBarNavigationController,
willAdd appBarViewController: MDCAppBarViewController,
asChildOf viewController: UIViewController) {
MDCAppBarColorThemer.applyColorScheme(AppTheme.globalTheme.colorScheme,
MDCAppBarColorThemer.applyColorScheme(AppTheme.containerScheme.colorScheme,
to: appBarViewController)
MDCAppBarTypographyThemer.applyTypographyScheme(AppTheme.globalTheme.typographyScheme,
MDCAppBarTypographyThemer.applyTypographyScheme(AppTheme.containerScheme.typographyScheme,
to: appBarViewController)

if let injectee = viewController as? CatalogAppBarInjectee {
Expand Down
20 changes: 5 additions & 15 deletions catalog/MDCCatalog/AppTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,7 @@ import MaterialComponents.MaterialShapeScheme
import MaterialComponents.MaterialTypographyScheme

final class AppTheme {
let containerScheme: MDCContainerScheming

var colorScheme: MDCColorScheming {
return containerScheme.colorScheme
}

var typographyScheme: MDCTypographyScheming {
return containerScheme.typographyScheme
}

init(containerScheme: MDCContainerScheming) {
self.containerScheme = containerScheme
}

static var globalTheme = AppTheme(containerScheme: DefaultContainerScheme()) {
static var containerScheme: MDCContainerScheming = DefaultContainerScheme() {
didSet {
NotificationCenter.default.post(name: AppTheme.didChangeGlobalThemeNotificationName,
object: nil,
Expand All @@ -44,6 +30,10 @@ final class AppTheme {

static let didChangeGlobalThemeNotificationName =
Notification.Name("MDCCatalogDidChangeGlobalTheme")

private init() {
// An AppTheme is not intended to be created; use the static APIs instead.
}
}

func DefaultContainerScheme() -> MDCContainerScheme {
Expand Down
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>86.0.0</string>
<string>86.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>86.0.0</string>
<string>86.1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIAppFonts</key>
Expand Down
4 changes: 2 additions & 2 deletions catalog/MDCCatalog/MDCCatalogCollectionViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class MDCCatalogCollectionViewCell: UICollectionViewCell {
}

func updateTheme() {
label.font = AppTheme.globalTheme.typographyScheme.button
label.textColor = AppTheme.globalTheme.colorScheme.onBackgroundColor
label.font = AppTheme.containerScheme.typographyScheme.button
label.textColor = AppTheme.containerScheme.colorScheme.onBackgroundColor
}

@objc func themeDidChange(notification: NSNotification) {
Expand Down
12 changes: 6 additions & 6 deletions catalog/MDCCatalog/MDCCatalogComponentsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class MDCCatalogComponentsController: UICollectionViewController, UICollectionVi

collectionView?.register(MDCCatalogCollectionViewCell.self,
forCellWithReuseIdentifier: "MDCCatalogCollectionViewCell")
collectionView?.backgroundColor = AppTheme.globalTheme.colorScheme.backgroundColor
collectionView?.backgroundColor = AppTheme.containerScheme.colorScheme.backgroundColor

MDCIcons.ic_arrow_backUseNewStyle(true)

Expand All @@ -116,7 +116,7 @@ class MDCCatalogComponentsController: UICollectionViewController, UICollectionVi
}

@objc func themeDidChange(notification: NSNotification) {
let colorScheme = AppTheme.globalTheme.colorScheme
let colorScheme = AppTheme.containerScheme.colorScheme
MDCFlexibleHeaderColorThemer.applySemanticColorScheme(colorScheme,
to: headerViewController.headerView)
setNeedsStatusBarAppearanceUpdate()
Expand Down Expand Up @@ -144,9 +144,9 @@ class MDCCatalogComponentsController: UICollectionViewController, UICollectionVi
containerView.autoresizingMask = [.flexibleWidth, .flexibleHeight]

titleLabel.text = title!
titleLabel.textColor = AppTheme.globalTheme.colorScheme.onPrimaryColor
titleLabel.textColor = AppTheme.containerScheme.colorScheme.onPrimaryColor
titleLabel.textAlignment = .center
titleLabel.font = AppTheme.globalTheme.typographyScheme.headline1
titleLabel.font = AppTheme.containerScheme.typographyScheme.headline1
titleLabel.sizeToFit()

let titleInsets = UIEdgeInsets(top: 0,
Expand All @@ -162,7 +162,7 @@ class MDCCatalogComponentsController: UICollectionViewController, UICollectionVi

containerView.addSubview(logo)

let colorScheme = AppTheme.globalTheme.colorScheme
let colorScheme = AppTheme.containerScheme.colorScheme

let image = MDCDrawImage(CGRect(x:0,
y:0,
Expand Down Expand Up @@ -341,7 +341,7 @@ class MDCCatalogComponentsController: UICollectionViewController, UICollectionVi
let cell =
collectionView.dequeueReusableCell(withReuseIdentifier: "MDCCatalogCollectionViewCell",
for: indexPath)
cell.backgroundColor = AppTheme.globalTheme.colorScheme.backgroundColor
cell.backgroundColor = AppTheme.containerScheme.colorScheme.backgroundColor

let componentName = node.children[indexPath.row].title
if let catalogCell = cell as? MDCCatalogCollectionViewCell {
Expand Down
2 changes: 1 addition & 1 deletion catalog/MDCCatalog/MDCCatalogTileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class MDCCatalogTileView: UIView {
func createImage() -> UIImage {
var newImage: UIImage?

let colorScheme = AppTheme.globalTheme.colorScheme
let colorScheme = AppTheme.containerScheme.colorScheme

switch componentNameString {
case "Activity Indicator":
Expand Down
2 changes: 1 addition & 1 deletion catalog/MDCCatalog/MDCMenuViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MDCMenuViewController: UITableViewController {

override func tableView(_ tableView: UITableView,
cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let iconColor = AppTheme.globalTheme.colorScheme.onSurfaceColor.withAlphaComponent(0.61)
let iconColor = AppTheme.containerScheme.colorScheme.onSurfaceColor.withAlphaComponent(0.61)
let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath)
let cellData = tableData[indexPath.item]
cell.textLabel?.text = cellData.title
Expand Down
Loading

0 comments on commit d8969a9

Please sign in to comment.