Skip to content

Commit

Permalink
[TextControls] Add containerRadius support to filled text field
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 331211129
  • Loading branch information
andrewoverton authored and material-automation committed Sep 11, 2020
1 parent dc8add9 commit 0907c19
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 97 deletions.
84 changes: 0 additions & 84 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,3 @@
# 115.1.0

In this minor release we add 2 APIs to customize BottomNavigation's appearance and behavior, we deprecate the property `rippleAllowsSelection` from `MDCChipView`, we provide a `containerRadius` API to `MDCBaseTextField` and `MDCBaseTextArea`, along with other code cleanups.

## New deprecations

`MDCChipView`'s `rippleAllowSelection` property is now deprecated. Please instead use native UIKit APIs to control whether the chip is selected or not, using either the .selected API, or, with MDCChipCollectionViewCell, by calling the `deselectItemAtIndexPath` API to remove selection. Note, this only applies if you have the `enableRippleBehavior` property set to `YES` on `MDCChipView`.

## New features

### BottomNavigation

You can now customize MDCBottomNavigationBar's height using the `barHeight` property.

```objc
MDCBottomNavigationBar *bottomNavBar;
bottomNavBar = [[MDCBottomNavigationBar alloc] initWithFrame:CGRectZero];
bottomNavBar.barHeight = 44;
[self.view addSubview:bottomNavBar];
```

You can now also decide when to hide or show your navigation bar using the new `navigationBarHidden` APIs on MDCBottomNavigationBarController.

```swift
let bottomNavBarController = MDCBottomNavigationBarController()
bottomNavBarController.willMove(toParent: self)
view.addSubview(bottomNavBarController.view)
addChild(bottomNavBarController)
bottomNavBarController.didMove(toParent: self)
let viewController = UIViewController()
bottomNavBarController.viewControllers = [viewController]
bottomNavBarController.setNavigationBarHidden(true, animated: true)
```

### TextControls

Both `MDCBaseTextArea` and `MDCBaseTextField` now have a `containerRadius` API, which determines the corner radius of the container, when applicable.
Setting this property is a no-op for MDCBaseTextField and any subclasses with invisible containers.

```swift
let filledTextField = MDCFilledTextField()
filledTextField.label.text = "label text"
filledTextField.containerRadius = 8
```

## Component changes

### Banner

* [Change the trailing padding constraint for textView on MDCBannerView to match the Material Banner specs (https://material.io/components/banners#specs).](https://github.com/material-components/material-components-ios/commit/56226bbef5e50d2604b43699fad75c9d2d0b0873) (Nobody)

### BottomNavigation

* [Add navigationBarHidden property to MDCBottomNavigationBarController.](https://github.com/material-components/material-components-ios/commit/bb71d6bcbbf9205661e8a324db0d9ae260874689) (Bryan Oltman)
* [Provide an API to set the bar's height.](https://github.com/material-components/material-components-ios/commit/5d3662f0a203cf38e3e379b094b0ffb5f6563b59) (Yarden Eitan)
* [Remove all checks for iOS 10 availability now that components support iOS 10+](https://github.com/material-components/material-components-ios/commit/ef9fd055935cb3f29644ec1eeec10433355a3b31) (Alyssa Weiss)
* [Remove no longer used string bundle references](https://github.com/material-components/material-components-ios/commit/6878fc63446902f4d78c73f4a486ad28ef6caf72) (Alyssa Weiss)
* [Remove supplemental directory from examples.](https://github.com/material-components/material-components-ios/commit/d79d9a86c59ea80f5bbab56d3eaa9badc308d432) (Bryan Oltman)
* [Update Bottom Navigation Item View accessibility traits so that VoiceOver works correctly on iOS 14.](https://github.com/material-components/material-components-ios/commit/898e373ea257b1122a758cd3855420204c5c018e) (Alyssa Weiss)

### Chips

* [Deprecate rippleAllowsSelection as we move away from MDCStatefulRippleView and to a simpler MDCRippleView when enableRippleBehavior is set to YES.](https://github.com/material-components/material-components-ios/commit/4bcf88708b46a38db2f9d695a8e44e0b744ba7ba) (Yarden Eitan)

### Snackbar

* [Enable shouldDismissOnOverlayTap for VO enabled scenario](https://github.com/material-components/material-components-ios/commit/dcda0408f462d9e15e31ed6d95d9654145dab3f4) (Yun Zhang)
* [Example: Dismiss snackbars when push or popping the example VC.](https://github.com/material-components/material-components-ios/commit/4c6b2357e9cd89228049ae9cb4ea5b504fddafac) (Randall Li)
* [Remove non-shared classes from Snackbar supplemental directory.](https://github.com/material-components/material-components-ios/commit/63670a7b2c49c376b13be1dc5bb29356469bc516) (Bryan Oltman)
* [Remove references to deprecated static MDCSnackbarManager methods.](https://github.com/material-components/material-components-ios/commit/78868b55e6a01ed868f7a0918282d678605ce392) (Bryan Oltman)

### Tabs

* [Remove pre-iOS 10 handling for voiceover now that components support iOS 10+](https://github.com/material-components/material-components-ios/commit/6e127557ebe8d85faab9c4e1420343fad983fca6) (Alyssa Weiss)
* [Remove unused StringsConstant file from Tabs](https://github.com/material-components/material-components-ios/commit/ef4dc34cad6855f43dc39b8e432761d9259516c7) (Alyssa Weiss)

### TextControls

* [Refactor sizing behavior + expose sizing delegate method](https://github.com/material-components/material-components-ios/commit/58ae5f81390b44bd675a0694caaf4e385a6e39a1) (Andrew Overton)
* [Add `containerRadius` to MDCBaseTextField](https://github.com/material-components/material-components-ios/commit/d303da4db4c820f39ea5c69a29785aa43bb084a8) (Andrew Overton)
* [Add containerRadius to filled style object and base text area](https://github.com/material-components/material-components-ios/commit/3aace45a832e030d2e7812e310ffb4488e0bf77b) (Andrew Overton)

---

# 115.0.0

In this major release, we deprecated the Ink component in favor of Ripple and deleted the
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 = "115.1.0"
mdc.version = "115.0.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 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 = "115.1.0"
s.version = "115.0.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 = "115.1.0"
s.version = "115.0.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 = "115.1.0"
s.version = "115.0.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 @@
115.1.0
115.0.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>115.1.0</string>
<string>115.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>115.1.0</string>
<string>115.0.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>115.1.0</string>
<string>115.0.0</string>
<key>CFBundleVersion</key>
<string>115.1.0</string>
<string>115.0.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 = "115.1.0"
s.version = "115.0.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
2 changes: 1 addition & 1 deletion components/LibraryInfo/src/MDCLibraryInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// This string is updated automatically as a part of the release process and should not be edited
// manually. Do not rename this constant or change the formatting without updating the release
// scripts.
static NSString* const kMDCLibraryInfoVersionString = @"115.1.0";
static NSString* const kMDCLibraryInfoVersionString = @"115.0.0";

@implementation MDCLibraryInfo

Expand Down
2 changes: 1 addition & 1 deletion components/LibraryInfo/tests/unit/LibraryInfoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ - (void)testVersionFormat {
// Given

// This regex pattern does the following:
// Accept: "115.1.0", etc.
// Accept: "115.0.0", etc.
// Reject: "0.0.0", "1.2", "1", "-1.2.3", "Hi, I'm a version 1.2.3", "1.2.3 is my version", etc.
//
// Note the major version must be >= 1 since "0.0.0" is used as the version when something goes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#import <Foundation/Foundation.h>

#import "MaterialTextControls+BaseTextFields.h"
#import "MaterialTextControlsPrivate+FilledStyle.h"
#import "MaterialTextControlsPrivate+Shared.h"

Expand Down Expand Up @@ -50,6 +51,14 @@ - (void)commonMDCFilledTextFieldInit {
self.containerStyle = [[MDCTextControlStyleFilled alloc] init];
}

- (void)setContainerRadius:(CGFloat)containerRadius {
self.filledStyle.topCornerRadius = containerRadius;
}

- (CGFloat)containerRadius {
return self.filledStyle.topCornerRadius;
}

#pragma mark Stateful Color APIs

- (void)setFilledBackgroundColor:(nonnull UIColor *)filledBackgroundColor
Expand Down
2 changes: 1 addition & 1 deletion demos/supplemental/RemoteImageServiceForMDCDemos.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RemoteImageServiceForMDCDemos"
s.version = "115.1.0"
s.version = "115.0.0"
s.summary = "A helper image class for the MDC demos."
s.description = "This spec is made for use in the MDC demos. It gets images via url."
s.homepage = "https://github.com/material-components/material-components-ios"
Expand Down

0 comments on commit 0907c19

Please sign in to comment.