We recommend using `initWithDefaults` and we should follow the recommendation. This change removes all usage of `init` within MDC components in order to let us remove that initializer from the public surface.
PiperOrigin-RevId: 302958447
Introduces support for `UILargeContentViewer` and its associated classes and protocols on iOS 13 and later.
* On iOS 13 and later, `MDCBottomNavigationBar` will present a large content view when the platform's requirements are met.
* Larger Text is enabled with an `Accessibility...` size selected.
* User long-presses on a Bar Item.
* On iOS 9-12, this behavior will remain associated with the `MDCBottomNavigationBarController` only, and the view will not have this behavior built-in.
Closes#8343
[BottomNavigation] Fix bug in delegate method call
The MDCBottomNavigationBarController checks the wrong delegate method before calling `-bottomNavigationBarController:shouldSelectViewController:`. This can lead to crashes in clients that do not implement this method, but implement `-bottomNavigationBarController:didSelectViewController:`.
Fixes#9483
NotoNastaliq is a font with a greater line height than most other fonts. Using
it for Arabic/RTL fonts results in greater exercise of the view's layout.
Part of #6552
Migrate `MDCBottomNavigationBarColorThemer` logic to theming extensions to prepare for the eventual deletion of `MDCBottomNavigationBarColorThemer`.
Part of #9130
Allows clients to set a custom badge background and text colors for all
badges. On iOS 10+, the `UITabBarItem badgeColor` API allows customizing
individual items' badge background colors as well. Setting the badge
background and text color will allow clients using badges on Bottom Navigation
to better-support Dark Mode.
Closes#2833
Enables clients to opt-in to state restoration by providing `restorationIdentifier` values for the Bottom Navigation controller's child view controllers.
Closes#8265
The UIButton subview of the Bottom Navigation bar should be the
one receiving the `accessibilityHint` value from the UITabBarItem. There's no
ill effect if the itemView also receives the hint, and preserving that
behavior is less likely to break clients.
In the long term, it's reasonable to remove the `accessibilityHint` from the
item view directly, since it's not an accessibility element and doesn't need
the hint to be set.
Closes#7290
Creates an explicit assignment of `UITabBarItem`'s `accessibilityIdentifier`
to the actual accessibility element of the item view.
The item views should not have accessibility identifiers because they are not
accessibility elements. Reusing the same identifier for both the button and
the view makes it harder to perform automated UI tests.
Closes#8137
Adds more Starlark marcro use and drops the need for `includes` in the private
headers target. Reusing these macros makes it easier for weekly releases.
Part of #8150
This test ensures that the `additionalSafeAreaInsets` property of child VCs is
correctly set to account for the bottom navigation bar.
Confirmation of #8112
For most of the `UITabBarItem` `NSString` properties, setting them to `nil` after assigning the item to the Bottom Navigation bar resulted in a raised exception that can crash an app. The KVO code is being updated to match the style in MDCButtonBar to make it safe for `nil` values.
Closes#8082
The `MDCBottomNavigationBarController` was incorrectly only adding its child
view controllers as "proper" child view controllers when they became the
selected view controller. This resulted in difficulties when attempting to
perform state restoration within apps with the controller as the root view
controller.
Closes#7984
This change adds a shadowColor API so that clients can customize the color of their shadow within bottom navigation. Unit test have been added for a custom shadow color and the default shadow color as well as iOS 13 test to make sure it responds to dynamic colors.
Closes#7882
Adds a theming extension to the bottom navigation component. This follows the guidelines outlined in the design doc.
Design doc: go/mdc-ios-theming-extensions.
Closes#7565
Flipping the default value of the flag to `NO` as part of the
migration/deprecation process. Internal clients were migrated
previously, but a few new instances might have appeared.
Part of #6716
## Release note
This should have no impact on the release. All client teams were migrated previously. Any breakage in the release could be mitigated by:
```
self.bottomNavigationBar.sizeThatFitsIncludesSafeArea = YES;
```
Unit tests for some accessibility value strings were not logging the values
during failures. Using the recommended XCTest APIs provides automatic logging
and is preferable to manual equality checking.
Fixes#7325
Adds a view for displaying a large icon and title when the user has dynamic type enabled.
This is part of a larger effort to add dynamic type support to `MDCBottomNavigationBarController`.
Closes#7122
Improving snapshot tests cases by using the newly-available test icons. The
helps verify the order of items under RTL and to help distinguish the
different items.
Adding multiple test image styles so snapshot tests can use different
image patterns rather than image sizes to determine if a rendered image
has changed.
Separating snapshot tests focused on the `alignment` property into their
own class. This improves the reusability of `setUp` and makes the tests
easier to read.
Also separates two Test Fakes - a `UITraitCollection` and `MDCBottomNavigationBar` - into the `supplemental` directory for use across both files.
No tests were added or removed, only moved and renamed. All snapshot images were simply renamed for the new class and test methods.
Part of #6844
When the `selectedImage` or `image` values were changed on
MDCBottomNavigationItemView, it was accidentally updating the view's
UIImageView regardless of its current selection state. By checking the
current state and only updating as-needed, changes to the icons don't
show up incorrectly.
Fixes#6846