This bug was caused by an attempt to maintain backward compatibility with the legacy behavior of setting badgeColor, which treated nil as clearColor. This logic was causing the default badge color (which is red) to always override the appearance background color.
This change simply removes that override logic, because there shouldn't be a case where a badge's background color is set to transparent because doing so would negatively affect legibility of the badge.
PiperOrigin-RevId: 466780235
This change consists of two related portions:
1. Extraction of badge and dot badge appearance-related APIs into corresponding Appearance objects and updating the MDC examples to reflect this new API format.
2. Updated bottom navigation to make use of the new appearance APIs.
Also added an example of using the appearance's "system tint" default behavior for nil, which is aligned with how UIKit handles similar APIs.
PiperOrigin-RevId: 417902876
This is a verbatim copy. The only thing that has changed is the class name.
Also added a typical use basic example, which required implementing intrinsicContentSize.
PiperOrigin-RevId: 416131346
The properties' declarations, documentation, and organizational structure now mirrors the underlying badge view that houses the data.
PiperOrigin-RevId: 415342823
Now that BottomNavigation restricts subclassing, this removes any need for the badge storage to be kept as a property and allows us to drop unnecessary method implementations, further reducing binary footprint.
PiperOrigin-RevId: 415331970
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
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