135 Commits

Author SHA1 Message Date
Nobody
e7a6b602b4 Add new item layout to align image and text to top with padding in between, and a new property to manage which image-and-text item layout to use.
PiperOrigin-RevId: 735890394
2025-03-11 14:27:52 -07:00
Janette James
ac53ebbc14 Delete Tabs TypographyThemer
PiperOrigin-RevId: 714995832
2025-01-13 09:23:36 -08:00
Janette James
3f82e5f3b0 Delete TabBarViewTheming
PiperOrigin-RevId: 714301345
2025-01-10 18:48:24 -08:00
Wenyu Zhang
fdfeaf6de1 Delete TabBar Theming.
PiperOrigin-RevId: 618287193
2024-03-22 14:26:05 -07:00
Nobody
58f6375b10 Internal change
PiperOrigin-RevId: 565513516
2023-09-14 16:45:39 -07:00
Nobody
4052eb4373 Fixed up imports for Tabs
PiperOrigin-RevId: 472482951
2022-09-06 09:47:41 -07:00
Nobody
5583bb006b Fix text color when reseting items while maintaining the selected tab.
If tab bar items are updated while there is already a selected item the early exit path in `setSelectedItem:` will be taken. This will bypass styling for the selected item (which will have a corresponding newly constructed MDCTabBarViewItemView that needs styling). This results in the MDCTabBarViewItemView's textColor being incorrect.

The fix proposed in this CL resets the selectedItem to nil so that the early exit check fails and allows the tab to be themed.

PiperOrigin-RevId: 440864525
2022-04-11 05:50:48 -07:00
Jeff Verkoeyen
7be840e93b Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 401264011
2021-10-06 09:29:27 -07:00
Cody Weaver
272781fd85 [MDFInternationalziation] Remove mdf_semanticContentAttribute in favor of system API semanticContentAttribute.
PiperOrigin-RevId: 392680954
2021-08-24 09:29:08 -07:00
Cody Weaver
08d01596df [MultipleComponents] Remove mdf_effectiveUserInterfaceLayoutDirection in favor of the system API effectiveUserInterfaceLayoutDirection that was added in iOS 10.
PiperOrigin-RevId: 391307973
2021-08-17 09:30:47 -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
Alyssa Weiss
924c49e43b Remove all iOS 10 availability checks from material_components_ios now that only iOS 10+ is supported.
PiperOrigin-RevId: 366437050
2021-04-02 06:33:16 -07:00
Jeff Verkoeyen
4c86b139e4 Optimizing imports
PiperOrigin-RevId: 357185900
2021-02-12 07:35:17 -08:00
Jeff Verkoeyen
8ce743ce8a Optimizing imports
PiperOrigin-RevId: 357185751
2021-02-12 07:33:30 -08:00
Jeff Verkoeyen
b3fa42005b Optimizing imports
PiperOrigin-RevId: 356966407
2021-02-11 07:12:37 -08:00
Alyssa Weiss
0807c24b05 Add call to update fonts from setItems to make sure tabBarView fonts are applied to new items.
PiperOrigin-RevId: 346230736
2020-12-07 19:24:57 -08:00
Alyssa Weiss
5843183119 Add and expose property to MDCTabBarView for setting the edge insets for each item in the tab bar.
PiperOrigin-RevId: 344794723
2020-11-30 05:41:07 -08:00
Alyssa Weiss
a07df1ee5a Create and expose a minItemWidth property for MDCTabBarView to set the min width of items on the tab bar. This is done by adding a MDCTabBarViewItemViewDelegate protocol that MDCTabBarView conforms to.
PiperOrigin-RevId: 344269393
2020-11-25 09:48:26 -08:00
Alyssa Weiss
b8dccb0965 Update handling of ripple so that, for non scroll layout styles, it shows ripple on touch down rather than touch up.
PiperOrigin-RevId: 339909928
2020-10-30 11:43:32 -07:00
Alyssa Weiss
a60852c53f Remove notion of max item width from TabBarView and MDCTabBarViewItemView
PiperOrigin-RevId: 339340417
2020-10-27 15:19:59 -07:00
Yarden Eitan
89b43fd8ff [TabBarView] Scroll to selected item when there is an orientation/size change.
We do not update needsScrollToSelectedItem to YES in every setBounds or just remove the flag and have it scroll to the selected item in every layoutSubviews because this is a UIScrollView so every scroll updates the contentOffset which then triggers these methods. We want to only trigger this code path in orientation/size changes.

PiperOrigin-RevId: 333731208
2020-09-25 07:46:14 -07:00
Alyssa Weiss
6e127557eb Remove pre-iOS 10 handling for voiceover now that components support iOS 10+
PiperOrigin-RevId: 330576000
2020-09-08 13:36:36 -07:00
Yarden Eitan
eb13147f83 [TabBarView] Adds Large Content Viewer support to MDCTabBarView.
PiperOrigin-RevId: 327056620
2020-08-17 11:07:16 -07:00
Alyssa Weiss
8dac13ae51 Clarify handling of safe area layout in the documentation to make clear all properties that need to be set
PiperOrigin-RevId: 324829881
2020-08-04 09:46:55 -07:00
Alyssa Weiss
6f3b23dfb8 Adding theming extension for TabBarView
PiperOrigin-RevId: 322433982
2020-07-21 13:51:56 -07:00
Wenyu Zhang
7c4dab62cf [Tabs] Add explicit cast in MDCTabBarViewTests.
PiperOrigin-RevId: 316096871
2020-06-12 06:55:41 -07:00
Bryan Oltman
863af97e65 [Tabs] Add selectedImage property to MDCItemBarCell to allow MDCTabBar to support selected images.
To make use of this functionality, use UITabBarItem's initWithTitle:image:selectedImage: initializer.

PiperOrigin-RevId: 314569152
2020-06-03 11:30:54 -07:00
Bryan Oltman
e7717be32c [Tabs] Add snapshot test to expose MDCTabBar not respecting UITabBarItem's selectedImage property.
This issue will be fixed in an upcoming change.

PiperOrigin-RevId: 314524668
2020-06-03 07:14:33 -07:00
Yarden Eitan
7335fb5ca9 [MDCTabBar] Add support for custom accessibility labels for tab bar items.
PiperOrigin-RevId: 311098316
2020-05-13 14:39:09 +00:00
Bryan Oltman
b2d470ea7d [Tabs] Move effectively private MDCTabBarExtendedAlignment.h and MDCTabBarSizeClassDelegate.h headers into extension directories.
PiperOrigin-RevId: 310908157
2020-05-11 07:34:07 -07:00
Nobody
28c20ee11c [Tabs] Adds large content viewer support to MDCItemBar.
PiperOrigin-RevId: 306584813
2020-04-14 23:00:22 -07:00
Eric Lee
b387c367d8 [Tabs] Adds large content viewer support to MDCItemBar.
PiperOrigin-RevId: 306571331
2020-04-14 20:59:45 -07:00
Cody Weaver
f1a125544b [MDC/Tabs] Stop ripple in MDCTabBar from showing up on scroll
When scrolling MDCTabBar, the Ripple should be disabled but when a user taps the cell it should show up. To achieve this effect in MDCRipple this flag should be set to NO, as outlined in the original PR #6487.

_Note:_ The MDCRippleTouchController is moved to the public surface of the cell in order to allow for better testing, the cell is in a private directory.
PiperOrigin-RevId: 306227910
2020-04-13 07:19:55 -07:00
Bryan Oltman
cc82257e5c [Tabs] Add UIPointerInteraction support to MDCTabBar.
PiperOrigin-RevId: 305105741
2020-04-06 13:36:35 -07:00
Bryan Oltman
3165207b57 [Tabs] Add UIPointerInteraction support to MDCTabBarView.
PiperOrigin-RevId: 305072636
2020-04-06 11:13:54 -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
898277ced1
[Tabs] Add MDCTabBarViewLayoutStyleScrollableCentered (#9849)
This is a PR based off of [cl/298786100](http://cl/298786100). I was skeptical about the introduction of the new MDCTabViewAlignment enum in that CL, so I asked Rob (the author of the component) what he thought, and he suggested just extending the existing enum. I wanted to make sure that approach worked before I told the internal contributor about it, so I started tinkering with it, and eventually it just turned into this PR. If we want, we can just merge this PR instead of exporting that CL. I did take some of the code from that CL--this PR definitely would've taken longer to prepare without that code--so I'm wondering if this could still count as a client contribution?

Note: This PR changes the NSInteger values of some of the existing enum cases. I checked internally and none of the few people using this appear to be referring to the old values by their raw values, so I'm thinking this won't be a problem. If someone feels like it will be, I can add the new case to the bottom.

Note: The internal client is happy with this fix.

Here's a before gif:
![before-tabbar](https://user-images.githubusercontent.com/8020010/76020242-0d361980-5ef1-11ea-91b3-8099d2bc06af.gif)

Here's an after gif:
![after-tabbar](https://user-images.githubusercontent.com/8020010/76020231-09a29280-5ef1-11ea-8ec0-532a3f1ceea4.gif)

Closes #9422.
2020-03-09 10:54:46 -04:00
Randall Li
549e52668e
[Material][Availability] Migrates Tabs to MDCAvailability. (#9716)
[Material][Availability] Migrates Tabs to MDCAvailability.
2020-02-14 15:10:37 -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
6049a8c970
Revert "revert of commit ca2f2ad64046b4a2583abbe7cb705e42ed5f0ae7" (#9271)
This PR brings back https://github.com/material-components/material-components-ios/pull/9200. It was reverted because there were some remaining references to MDCTabBarColorThemer. [cl/284979182](http://cl/284979182) addresses those remaining references. This PR should be merged after the CL is approved and submitted.
2019-12-16 10:07:30 -05:00
Randall Li
010fb0ec68 revert of commit ca2f2ad64046b4a2583abbe7cb705e42ed5f0ae7 2019-12-11 11:11:23 -05:00
Andrew Overton
da280903dd
[Tabs] Delete MDCTabBarFontThemer (#9201)
Closes #9106
2019-12-09 16:01:45 -05:00
Andrew Overton
ca2f2ad640
Remove MDCTabBarColorThemer (#9200)
Closes #9061
2019-12-09 15:31:37 -05:00
Robert Moore
a4a17a58da [Tabs] Use built-in "tabs" behavior on iOS 10+ (#8812)
Although not available on iOS 9, on iOS 10 the MDCTabBar can use the
UIAccessibilityTraitTabBar so that its accessibility elements will be
decorated using the "tab, 1 of 3" information automatically. This change also
improves interaction with Voice Control because that relies on matching the
`accessibilityLabel`.

Improves #6757 for iOS 10+
2019-11-15 08:10:30 -08:00
Robert Moore
ed8acbbc71 [Tabs] Mark TabBarView as accessibility tab bar. (#8811)
Marks the `MDCTabBarView` class a tab bar for UIAccessibility. This
supplements the accessibility information provided to users by including the
element's index and total number of items. In VoiceOver, this is vocalized as
something similar to "{title}, tab, 1 of 3".

Closes #8495
2019-11-14 17:15:30 -05:00
Robert Moore
993eea2e9e
[Tabs] Add TabBarView API to set content padding (#8529)
Provides a new API to customize the content padding for MDCTabBarView. The content padding is extra spacing around the Tabs and within the `contentSize` of the UIScrollView. It is distinct from `contentInset` and works independently.

Closes #8490
2019-10-02 21:49:02 -04:00
Robert Moore
7718df1037
[Tabs] Use Starlark macros in BUILD file. (#8196)
Use more Starlark macros in the BUILD file. Also gets rid of the `include`
path extension.

Part of #8150
2019-08-02 16:34:01 -04:00
Cody Weaver
a9a0fcadd0
[Tabs] Add MaterialElevation support (#8116)
Adds conformance to MDCElevatable and MDCElevationOverriding to
MDCTabBar.

Closes #8012
2019-07-29 20:48:34 -07:00
Cody Weaver
0d624ace58
[TabBarView] Add traitCollectionDidChange block (#8060)
Adds a traitCollectionDidChangeBlock to MDCTabBarView, called when its trait collection changes.

Closes #8040
2019-07-23 20:47:06 -07:00