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 26, 2020
2 parents c90e40e + 4464b9a commit 87351aa
Show file tree
Hide file tree
Showing 39 changed files with 464 additions and 82 deletions.
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
# 109.5.0

This minor release adds functionality to MDCSnackbarManagerDelegate and includes internal cleanup of FlexibleHeader.

## New features

### Snackbar

MDCSnackbarManagerDelegate has new `snackbarWillDisappear` and `isPresentingSnackbarWithMessageView:` methods.

## Component changes

### AppBar

* [Fix a failing snapshot test](https://github.com/material-components/material-components-ios/commit/09171d15c71e762844bf697f7f9c3541a0179854) (Galia Kaufman)

### Buttons

* [Fix theme being applied to a wrong floating button in the example snapshot.](https://github.com/material-components/material-components-ios/commit/dfd5109f15627b8c159aa77dd8e8e5652146be37) (Wenyu Zhang)

### Chips

* [Adjust hitAreaInsets in the typical example.](https://github.com/material-components/material-components-ios/commit/1992bbdd21a009c345a253a9aa7816bae8841961) (Wenyu Zhang)

### Dialogs

* [Add additional theming screenshot to Dialogs docs](https://github.com/material-components/material-components-ios/commit/112ea0d0894a769dba4384325d04d09ba26362af) (Andrew Overton)

### FlexibleHeader

* [Extract hidesStatusBarWhenShiftedOffscreen to the shifter.](https://github.com/material-components/material-components-ios/commit/9fde103ea50df2f85c3dfc0650fa70a285989cfb) (Jeff Verkoeyen)
* [Move ShiftBehaviorForCurrentAppContext into the MDCFlexibleHeaderShifter.](https://github.com/material-components/material-components-ios/commit/3fc4f0cb472ef91e4761076f5f6444d6bb99aac0) (Jeff Verkoeyen)
* [Move the shift behavior types to separate targets.](https://github.com/material-components/material-components-ios/commit/643170dea99036cac1680faa7045ee4a4ee1aac9) (Jeff Verkoeyen)
* [Turn MDCFlexibleHeaderShiftBehavior into an extensible enum.](https://github.com/material-components/material-components-ios/commit/5b8abd6659b5c2ea71c18cb4ea8c6d04310f19ec) (Jeff Verkoeyen)

### NavigationDrawer

* [Add NavigationDrawer theming target to podspec](https://github.com/material-components/material-components-ios/commit/755a10e3be1344ba1ccb8671a7d8679cb278909a) (Andrew Overton)

### Snackbar

* [Add snackbarIsPresenting to MDCSnackbarManagerDelegate.](https://github.com/material-components/material-components-ios/commit/0fcf353c3abde1b300e5aee8a0c9ca256bbd0212) (Morgan Redding)
* [Add snackbarWillDisappear to SnackbarManagerDelegate](https://github.com/material-components/material-components-ios/commit/c8b569bd60f0702f21b32fe55112e458f0db3a67) (Morgan Redding)

## Multi-component changes

* [Internal change.](https://github.com/material-components/material-components-ios/commit/4d76e54f83e1d55910e1ec599668df6a18502c7c) (Wenyu Zhang)
* [Internal change](https://github.com/material-components/material-components-ios/commit/9c26a7e67aa298a57e5a78e22d7fbe5abc6fe34f) (Bryan Oltman)
* [Internal change](https://github.com/material-components/material-components-ios/commit/b5aa93e81cba6ab5670eb4096bb7c640d02585da) (Jeff Verkoeyen)

---

# 109.4.0

This minor release adds Theming extension support to MDCBottomDrawerViewController and includes bug fixes and minor refactoring.
Expand Down
36 changes: 35 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 = "109.4.0"
mdc.version = "109.5.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 @@ -905,6 +905,8 @@ Pod::Spec.new do |mdc|
component.dependency 'MDFTextAccessibility'
component.dependency "MaterialComponents/Availability"
component.dependency "MaterialComponents/Elevation"
component.dependency "MaterialComponents/FlexibleHeader+ShiftBehavior"
component.dependency "MaterialComponents/FlexibleHeader+ShiftBehaviorEnabledWithStatusBar"
component.dependency "MaterialComponents/ShadowElevations"
component.dependency "MaterialComponents/ShadowLayer"
component.dependency "MaterialComponents/private/Application"
Expand All @@ -921,6 +923,28 @@ Pod::Spec.new do |mdc|
end
end

mdc.subspec "FlexibleHeader+ShiftBehavior" do |extension|
extension.ios.deployment_target = '9.0'
extension.public_header_files = [
"components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.h"
]
extension.source_files = [
"components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.{h,m}"
]
end

mdc.subspec "FlexibleHeader+ShiftBehaviorEnabledWithStatusBar" do |extension|
extension.ios.deployment_target = '9.0'
extension.public_header_files = [
"components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.h"
]
extension.source_files = [
"components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.{h,m}"
]

extension.dependency "MaterialComponents/FlexibleHeader+ShiftBehavior"
end

mdc.subspec "FlexibleHeader+CanAlwaysExpandToMaximumHeight" do |extension|
extension.ios.deployment_target = '9.0'
extension.public_header_files = [
Expand Down Expand Up @@ -1144,6 +1168,16 @@ Pod::Spec.new do |mdc|
extension.dependency "MaterialComponents/schemes/Color"
end

mdc.subspec "NavigationDrawer+Theming" do |extension|
extension.ios.deployment_target = '9.0'
extension.public_header_files = "components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.h"
extension.source_files = [
"components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.{h,m}",
]
extension.dependency "MaterialComponents/#{extension.base_name.split('+')[0]}"
extension.dependency "MaterialComponents/schemes/Container"
end

# OverlayWindow

mdc.subspec "OverlayWindow" do |component|
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.4.0"
mdc.version = "109.5.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.4.0"
s.version = "109.5.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.4.0"
s.version = "109.5.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.4.0"
s.version = "109.5.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.4.0
109.5.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.4.0</string>
<string>109.5.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>109.4.0</string>
<string>109.5.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.4.0</string>
<string>109.5.0</string>
<key>CFBundleVersion</key>
<string>109.4.0</string>
<string>109.5.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.4.0"
s.version = "109.5.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
5 changes: 5 additions & 0 deletions components/AppBar/examples/AppBarPresentedHiddenExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import "AppBarSampleViewController.h"
#import "MaterialAppBar.h"
#import "MaterialAppBar+Theming.h"
#import "MaterialAvailability.h"
#import "MaterialButtons.h"
#import "MaterialButtons+Theming.h"
#import "MaterialContainerScheme.h"
Expand Down Expand Up @@ -106,11 +107,15 @@ - (void)testPresentedFullScreen {
- (void)testPresentedAutomatic {
[self dismissViewControllerAnimated:NO completion:nil];

#if MDC_AVAILABLE_SDK_IOS(13_0)
if (@available(iOS 13, *)) {
[self presentDemoAnimated:NO modalPresentationStyle:UIModalPresentationAutomatic];
} else {
[self presentDemoAnimated:NO modalPresentationStyle:UIModalPresentationFullScreen];
}
#else
[self presentDemoAnimated:NO modalPresentationStyle:UIModalPresentationFullScreen];
#endif
}

@end
23 changes: 16 additions & 7 deletions components/Buttons/examples/FloatingButtonTypicalUseExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,19 @@ - (void)viewDidLoad {
[self.miniFloatingButton setMinimumSize:CGSizeMake(96, 40)
forShape:MDCFloatingButtonShapeMini
inMode:MDCFloatingButtonModeExpanded];
[self.miniFloatingButton applySecondaryThemeWithScheme:self.containerScheme];

self.defaultFloatingButton = [[MDCFloatingButton alloc] init];
[self.defaultFloatingButton setImage:plusImage forState:UIControlStateNormal];
self.defaultFloatingButton.accessibilityLabel = kButtonLabel;
[self.defaultFloatingButton applySecondaryThemeWithScheme:self.containerScheme];

self.largeIconFloatingButton = [[MDCFloatingButton alloc] init];
[self.largeIconFloatingButton setImage:plusImage36 forState:UIControlStateNormal];
self.largeIconFloatingButton.accessibilityLabel = kButtonLabel;
[self.largeIconFloatingButton setContentEdgeInsets:UIEdgeInsetsMake(-6, -6, -6, 0)
forShape:MDCFloatingButtonShapeDefault
inMode:MDCFloatingButtonModeExpanded];
[self.largeIconFloatingButton applySecondaryThemeWithScheme:self.containerScheme];

[self applyThemeToAllButtonsWithScheme:self.containerScheme];
[self.view addSubview:self.iPadLabel];
[self.view addSubview:self.miniFloatingButton];
[self.view addSubview:self.defaultFloatingButton];
Expand Down Expand Up @@ -182,6 +180,20 @@ - (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection
}
}

- (void)setContainerScheme:(id<MDCContainerScheming>)containerScheme {
_containerScheme = containerScheme;

if ([self isViewLoaded]) {
[self applyThemeToAllButtonsWithScheme:containerScheme];
}
}

- (void)applyThemeToAllButtonsWithScheme:(id<MDCContainerScheming>)containerScheme {
[self.miniFloatingButton applySecondaryThemeWithScheme:containerScheme];
[self.defaultFloatingButton applySecondaryThemeWithScheme:containerScheme];
[self.largeIconFloatingButton applySecondaryThemeWithScheme:containerScheme];
}

#pragma mark - Catalog by Convention

+ (NSDictionary *)catalogMetadata {
Expand All @@ -201,12 +213,9 @@ - (void)testDynamic201907ColorScheme {
MDCContainerScheme *containerScheme = [[MDCContainerScheme alloc] init];
containerScheme.colorScheme =
[[MDCSemanticColorScheme alloc] initWithDefaults:MDCColorSchemeDefaultsMaterial201907];
self.containerScheme = containerScheme;

// When
[self.miniFloatingButton applySecondaryThemeWithScheme:self.containerScheme];
[self.largeIconFloatingButton applySecondaryThemeWithScheme:self.containerScheme];
[self.largeIconFloatingButton applySecondaryThemeWithScheme:self.containerScheme];
self.containerScheme = containerScheme;
}

@end
1 change: 1 addition & 0 deletions components/Chips/examples/ChipsTypicalUseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
cell.chipView.imageView.image = model.showProfilePic ? ChipsExampleAssets.faceImage : nil;
cell.chipView.selectedImageView.image = model.showDoneImage ? ChipsExampleAssets.doneImage : nil;
cell.chipView.accessoryView = model.showDeleteButton ? ChipsExampleAssets.deleteButton : nil;
cell.chipView.hitAreaInsets = UIEdgeInsetsMake(-16, 0, -16, 0);

[cell.chipView applyThemeWithScheme:self.containerScheme];
return cell;
Expand Down
8 changes: 5 additions & 3 deletions components/Dialogs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ The following is an anatomy diagram of a Material dialog:
### Theming dialogs
You can theme a Material Dialog to match the Material Design Dialog using your app's scheme and the Dialogs theming
extension. To add the theming extension to your project add the following line to your Podfile:
![Dialogs with Shrine theming](docs/assets/shrine_dialog.png)
You can theme a Material Dialog using a container scheme and the Dialogs theming extension. To achieve something like the
Shrine theming above first add the Dialogs theming extension to your project by adding the following line to your Podfile:
```bash
pod 'MaterialComponents/Dialogs+Theming'
Expand Down Expand Up @@ -278,7 +280,7 @@ High, Medium and low emphasis are supported.
// Add actions with emphases that will generate buttons with the desired appearance.
// An example of a high and a medium emphasis actions:
alert.addAction(MDCAlertAction(title:"Add Item", emphasis: .high, handler: handler))
alert.addAction(MDCAlertAction(title:"Cancel", emphasis: .medium, handler: handler))
alert.addAction(MDCAlertAction(title:"Cancel", emphasis: .high, handler: handler))
// Make sure to apply theming after all actions are added, so they are themed too!
alert.applyTheme(withScheme: scheme)
Expand Down
Binary file added components/Dialogs/docs/assets/shrine_dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

#import <UIKit/UIKit.h>

#import "MaterialFlexibleHeader.h"
#import "MaterialFlexibleHeader+CanAlwaysExpandToMaximumHeight.h"
#import "MaterialFlexibleHeader.h"
#import "MaterialFlexibleHeader+ShiftBehaviorEnabledWithStatusBar.h"

#import "supplemental/FlexibleHeaderConfiguratorControlItem.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#import <UIKit/UIKit.h>

#import "MaterialFlexibleHeader.h"
#import "MaterialFlexibleHeader+ShiftBehaviorEnabledWithStatusBar.h"
#import "MaterialPalettes.h"

@interface FlexibleHeaderSafeAreaLayoutGuideExample
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#import <UIKit/UIKit.h>

#import "MaterialFlexibleHeader.h"
#import "MaterialFlexibleHeader+ShiftBehaviorEnabledWithStatusBar.h"
#import "MaterialPalettes.h"

@interface FlexibleHeaderTopLayoutGuideExample
Expand Down
44 changes: 14 additions & 30 deletions components/FlexibleHeader/src/MDCFlexibleHeaderView+ShiftBehavior.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,26 @@
// limitations under the License.

#import "MDCFlexibleHeaderView.h"
#import "MaterialFlexibleHeader+ShiftBehavior.h"
#import "MaterialFlexibleHeader+ShiftBehaviorEnabledWithStatusBar.h"

#pragma mark - Shift behavior-specific APIs

/**
The possible translation (shift) behaviors of a flexible header view.
Enabling shifting allows the header to enter the
@c MDCFlexibleHeaderScrollPhaseShifting scroll phase.
*/
typedef NS_ENUM(NSInteger, MDCFlexibleHeaderShiftBehavior) {

/** Header's y position never changes in reaction to scroll events. */
MDCFlexibleHeaderShiftBehaviorDisabled,
/** Header's y position never changes in reaction to scroll events. */
FOUNDATION_EXTERN const MDCFlexibleHeaderShiftBehavior MDCFlexibleHeaderShiftBehaviorDisabled;

/** When fully-collapsed, the header translates vertically in reaction to scroll events. */
MDCFlexibleHeaderShiftBehaviorEnabled,
/** When fully-collapsed, the header translates vertically in reaction to scroll events. */
FOUNDATION_EXTERN const MDCFlexibleHeaderShiftBehavior MDCFlexibleHeaderShiftBehaviorEnabled;

/**
When fully-collapsed, the header translates vertically in reaction to scroll events along with
the status bar.
If used with a vertically-paging scroll view, this behavior acts like
MDCFlexibleHeaderShiftBehaviorEnabled.
*/
MDCFlexibleHeaderShiftBehaviorEnabledWithStatusBar,

/**
Allows the header to be shifted on- and off-screen only via the @c shiftHeaderOnScreenAnimated:
and @c shiftHeaderOffScreenAnimated APIs. Scroll events will not affect the visibility of the
header.
/**
Allows the header to be shifted on- and off-screen only via the @c shiftHeaderOnScreenAnimated:
and @c shiftHeaderOffScreenAnimated APIs. Scroll events will not affect the visibility of the
header.
Analogous to UINavigationController's setNavigationBarHidden: behavior, in that the visibility of
the navigation bar persists regardless of the user's subsequent interactions.
*/
MDCFlexibleHeaderShiftBehaviorHideable,
};
Analogous to UINavigationController's setNavigationBarHidden: behavior, in that the visibility of
the navigation bar persists regardless of the user's subsequent interactions.
*/
FOUNDATION_EXTERN const MDCFlexibleHeaderShiftBehavior MDCFlexibleHeaderShiftBehaviorHideable;

/** The importance of content contained within the flexible header view. */
typedef NS_ENUM(NSInteger, MDCFlexibleHeaderContentImportance) {
Expand Down
Loading

0 comments on commit 87351aa

Please sign in to comment.