v113.1.0
In this minor release we have added a ScalableFontDescriptor library to represent custom scalable fonts from iOS 11 and up, added UILargeContentViewer support to AppBar, NavigationBar, TabBarView, as well as other improvements.
New deprecations
- We have deprecated some MDCSnackbarManager class methods. Please use MDCSnackbarManager.defaultManager and their corresponding instance methods instead.
New features
On iOS 11 and up, using ScalableFontDescriptor enables you to describe a custom font and the corresponding UIFontMetrics that enable the font to scale in response to Dynamic Type settings.
This type enables you to pair font descriptors with specific UIFontMetrics. This is most commonly used for describing the metrics of a collection of custom fonts.
// Create the type scale.
let fontDescriptor = UIFontDescriptor(name: "CustomFont-Light", size: UIFont.labelFontSize)
let scalableFontDescriptor: MDCScalableFontDescriptor
if #available(iOS 11, *) {
scalableFontDescriptor = MDCScalableFontDescriptor(
fontDescriptor: fontDescriptor,
fontMetrics: UIFontMetrics(forTextStyle: .largeTitle)
)
} else {
scalableFontDescriptor = MDCScalableFontDescriptor(fontDescriptor: fontDescriptor)
}
// Use the scalable font descriptor.
if #available(iOS 11, *) {
label.font = scalableFontDescriptor.preferredFont(compatibleWith: label.traitCollection)
label.adjustsFontForContentSizeCategory = true
} else {
label.font = scalableFontDescriptor.baseFont()
}
You can now toggle if you would like that your BottomDrawer will display at fullscreen or not when in mobile landscape by setting the shouldDisplayMobileLandscapeFullscreen
property on MDCBottomDrawerViewController
.
let controller = MDCBottomDrawerViewController()
controller.shouldDisplayMobileLandscapeFullscreen = false
Component changes
BottomAppBar
- Fix bug where FAB shadow would "bounce" when the position changed. (Jeff Verkoeyen)
BottomNavigation
ButtonBar
- Adds Large Content Viewer support to MDCButtonBar, MDCNavigationBar, and MDCAppBar. (Yarden Eitan)
- Fall back to accessibilityLabel for UILargeContentView when there is an image and no title. (Yarden Eitan)
- Removes nullability modifiers from file. (Nobody)
Chips
- Add a snapshot test case for MDCChipView with minimumSize set and centerVisible set to YES. (Wenyu Zhang)
NavigationDrawer
ScalableFontDescriptor
- Add a new ScalableFontDescriptor library. (Jeff Verkoeyen)
Snackbar
- Material Snackbar support for selecting which window to present on. (Nobody)
- Deprecate more class methods on MDCSnackbarManager. (Jeff Verkoeyen)
- Deprecate remaining class methods on MDCSnackbarManager. (Jeff Verkoeyen)
- Internal change (Jeff Verkoeyen)
Tabs
- Adds Large Content Viewer support to MDCTabBarView. (Yarden Eitan)
- Animate text and icon colors when switching tabs. (Jeff Verkoeyen)