Skip to content

@yarneo yarneo released this Nov 7, 2018 · 2296 commits to stable since this release

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

Assets 2
You can’t perform that action at this time.