Material Components v81.0.0 Release Notes
-
๐ This major release introduces the Ripple component and integrates it with Cards. There are also ๐ visual changes for badges on Tabs, multi-line title support for Bottom Navigation, and improved ๐ Dynamic Type support for Buttons and Feature Highlight.
๐ฅ Breaking changes
The appearance of badges on MDCTabBar has changed. Badges now appear similar to those on 0๏ธโฃ MDCBottomNavigationBar and are, by default, a red "pill" shape with white text. The color can be customized by assigning a value to
- UITabBarItem.badgeColor
.๐ New features
Ripple integration with Cards
โ Cards now support the latest iteration of the Material Design "ripple" effect. Clients can test this functionality by setting
enableRippleBehavior
toYES
.Swift
myCard.enableRippleBehavior = true
Objective-C
self.myCard.enableRippleBehavior = YES;
๐ Multi-line title support in Bottom Navigation
๐ Clients can enable multi-line title support in MDCBottomNavigationBar by setting
titlesNumberOfLines
to a value other than 1. This API should be used only as a last resort, when it is not possible to provide shorter titles that fit within the available screen space.Swift
bottomNavigationBar.titlesNumberOfLines = 0
Objective-C
self.bottomNavigationBar.titlesNumberOfLines = 0;
Automatic Dynamic Type font adjustment in Feature Highlight and Buttons
๐ Buttons and Feature Highlight now support enabling automatic font size adjustment for Dynamic Type when the fonts used by the components have scaling curves attached using MDCFontScaler. Both components use the new scaling if
mdc_adjustsFontForContentSizeCategory
is set toYES
.Swift
// The new TypographyScheme defaults provide scaled fonts containerScheme.typographyScheme = MDCTypographyScheme.init(defaults: .material201902) let button = MDCButton() button.applyContainedTheme(withScheme: containerScheme) button.setTitle("Submit", for: UIControlState()) // Enable automatic font adjustment button.mdc_adjustsFontForContentSizeCategory = true
Objective-C
// The new TypographyScheme defaults provide scaled fonts self.containerScheme.typographyScheme = [[MDCTypographyScheme alloc] initWithDefaults: MDCTypographySchemeDefaultsMaterial201804]; MDCButton *button = [[MDCButton alloc] init]; [button applyContainedThemeWithScheme:self.containerScheme]; [button setTitle:@"Submit" forState:UIControlStateNormal]; // Enable automatic font adjustment button.mdc_adjustsFontForContentSizeCategory = YES;
API changes
Banner
MDCBannerView
๐ new property:
textLabel
inMDCBannerView
๐ new property:
imageView
inMDCBannerView
๐ new property:
leadingButton
inMDCBannerView
๐ new property:
trailingButton
inMDCBannerView
โ removed property:
buttons
inMDCBannerView
โ removed property:
text
inMDCBannerView
โ removed property:
image
inMDCBannerView
โ removed property:
numberOfButtons
inMDCBannerView
modified class:
MDCBannerView
Type of change: Declaration From: @interface MDCBannerView : UIView @property(nonatomic, copy, nonnull) NSString *text; @property(nonatomic, strong, nullable) UIImage *image; // default is nil @property(nonatomic, assign) NSUInteger numberOfButtons; // default is 1 /** The buttons representing the banner's actions. */ @property(nonatomic, readonly, copy, nonnull) NSArray<MDCButton *> *buttons; @end
๐ง To: BottomNavigation
MDCBottomNavigationBar
๐ new property:
titlesNumberOfLines
inMDCBottomNavigationBar
Buttons
MDCButton
๐ new property:
mdc_legacyFontScaling
inMDCButton
Cards
MDCCardCollectionCell
๐ new property:
rippleView
inMDCCardCollectionCell
๐ new property:
dragged
inMDCCardCollectionCell
๐ new property:
enableRippleBehavior
inMDCCardCollectionCell
modified class:
MDCCardCollectionCell
Type of change: Declaration 0๏ธโฃ From: 0๏ธโฃ To: MDCCard
๐ new property:
rippleView
inMDCCard
๐ new property:
enableRippleBehavior
inMDCCard
modified class:
MDCCard
Type of change: Declaration 0๏ธโฃ From: 0๏ธโฃ To: ๐ FeatureHighlight
MDCFeatureHighlightView
๐ new property:
mdc_legacyFontScaling
inMDCFeatureHighlightView
modified class:
MDCFeatureHighlightView
Type of change: Declaration ๐ป From: ๐ป To: MDCFeatureHighlightViewController
๐ new property:
mdc_legacyFontScaling
inMDCFeatureHighlightViewController
Ripple
MDCRippleTouchController
๐ new method:
-addRippleToView:
inMDCRippleTouchController
modified method:
-init
inMDCRippleTouchController
Type of change: key.always_unavailable From: 1
To: 0
MDCRippleTouchControllerDelegate
๐ new method:
-rippleTouchController:insertRippleView:intoView:
inMDCRippleTouchControllerDelegate
Component changes
๐ Changes
AppBar
BottomNavigation
- ๐ Add multi-line title support. (#6999) (Robert Moore)
- Extract common Snapshot consts. (#7004) (Robert Moore)
- โ Split snapshot tests. (#6997) (Robert Moore)
Buttons
- Don't make Buttons example launch screen. (#7016) (Robert Moore)
- New Dynamic Type curves (#7003) (ianegordon)
๐ FeatureHighlight
- New Dynamic Type curves (#6947) (ianegordon)
Ripple
- โ Added additional unit and snapshot tests (#6992) (Yarden Eitan)
- ๐ Additional documentation for Ripple and its classes (#6996) (Yarden Eitan)
- Adds additional API of adding the Ripple to a view and its position in the view hierarchy. (#6983) (Yarden Eitan)
- Graduate Ripple to Ready. (#7000) (Yarden Eitan)
Tabs
- Add Badge view (#6980) (Robert Moore)
- โ Add badge snapshot tests. (#6978) (Robert Moore)
- โ Add badgeColor snapshot tests (#6990) (Robert Moore)