104 Commits

Author SHA1 Message Date
Frank Wang
18bcdffdfc Test updates for bottom navigation.
PiperOrigin-RevId: 747445026
2025-04-14 09:13:52 -07:00
Janette James
decc5061d6 [Bottom Navigation] Remove deprecated badge properties and update tests to reflect new behavior.
PiperOrigin-RevId: 702506989
2024-12-03 16:26:07 -08:00
Nobody
36940928cf [Bottom Navigation] Remove deprecated badge properties and update tests to reflect new behavior.
PiperOrigin-RevId: 702435567
2024-12-03 12:44:54 -08:00
Frank Wang
351fb483ef [Bottom Navigation] Remove deprecated badge properties and update tests to reflect new behavior.
PiperOrigin-RevId: 699289362
2024-11-22 14:32:15 -08:00
Cody Weaver
a460469e3b #BottomNavigation Support setting selectionIndicatorSize/Color before setting the items.
PiperOrigin-RevId: 510505107
2023-02-17 13:14:06 -08:00
Nobody
fdc96d495b [MDCBottomNavigationBar] Refactor layout logic to use constraints and UIStackView.
PiperOrigin-RevId: 505848871
2023-01-30 18:04:12 -08:00
Nobody
71807fa2b4 Fixed up imports and nullability for BottomNavigation
PiperOrigin-RevId: 490263336
2022-11-22 09:36:01 -08:00
Nobody
9e1c0c0a45 Internal change
PiperOrigin-RevId: 477458164
2022-09-28 08:26:32 -07:00
Jeff Verkoeyen
7dcbd43bd9 [BottomNavigation] Fix bug where the badge color was not reacting to the background color set in the appearance property.
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
2022-08-10 14:07:43 -07:00
David Collazo
320121387c Add isRippleEnabled property to BottomNavigation
PiperOrigin-RevId: 443457824
2022-04-21 13:09:44 -07:00
David Collazo
6ab378ddc4 Remove deprecated enableRippleBehavior property from BottomNavigation component
PiperOrigin-RevId: 441893309
2022-04-14 17:19:57 -07:00
Jeff Verkoeyen
e49a786767 [Badges] Rewrite badge appearance using Appearance objects.
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
2021-12-22 16:15:08 -08:00
Jeff Verkoeyen
1cb5b29360 Badges] Extract BottomNavigation's badge out to its own component.
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
2021-12-13 14:14:49 -08:00
Jeff Verkoeyen
6a94f54cc9 [BottomNavigation] Organize the item's badge-specific APIs to match their underlying storage.
The properties' declarations, documentation, and organizational structure now mirrors the underlying badge view that houses the data.

PiperOrigin-RevId: 415342823
2021-12-09 13:32:57 -08:00
Jeff Verkoeyen
9bb428332f [BottomNavigation] Store badge as an ivar.
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
2021-12-09 12:48:45 -08:00
Jeff Verkoeyen
6e711120fb [BottomNavigation] Tighten the API surface area of the badge.
The badge view now exposes only the APIs that are needed to configure its behavior.

PiperOrigin-RevId: 415293891
2021-12-09 10:13:54 -08:00
Jeff Verkoeyen
287e4908ac [BottomNavigation] Delete the Theming library.
Also removed examples that made use of theming.

PiperOrigin-RevId: 404245848
2021-10-19 06:48:46 -07:00
Jeff Verkoeyen
86a8c97dc7 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400788645
2021-10-04 12:41:07 -07:00
Nobody
207658f248 Internal change.
PiperOrigin-RevId: 400193172
2021-10-01 07:08:51 -07:00
Cody Weaver
29792307f0 [BottomNavigation] Enable Ripple behavior
PiperOrigin-RevId: 393387798
2021-08-27 11:10:10 -07:00
Nobody
1afa18ee17 Fix MDCBottomNavigationItemView to inherit passed item's tag.
PiperOrigin-RevId: 385462588
2021-07-18 18:42:08 -07:00
Jeff Verkoeyen
a8e4831fd0 Flattening all unit tests into single directories as per convention.
PiperOrigin-RevId: 367426300
2021-04-08 07:33:29 -07:00
Jeff Verkoeyen
9a49fd96f9 Internal change.
PiperOrigin-RevId: 366342462
2021-04-01 15:26:22 -07:00
Jeff Verkoeyen
c53f44398e Optimizing imports
PiperOrigin-RevId: 357185618
2021-02-12 07:29:28 -08:00
Bryan Oltman
d9e294ab00 [BottomNavigation] Add fade animation to bottom navigation item title label on (de)selection.
PiperOrigin-RevId: 341464300
2020-11-09 12:44:24 -08:00
Bryan Oltman
da4b8f7c7f Fix mdc_elevationDidChangeBlock block parameter types for Xcode 12
PiperOrigin-RevId: 331843566
2020-09-15 13:39:15 -07:00
Alyssa Weiss
ef9fd05593 Remove all checks for iOS 10 availability now that components support iOS 10+
PiperOrigin-RevId: 331076636
2020-09-10 21:02:06 -07:00
Yarden Eitan
5d3662f0a2 [BottomNavigation] Provide an API to set the bar's height.
PiperOrigin-RevId: 330937608
2020-09-10 08:05:49 -07:00
Alyssa Weiss
01b1cbaa66 Remove pre-iOS 10 handling for voiceover now that components support iOS 10+
PiperOrigin-RevId: 329963061
2020-09-03 11:54:09 -07:00
Wenyu Zhang
f854548b97 [BottomNavigation] Delete deprecated sizeThatFitsIncludesSafeArea property.
PiperOrigin-RevId: 328623723
2020-08-26 15:44:01 -07:00
Alyssa Weiss
fb9eec8ba0 Set default horizontal item padding to 0
PiperOrigin-RevId: 328352160
2020-08-25 10:09:48 -07:00
Andrew Overton
b22eef526f [BottomNavigation] Move MDCBottomNavigationBarController to main podspec
PiperOrigin-RevId: 326698570
2020-08-14 11:48:35 -07:00
Alyssa Weiss
4a3058d591 [BottomNavigation] modify layouts with division to use floor(), as not using this was causing some non integer pixel values, which then resulted in a blurry layout
PiperOrigin-RevId: 326527243
2020-08-13 14:45:00 -07:00
Bryan Oltman
ef1cc6dfd7 [BottomNavigation] Shrink UIPointerEffect frame size to fit content of navigation item views.
This brings BottomNavigation more in-line with UITabBar - see the Photos app for reference.

PiperOrigin-RevId: 305129590
2020-04-06 15:23:49 -07:00
Cody Weaver
fdf87c5995 [MDC/ColorScheme] Remove usage of init within MDC.
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
2020-03-25 13:36:51 -07:00
Andrew Overton
c068063cad
[BottomNavigation] Add horizontal padding property to MDCBottomNavigationBar (#9765)
This PR makes what was a hard coded horizontal padding value a configurable property on MDCBottomNavigationBar.

Closes #9307
2020-02-21 14:46:43 -05:00
Randall Li
fa62718bc5
add deps on availability for a bunch of components (#9679)
* add Availability build file

* add Button deps on availability

* added elevation

* corrected include statements to use import of the umbrella files

* revert unwanted changes

* spaces

* clangformat

* add availability dep

* added buttom nav deps on availibility

* Add FeatureHighlight build dep for Availability

* Add Availability build dep to FeatureHighlight private

* Add missing =

* fixed tabs spacing

Co-authored-by: Bryan Oltman <bryanoltman@gmail.com>
2020-02-11 13:14:09 -05:00
Nobody
770095c612 Adds availability macro for conditionally compiling OS sensitive code.
PiperOrigin-RevId: 293067907
2020-02-03 20:55:35 -08:00
Eric Lee
69d39caeb9 [BottomNavigation] Adds large content viewer support (#9451)
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
2020-01-25 22:26:36 -05:00
Robert Moore
e51a83afeb
[BottomNavigation] Fix bug in delegate method call (#9489)
[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
2020-01-24 15:01:19 -05:00
Wenyu Zhang
ab901f7654
Revert "[ColorScheme] deprecate init method and update documentation to reflect its purpose. (#9391)" (#9396)
This reverts commit 5fc6ec2f96e69f1e4c579ca69344557ad83329f2.
2020-01-09 13:54:20 -05:00
Wenyu Zhang
5fc6ec2f96
[ColorScheme] deprecate init method and update documentation to reflect its purpose. (#9391)
closes https://github.com/material-components/material-components-ios/issues/9390
2020-01-08 18:07:01 -05:00
Andrew Overton
d89eb249aa
delete-MDCBottomNavigationBarTypographyThemer (#9234)
delete MDCBottomNavigationBarTypographyThemer. Closes #9158.
2019-12-11 10:52:08 -05:00
Bryan Oltman
1ae1e4cbbb
[BottomNavigation] Delete MDCBottomNavigationBarColorThemer (#9198)
Deletes MDCBottomNavigationBarColorThemer. MDCBottomNavigationBarColorThemer has been deprecated and has no internal usage.

Fixes #9130
Fixes #9161
2019-12-09 14:17:42 -05:00
Robert Moore
d19d388292
[BottomNavigation] Add support for custom badge and text colors. (#8518)
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
2019-09-27 22:04:57 -04:00
Eric Lee
815d3745eb [BottomNavigation] Adds state restoration support to the bottom navigation bar controller. (#8117)
Enables clients to opt-in to state restoration by providing `restorationIdentifier` values for the Bottom Navigation controller's child view controllers.

Closes #8265
2019-08-09 12:36:19 -04:00
Robert Moore
30de3a8756
[BottomNavigation] Propagate accessibilityHint to the accessibility element. (#8241)
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
2019-08-08 11:51:36 -04:00
Robert Moore
e50b9be8bc
[BottomNavigation] Don't assign accessibilityIdentifier to the item view (#8240)
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
2019-08-08 09:58:10 -04:00
Eric Lee
3b54f2c6ea [BottomNavigation] Renames functions and fixes comments. (#8133) 2019-08-03 07:48:12 -04:00
Robert Moore
3c03bd05d6
[BottomNavigation] Use Starlark macros. (#8159)
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
2019-08-01 15:30:02 -04:00