Skip to content

Releases: material-components/material-components-ios

v71.0.0

07 Dec 15:13
Compare
Choose a tag to compare

71.0.0

In this release we fixed some NavigationDrawer/BottomDrawer bugs and started using the theming extensions. This includes using categories on the components and a global container scheme.

Breaking changes

  • MDCColorScheming has added the copy attribute to its properties.
  • MDCTypographyScheming has added the copy attribute to its properties.
  • MDCFloatingButtonThemer changes its mapping to use a title color #5912

New features

Button theming

    textButton.applyTextTheme(withScheme: MDCContainerScheme())

ButtonBar theming

  var scheme: MDCContainerScheming {
    let scheme = MDCContainerScheme()
    scheme.colorScheme = colorScheme
    scheme.typographyScheme = typographyScheme
    return scheme
  }
  ...
  buttonBar.applyPrimaryTheme(withScheme: scheme)

Dialogs usage example

  NSString *titleString = @"Reset Settings?";
  NSString *messageString = @"This will reset your device to its default factory settings.";

  MDCAlertController *alert = [MDCAlertController alertControllerWithTitle:titleString
                                                                   message:messageString];
  alert.mdc_adjustsFontForContentSizeCategory = YES;

  MDCActionHandler handler = ^(MDCAlertAction *action) {
    NSLog(@"action pressed: %@", action.title);
  };

  MDCAlertAction *agreeAaction = [MDCAlertAction actionWithTitle:@"Cancel"
                                                        emphasis:MDCActionEmphasisLow
                                                         handler:handler];
  [alert addAction:agreeAaction];

  MDCAlertAction *disagreeAaction = [MDCAlertAction actionWithTitle:@"Accept"
                                                           emphasis:MDCActionEmphasisLow
                                                            handler:handler];
  [alert addAction:disagreeAaction];
  [MDCAlertControllerThemer applyScheme:self.alertScheme toAlertController:alert];

  [self presentViewController:alert animated:YES completion:NULL];

Component changes

Buttons

MDCFloatingButtonThemer changes its mapping to use a title color #5912

Banner

An MVP view with layout was added to examples.

Container scheme

We have created a global container scheme to hold all subsystems schemes. We have started to move our theming APIs into class extensions/catgories. These are the components that have landed some of these changes:

  • ButtonBar
  • Button

Changes

ActionSheet

ActivityIndicator

AnimationTiming

ButtonBar

Buttons

Cards

Dialogs

NavigationDrawer

Snackbar

schemes/Color

schemes/Typography

Multi-component changes

v70.1.0

29 Nov 18:55
Compare
Choose a tag to compare

This minor release introduces a new Alpha ContainerScheme type and several bug fixes.

New features

A new ContainerScheme type has been introduced that can be used to represent the complete collection
of Material Theming subsystem schemes. This new scheme type is an Alpha component at this point in
time and is not yet intended for general use.

API changes

ContainerScheme

New component.

Component changes

Changes

ActionSheet

Cards

Dialogs

NavigationDrawer

schemes/Container

v70.0.0

21 Nov 21:11
Compare
Choose a tag to compare

This major change removes all property coding behavior from our components. It also includes
performance improvements for NavigationDrawer and a new API for adjusting its content offset.
PageControl now also supports RTL.

Breaking changes

Component properties are no longer encoded or decoded for any component.

New features

Improvements made to Navigation Drawer:

  1. Improvements to the Navigation Drawer's performance by removing unneeded calls to the
    contentViewController's preferredContentSize.
  2. A new API on MDCBottomDrawerViewController: setContentOffsetY:contentOffsetY:animated:
    allowing to manually scroll the content to the desired offset. Setting the contentOffsetY to 0
    will scroll the drawer to the top of the content.

MDCPageControl has a new respectsUserInterfaceLayoutDirection property that, when enabled, causes
the page control to react to RTL layout.

API changes

Buttons

MDCFloatingButton

removed method: -initWithCoder: in MDCFloatingButton

Collections

MDCCollectionViewEditing

new method: -updateReorderCellPosition in MDCCollectionViewEditing

NavigationDrawer

MDCBottomDrawerViewController

new method: -setContentOffsetY:animated: in MDCBottomDrawerViewController

MDCBottomDrawerPresentationController

new property: contentReachesFullscreen in MDCBottomDrawerPresentationController

new method: -setContentOffsetY:animated: in MDCBottomDrawerPresentationController

PageControl

MDCPageControl

new property: respectsUserInterfaceLayoutDirection in MDCPageControl

Slider

MDCSlider

modified class: MDCSlider

Type of change: Swift declaration
From: class MDCSlider : UIControl, NSSecureCoding
To: class MDCSlider : UIControl

modified class: MDCSlider

Type of change: Declaration
From: @interface MDCSlider : UIControl <NSSecureCoding>
To: @interface MDCSlider : UIControl

ColorScheme

MDCTonalPalette

removed method: -initWithCoder: in MDCTonalPalette

modified class: MDCTonalPalette

Type of change: Swift declaration
From: class MDCTonalPalette : NSObject, NSCopying, NSSecureCoding
To: class MDCTonalPalette : NSObject, NSCopying

modified class: MDCTonalPalette

Type of change: Declaration
From: @interface MDCTonalPalette : NSObject <NSCopying, NSSecureCoding>
To: @interface MDCTonalPalette : NSObject <NSCopying>

Component changes

Breaking changes

Buttons

Multi-component breaking changes

Changes

BottomNavigation

BottomSheet

Collections

Dialogs

NavigationDrawer

PageControl

Tabs

Multi-component changes

v69.0.0

19 Nov 17:49
Compare
Choose a tag to compare

This major release introduces a breaking change with Snackbar's default style. It also includes
a new top handle and performance improvements for NavigationDrawer.

Breaking changes

usesLegacySnackbar is now NO by default.

New features

MDCBottomNavigationBar has a new elevation property.

NavigationDrawer has the following changes:

  1. Added support for content in the drawer that is dynamically sized. Updating the
    preferredContentSize at any time will cause the drawer to respond appropriately.
  2. Added a top handle that sits at the top of the drawer to show scrollability. It disappears
    when the drawer goes to full screen or when there is no more to scroll.
  3. Added a way to customize the color of the top handle.
  4. The drawer's header height expands as it goes to full screen to cover the safe area and status
    bar. We now provide a delegate to allow clients to be aware of the relevant top content inset so
    they lay out their header content appropriately based on height changes.
  5. Implemented performance improvements by removing some calls to preferredContentSize of the
    contentViewController within the drawer implementation.

API changes

AppBar+ColorThemer

MDCAppBarColorThemer(ToBeDeprecated)

modified class method: +applySurfaceVariantWithColorScheme:toAppBar: in MDCAppBarColorThemer(ToBeDeprecated)

modified class method: +applySemanticColorScheme:toAppBar: in MDCAppBarColorThemer(ToBeDeprecated)

AppBar+TypographyThemer

MDCAppBarTypographyThemer(ToBeDeprecated)

modified class method: +applyTypographyScheme:toAppBar: in MDCAppBarTypographyThemer(ToBeDeprecated)

BottomNavigation

MDCBottomNavigationBar

new property: elevation in MDCBottomNavigationBar

NavigationDrawer

MDCBottomDrawerViewControllerDelegate

new protocol: MDCBottomDrawerViewControllerDelegate

new method: -bottomDrawerControllerDidChangeTopInset:topInset: in MDCBottomDrawerViewControllerDelegate

MDCBottomDrawerPresentationController

new property: topHandleHidden in MDCBottomDrawerPresentationController

new property: topHandleColor in MDCBottomDrawerPresentationController

MDCBottomDrawerViewController

new property: topHandleColor in MDCBottomDrawerViewController

new property: delegate in MDCBottomDrawerViewController

new property: topHandleHidden in MDCBottomDrawerViewController

Component changes

ActionSheet

AppBar

BottomNavigation

NavigationDrawer

Snackbar

Multi-component changes

v68.2.0

07 Nov 21:25
Compare
Choose a tag to compare

In this minor release we have introduced an API for customizing the Navigation Drawer scrim color, an API for animating corner radius changes for MDCShadowLayer, an MDCSnackbarManager instance color themer, along with bug fixes and performance improvements.

New features

Navigation Drawer now supports customizing its scrim color as follows:

let bottomDrawerViewController = MDCBottomDrawerViewController()
// Set the drawer scrim color.
bottomDrawerViewController.scrimColor = UIColor.blue.withAlphaComponent(0.5)

bottomDrawerViewController.contentViewController = contentViewController
bottomDrawerViewController.headerViewController = headerViewController
MDCBottomDrawerColorThemer.applySemanticColorScheme(colorScheme,
                                                    toBottomDrawer: bottomDrawerViewController)
present(bottomDrawerViewController, animated: true, completion: nil)

MDCShadowLayer now supports animating corner radius changes:

@interface CustomView : UIView
@end

@implementation CustomView
+ (Class)layerClass {
  return [MDCShadowLayer class];
}

- (MDCShadowLayer *)shadowLayer {
  return (MDCShadowLayer *)self.layer;
}
 @end

CAMediaTimingFunction *timingFunction =
    [CAMediaTimingFunction mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut];
[self.customView.shadowLayer animateCornerRadius:(CGFloat)25.0
                              withTimingFunction:timingFunction
                                        duration:(CGFloat)2.5];

MDCSnackbarManager instances can now be themed using a color scheme:

MDCSnackbarManager *snackbarManager = [[MDCSnackbarManager alloc] init];
MDCSemanticColorScheme *colorScheme = [[MDCSemanticColorScheme alloc] init];
[MDCSnackbarColorThemer applySemanticColorScheme:colorScheme toSnackbarManager:snackbarManager];

API changes

NavigationDrawer

MDCBottomDrawerViewController

new property: scrimColor in MDCBottomDrawerViewController

MDCBottomDrawerPresentationController

new property: scrimColor in MDCBottomDrawerPresentationController

ShadowLayer

MDCShadowLayer

new method: -animateCornerRadius:withTimingFunction:duration: in MDCShadowLayer

Snackbar+ColorThemer

MDCSnackbarColorThemer

new class method: +applySemanticColorScheme:toSnackbarManager: in MDCSnackbarColorThemer

Component changes

AnimationTiming

BottomAppBar

BottomNavigation

FlexibleHeader

NavigationDrawer

ShadowElevations

ShadowLayer

Snackbar

Typography

v68.1.0

31 Oct 14:48
Compare
Choose a tag to compare

In this minor release we have added a top corners API and a state system for Navigation Drawer along with bug fixes and additional examples.

New features

By using Navigation Drawer's MDCBottomDrawerViewController, you can now set the top corners radius of your drawer for each of its
different presentation states MDCBottomDrawerState.

let bottomDrawerViewController = MDCBottomDrawerViewController()
// Set the drawer top corners for the drawer states.
bottomDrawerViewController.setTopCornersRadius(24, for: .collapsed)
bottomDrawerViewController.setTopCornersRadius(8, for: .expanded)

bottomDrawerViewController.contentViewController = contentViewController
bottomDrawerViewController.headerViewController = headerViewController
MDCBottomDrawerColorThemer.applySemanticColorScheme(colorScheme,
                                                    toBottomDrawer: bottomDrawerViewController)
present(bottomDrawerViewController, animated: true, completion: nil)

API changes

NavigationDrawer

MDCBottomDrawerViewController

new method: -topCornersRadiusForDrawerState: in MDCBottomDrawerViewController

new method: -setTopCornersRadius:forDrawerState: in MDCBottomDrawerViewController

new property: drawerState in MDCBottomDrawerViewController

modified class: MDCBottomDrawerViewController

Type of change: Swift declaration
From: class MDCBottomDrawerViewController : UIViewController
To: class MDCBottomDrawerViewController : UIViewController, MDCBottomDrawerPresentationControllerDelegate

modified class: MDCBottomDrawerViewController

Type of change: Declaration
From: @interface MDCBottomDrawerViewController : UIViewController
To: @interface MDCBottomDrawerViewController : UIViewController <MDCBottomDrawerPresentationControllerDelegate>

MDCBottomDrawerState

new enum: MDCBottomDrawerState

new enum value: MDCBottomDrawerStateExpanded in MDCBottomDrawerState

new enum value: MDCBottomDrawerStateCollapsed in MDCBottomDrawerState

new typedef: MDCBottomDrawerState

new enum value: MDCBottomDrawerStateFullScreen in MDCBottomDrawerState

MDCBottomDrawerPresentationController

new property: delegate in MDCBottomDrawerPresentationController

MDCBottomDrawerPresentationControllerDelegate

new method: -bottomDrawerWillChangeState:drawerState: in MDCBottomDrawerPresentationControllerDelegate

new method: -bottomDrawerTopTransitionRatio:transitionRatio: in MDCBottomDrawerPresentationControllerDelegate

new protocol: MDCBottomDrawerPresentationControllerDelegate

Component changes

ActionSheet

AppBar

List

NavigationDrawer

Snackbar

schemes/Color

schemes/Typography

v68.0.0

24 Oct 20:17
Compare
Choose a tag to compare

This major release includes a breaking change in behavior for Bottom Sheet's shapes themer, a
variety of bug fixes, a new color themer for NavigationDrawer, and documentation for the Shape
theming system.

Breaking changes

Bottom Sheet's shape themer behavior has changed:

Bottom Sheet now maps the top 2 corners to the Large Component Shape category when the sheet isn't
in a full screen state. When the sheet is in full screen, we do not map it or shape it at all.

New features

NavigationDrawer now has a color themer.

Sliders now respect exclusive touches.

API changes

NavigationDrawer+ColorThemer

New extension.

Component changes

AppBar

BottomSheet

Buttons

Cards

Chips

Collections

Dialogs

List

NavigationDrawer

Slider

schemes/Shape

v67.2.0

23 Oct 14:58
Compare
Choose a tag to compare

This minor release introduces new functionality for theming individual buttons of an
MDCAlertController.

New features

It is now possible to theme MDCAlertController buttons individually using the new emphasis
property on MDCAlertAction in conjunction with the MDCAlertControllerThemer.

let alert = MDCAlertController(title: "Button Theming", message: "High, Medium & Low Emphasis")

alert.addAction(MDCAlertAction(title:"High", emphasis: .high, handler: <#handler#>))
alert.addAction(MDCAlertAction(title:"Medium", emphasis: .medium, handler: <#handler#>))
alert.addAction(MDCAlertAction(title:"Low", emphasis: .low, handler: <#handler#>))

MDCAlertControllerThemer.applyScheme(<#alertScheme#>, to: alert)

self.present(alert, animated: true, completion: nil)

API changes

Dialogs+DialogThemer

MDCAlertScheming

new property: buttonScheme in MDCAlertScheming

MDCAlertScheme

new property: buttonScheme in MDCAlertScheme

Dialogs

MDCAlertController

modified property: elevation in MDCAlertController

Type of change: Swift declaration
From: var elevation: CGFloat { get set }
To: var elevation: Int32 { get set }

modified property: elevation in MDCAlertController

Type of change: Declaration
From: @property (assign, readwrite, nonatomic) CGFloat elevation;
To: @property (assign, readwrite, nonatomic) int elevation;

MDCActionEmphasis

new enum: MDCActionEmphasis

new enum value: MDCActionEmphasisLow in MDCActionEmphasis

new enum value: MDCActionEmphasisMedium in MDCActionEmphasis

new enum value: MDCActionEmphasisHigh in MDCActionEmphasis

MDCDialogPresentationController

modified property: dialogElevation in MDCDialogPresentationController

Type of change: Swift declaration
From: var dialogElevation: CGFloat { get set }
To: var dialogElevation: Int32 { get set }

modified property: dialogElevation in MDCDialogPresentationController

Type of change: Declaration
From: @property (assign, readwrite, nonatomic) CGFloat dialogElevation;
To: @property (assign, readwrite, nonatomic) int dialogElevation;

MDCAlertAction

new property: emphasis in MDCAlertAction

new class method: +actionWithTitle:emphasis:handler: in MDCAlertAction

Component changes

Dialogs

v67.1.0

17 Oct 16:30
Compare
Choose a tag to compare

In this minor release we provide a shadow opacity reset toggle for Flexible Header, VoiceOver and rounded corners support for the Navigation Drawer, along with bug fixes and unit tests improvements.

New features

Flexible Header

  • Flexible Header supports resetting the visible shadow opacity to 0 when setting trackingScrollView to nil by setting the BOOL property resetShadowAfterTrackingScrollViewIsReset.

Navigation Drawer

  • When VoiceOver or Switch Control is turned on in your app, Navigation Drawer will always show up in full screen.

  • Navigation Drawer has rounded corners when there is more scrollable content to scroll in the drawer.

Component changes

ActionSheet

ActivityIndicator

AppBar

BottomAppBar

BottomSheet

Buttons

Cards

Chips

CollectionCells

CollectionLayoutAttributes

Dialogs

FeatureHighlight

FlexibleHeader

List

MaskedTransition

NavigationBar

NavigationDrawer

ProgressView

ShadowLayer

Snackbar

Tabs

TextFields

v67.0.0

11 Oct 18:58
Compare
Choose a tag to compare

There are some rendering changes that have lead to classifying this as a major release. There are no major API changes.

We've added some new theming capabilities for Action Sheets and Lists.

API changes

ActionSheet+ActionSheetThemer

New extension.

List+ColorThemer

New extension.

List+ListThemer

New extension.

Component changes

ActionSheet

AppBar

BottomAppBar

BottomNavigation

ButtonBar

Buttons

Chips

Dialogs

List

NavigationDrawer

TextFields