381 Commits

Author SHA1 Message Date
Nobody
72aeb257c1 Don't pin BottomNavigationBar trailing/leading edges to safe area in horizontal mode.
BEGIN_PUBLIC
Don't pin BottomNavigationBar trailing/leading edges to safe area in horizontal mode.
END_PUBLIC

PiperOrigin-RevId: 770227285
2025-06-11 10:59:07 -07:00
Nobody
4dccdb6eb0 This change fixes the warning generated by clang when we enable -Wobjc-property-assign-on-object-type flag under the ARC environment.
Clang with the flag generates the warning if a property to an Objective-C object/block has an assign attribute because an assign property is treated as unretained property and it potentially becomes a dangling pointer.
The flag is added by https://github.com/llvm/llvm-project/commit/52a503d4f333d
So using strong / weak / copy would be better in general.

selectedViewController is the currently selected view controller and the view must be in viewControllers which is strongly retained.
I think it's safe to use weak to selectedViewController.

PiperOrigin-RevId: 755861552
2025-05-07 08:18:22 -07:00
Frank Wang
18bcdffdfc Test updates for bottom navigation.
PiperOrigin-RevId: 747445026
2025-04-14 09:13:52 -07:00
Nobody
4d98ee5cb5 Resized the image to a square format with UIImageSymbolConfiguration
PiperOrigin-RevId: 720248847
2025-01-27 11:40:14 -08:00
Frank Wang
ae3d2df04b [MDCBottomNavigationBar] Add checks for nil when a new appearance is set and provide defaults. Based on failures observed in testing when removing deprecated badge properties, these values are nil by neglect and not nil by intent. Hence we will provide default values for badge appearance properties when they are nil and set on the nav bar.
PiperOrigin-RevId: 719333484
2025-01-24 09:35:22 -08:00
Nobody
24a0ffbd03 Annotate various Delegate protocols as NS_SWIFT_UI_ACTOR
PiperOrigin-RevId: 708413470
2024-12-20 13:33:55 -08:00
Nobody
610c257c12 copied item properties when using setItems
PiperOrigin-RevId: 705965889
2024-12-13 12:26:51 -08: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
Frank Wang
b1bd6f2d1f [NavigationSuite] Introduce custom class MDCBottomNavigationBarItem that supports setting a custom badge appearance for each UITabBarItem. Add API to MDCBottomNavigationBar to allow users to set an array of MDCBottomNavigationBarItems.
PiperOrigin-RevId: 697712760
2024-11-18 12:07:24 -08:00
Nobody
3a851e60e8 Replace forward declaration with header import for improved Swift compatibility.
PiperOrigin-RevId: 673006942
2024-09-10 10:08:02 -07:00
Jeff Verkoeyen
91ff4bfb83 Delete flaky tests.
PiperOrigin-RevId: 607353431
2024-02-15 09:09:32 -08:00
Cody Weaver
886d4fbc5f #NavigationSuite Fix largeItemContentViewer in NavigationRail layout
PiperOrigin-RevId: 599194357
2024-01-17 09:13:59 -08:00
Nobody
55987b467a No third_party test failures/diff. Internal change.
PiperOrigin-RevId: 592344779
2023-12-19 14:30:07 -08:00
Nobody
9d7f56c1cc No third_party test failures/diff. Internal change.
PiperOrigin-RevId: 592315194
2023-12-19 12:41:10 -08:00
Janette James
976983f551 Allow customization of selection indicator
PiperOrigin-RevId: 589867180
2023-12-11 10:30:56 -08:00
Cody Weaver
2936390347 #BottomNavigation Fix pointer support
PiperOrigin-RevId: 584159730
2023-11-20 16:40:33 -08:00
David Collazo
e8ec3f5f0d Remove check for orientation in barWidthForVerticalLayout, and constrain leading and trailing anchors to safeAreaLayoutGuide.
PiperOrigin-RevId: 544098747
2023-06-28 10:40:48 -07:00
Nobody
5a016b2256 [NavigationSuite/Codehealth] Add leading and trailing padding for item view labels.
PiperOrigin-RevId: 542572063
2023-06-22 08:49:23 -07:00
Wenyu Zhang
4f49af7c18 Internal change
PiperOrigin-RevId: 540666237
2023-06-15 13:07:13 -07:00
Nobody
45ce17eef6 Prevent _selectionIndicator from intercepting taps on the button.
PiperOrigin-RevId: 534843582
2023-05-24 08:17:14 -07:00
Nobody
4ca20170cd Polish visual hierarchy of bottom navigation bar.
PiperOrigin-RevId: 534482688
2023-05-23 11:06:51 -07:00
Nobody
d6685e3d1a [NavigationSuite/Codehealth] Fix issue where the bar's width does not scale in fixed vertical layout after rotation.
PiperOrigin-RevId: 533465362
2023-05-19 09:07:06 -07:00
Nobody
2fdfe2ac6b Lighten haptics generated by switching view controllers in navigation suite.
PiperOrigin-RevId: 533158628
2023-05-18 09:54:42 -07:00
Nobody
b5489406a5 #BottomNavigation Add content corner radius API
PiperOrigin-RevId: 532228647
2023-05-15 14:42:13 -07:00
Nobody
d8da72b60f Refactor layout constraints for bottom navigation bar controller.
PiperOrigin-RevId: 529448736
2023-05-04 10:33:52 -07:00
Nobody
0d4dc77e3f Remove enableVerticalLayout public API for MDCBottomNavigationController.
PiperOrigin-RevId: 527315844
2023-04-26 11:03:02 -07:00
Nobody
6820b1fcb1 [BottomNavigationController] Haptics is now disabled by default and turned on by the bottom navigation controller's enableHaptics API.
PiperOrigin-RevId: 527030677
2023-04-25 11:49:34 -07:00
Nobody
a1bd2139c1 Add haptics to Bottom Navigation bar controller.
PiperOrigin-RevId: 524026142
2023-04-13 09:46:52 -07:00
Nobody
cdacd21dfd [NavigationSuite] Add delegate API that allows users to set a callback block that is called when the layout changed under automatic mode.
PiperOrigin-RevId: 521460143
2023-04-03 08:04:28 -07:00
Nobody
7bf4be48f8 [NavigationSuite] Move transition logic to MDCBottomNavigationBarController in automatic mode.
PiperOrigin-RevId: 520802704
2023-03-30 19:20:57 -07:00
Nobody
2fed844f4a [NavigationSuite/Codehealth] Fix issue where the MDCBottomNavigationBar takes up more space than it needs.
PiperOrigin-RevId: 520740813
2023-03-30 14:20:34 -07:00
Nobody
4e03448576 Refactor layout constraints for nav suite.
PiperOrigin-RevId: 520416384
2023-03-29 12:54:40 -07:00
Cody Weaver
18b52af148 #BottomNavigation Add content inset API
PiperOrigin-RevId: 519161944
2023-03-24 09:24:02 -07:00
Nobody
301b9a142b [NavigationSuite/CodeHealth] Fix issue where setNavigationBarHidden in vertical layout does not animate correctly.
PiperOrigin-RevId: 518028635
2023-03-20 11:36:35 -07:00
Nobody
4be2ea202b Fix issue with nav bar completion block not hiding the bottom nav bar.
PiperOrigin-RevId: 516229610
2023-03-13 09:17:12 -07:00
Nobody
98630e6fd3 [MDCBottomNavigationBar] Fix bug where explicitly disabling titles in vertical layout on iPad does not work.
PiperOrigin-RevId: 513830177
2023-03-03 08:12:09 -08:00
Nobody
a407ef3ac3 [GM3/NavigationSuite] Fix bug where disabling vertical layout does not revert to horizontal layout.
PiperOrigin-RevId: 511663342
2023-02-22 19:55:20 -08:00
Nobody
8f96800ffd Increase spacing between items in vertical layout mode for both iPad and iPhone.
PiperOrigin-RevId: 511548036
2023-02-22 11:22:59 -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
9956542cdc [NavigationRail] Adds flag to force titles for item views to show in landscape mode + minor UI changes.
PiperOrigin-RevId: 510428753
2023-02-17 07:43:36 -08:00
Nobody
304d5a3986 [GM3/BottomNavigationBar] Change the way navigation bar determines when it should use vertical layout to a single flag.
PiperOrigin-RevId: 509977608
2023-02-15 17:39:35 -08:00
Nobody
a1ddb68276 [NavigationRail] Add support for rotation detection for iPad.
PiperOrigin-RevId: 508234164
2023-02-08 18:00:13 -08:00
Nobody
6f2bbf825c [GM3/NavigationRail] Update updateNavigationBarInsets to account for child view controllers going behind the navigation rail.
PiperOrigin-RevId: 508072343
2023-02-08 07:18:51 -08:00
Nobody
3683b78331 [NavigationRail] Add vertical layout mode to bottom navigation bar component.
PiperOrigin-RevId: 507859045
2023-02-07 12:49:28 -08:00
Nobody
fdc96d495b [MDCBottomNavigationBar] Refactor layout logic to use constraints and UIStackView.
PiperOrigin-RevId: 505848871
2023-01-30 18:04:12 -08:00
David Collazo
aa3b813fe9 Fix navigation bar item layout breaking on rotation.
PiperOrigin-RevId: 501100810
2023-01-10 14:53:01 -08:00
David Collazo
f953e4cdb4 Fix navigation bar not propagating updates to its indicator visibility state to new items.
PiperOrigin-RevId: 501080484
2023-01-10 13:33:46 -08:00
Wenyu Zhang
7f065d3af4 [BottomNavigation] Minor tweak: move sizeToFit to layoutSubviews to have all the subviews resizing happen at the same place.
PiperOrigin-RevId: 493717021
2022-12-07 14:59:13 -08:00