null_resettable is imported to Swift as an optional type, which requires awkward nil checks when working with the appearance properties, even though the return value is guaranteed to be non-nil.
Instead, appearance properties are now all specified as nonnull. This allows Swift source to use the appearance APIs in a much simpler fashion.
To achieve the same "null_resettable" behavior as before, simply assign an empty instance of an appearance object.
PiperOrigin-RevId: 418678212
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 was added as a separate API in order to avoid a duality of behavior in MDCBadgeView, and to provide a more explicit API that governs the behavior of dot badges, which are label-less.
PiperOrigin-RevId: 416367867
Borders are expected to be drawn outside the badge, but CALayer's border behavior drawers the borders inside of the view. Additionally, the border color is a CGColorRef meaning it won't react automatically to trait collection changes.
This change introduces two new APIs to support outer borders:
1. borderWidth
2. borderColor
`borderWidth` is a proxy for `self.layer.borderWidth`; the only difference between setting `self.borderWidth` and `self.layer.borderWidth` is that `self.borderWidth`'s setter will invalidate the layout and intrinsic content size. This is documented accordingly in API docs.
`borderColor` is a `UIColor`, which is stored adjacent to `self.layer.borderColor`. `self.layer.borderColor` can still technically be set directly, but the value will be reset to whatever `self.borderColor` is any time the trait collection changes.
PiperOrigin-RevId: 416155619
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