Andrew Overton
40e108d6b3
[Tabs] Add non fixed clustered centered layout style
...
PiperOrigin-RevId: 321388615
2020-07-15 10:34:49 -07:00
Andrew Overton
0740f3d9e0
[Tabs] Add programmatic tab switcher buttons to TabBarView example
...
PiperOrigin-RevId: 310356364
2020-05-07 16:54:47 +00:00
Jeff Verkoeyen
92254ea119
Rename all icons to an ic_<#name#> convention.
...
PiperOrigin-RevId: 308232277
2020-04-24 04:33:51 -07:00
Andrew Overton
1666348de9
[Tabs] Add ScrollableCentered option to TabBarView example
...
PiperOrigin-RevId: 307083566
2020-04-17 11:43:51 -07:00
Robert Moore
1ce82c678b
[Tabs] Expand configuration in MDCTabBarView example. ( #8498 )
...
Adds configuration options for `preferredLayoutStyle` and toggling
`contentInset`.
|Fewer Tabs (Portrait)|More Tabs (Landscape)|
|---|---|
|||
Helps exercise #8236
2019-09-25 10:57:40 -04:00
Robert Moore
be5bd6e9c7
[Tabs] Expose selection change animation properties. ( #7944 )
...
When a custom item view changes its intrinsic content size, it will need to
trigger a layout on the `MDCTabBarView` to adjust to the new size. Because the
layout should generally be animated, the TabBarView should expose its animation
duration value for use by the custom view (or its view controller) in the
animation block.
|Using UIView animation defaults|With This PR|
|---|---|
|||
Closes #7943
Closes #7942
2019-07-19 20:22:52 -07:00
Robert Moore
3a0c1ee2e8
[Tabs] Allow clients to calculate when a view appears/disappears. ( #7841 )
...
A new API, `- rectForItem:inCoordinateSpace:` provides the item's corresponding
view's frame in the provided coordinate space. Clients can use this API to
calculate which views are "shown" at any given time. A simple use of this API
for that purpose is added to the example view controller.
Alternative solution to #6275
Closes #7839
2019-07-12 20:35:29 -04:00
Robert Moore
640220d66d
[Tabs] Fix segmented control position. ( #7898 )
...
On smaller devices, the constraints of the segmented control caused it to overlap the tab bar slightly.
|Before|After|
|---|---|
|||
Closes #7813
2019-07-12 14:43:21 -04:00
Robert Moore
4d99e84305
[Tabs] Retain custom view in example. ( #7901 )
...
When switching to title-only Tabs, the custom view was lost because the `UITabBarItem` was recreated incorrectly.
Part of #7896
Follow-up to 7897
2019-07-12 14:42:56 -04:00
Robert Moore
f2b2580144
[Tabs] Fix title-only example. ( #7897 )
...
Once support for `selectedItem` was added, the example no longer correctly changed to title-only Tabs. This is because UITabBarItem seems to never allow setting `selectedItem` to `nil` once it has been read and returned anything other than `nil`.
Closes #7896
2019-07-12 10:34:09 -04:00
Robert Moore
09a7df6530
[Tabs] Add bottom divider. ( #7817 )
...
Adds the bottom divider and an API to make it visible and customize its color.
## TabBarView Example View Controller
|Before|After|
|---|---|
|||
Closes #7742
2019-07-09 09:30:11 -04:00
Robert Moore
9e8165694e
[Tabs] Add setSelected:animated: API for custom views. ( #7810 )
...
Adds a new required protocol method for setting a custom view to be selected. This makes it easier for custom views to respond to selection events.
Closes #7801
2019-07-08 15:47:35 -04:00
Robert Moore
4cb495c435
[Tabs] Add item style options for TabBarView example. ( #7808 )
...
Adds the option to display text-only, image-only, or text-and-image Tabs in the TabBarView example view controller.
Part of #7748
2019-07-08 15:29:43 -04:00
Robert Moore
88e5a52f9f
[Tabs] Allow setting ripple color. ( #7784 )
...
Adds a property that customizes the ripple color.
## Example View Controller
|Before|After|
|---|---|
|||
Closes #7657
2019-07-03 10:41:09 -04:00
Robert Moore
e4aee2a13b
[Tabs] Customize selection indicator color. ( #7774 )
...
Adds the ability to set a custom selection indicator color to the tab bar.
Closes #7657
2019-07-02 13:50:33 -04:00
Robert Moore
5a7efb0fcc
[Tabs] Inject dummy scroll view into example. ( #7772 )
...
This change has no visible effect. It injects a scroll view into the TabBarView example view controller so that the injected AppBar won't manipulate the Tab Bar's insets.
Follow-up from #7744
2019-07-02 10:33:29 -04:00
Robert Moore
4842c32fd8
[Tabs] Fixes layout for changing font sizes. ( #7771 )
...
When different font sizes for different states are used, the item view may end up with a different layout or even a different intrinsic content size.
Follow-up to #7757
2019-07-02 09:49:55 -04:00
Robert Moore
febf914e97
[Tabs] Adds support for rendering custom views. ( #7755 )
...
Clients can provide their own custom views if MDCTabBarView doesn't provide
sufficient behavior by default. An example custom view (containing a UISwitch)
is added to the Dragons example and a test.

Closes #7722
2019-07-01 08:59:37 -04:00
Cody Weaver
029692a0ba
[TabBarView] Add titleFontForState APIs ( #7757 )
...
Adds `titleFont:forState:` APIs to customize the font of selected and unselected items generally. A future change may enable support for `-[UIBarItem titleTextAttributesForState:]`.
## Dragons Example View Controller
|Before|After|
|---|---|
|||
Part of #7657
2019-07-01 01:13:34 -04:00
mikefan1991
c3fe63e5e2
[Tabs] Add accessibility traits support ( #7739 )
...
Add UIAccessibility traits to item view.
**Testing**
accessibilityTraits
Steps to reproduce
1. Update the example to have a custom accessibilityTraits for one of the tabBarItems
1. Optionally have it change those traits in the `tabBarView:didSelectItem:` delegate method.
2. item1.accessibilityTraits = @"Hello world";
3. Launch on a device
4. Select the item with Voiceover on
5. Navigate to the other items with titles but no custom value.
2019-06-28 00:45:34 -04:00
mikefan1991
ca5afce441
[Tabs] Add the user selection visible logic ( #7740 )
...
Add the logic that the selected item will be visible once on screen.
If the selected item is changed when the tab bar view is displayed, the scroll process is animated.
If the selected item is set before the tab bar view is displayed, the scroll process is not animated.

Part of #7728
2019-06-28 00:44:52 -04:00
mikefan1991
46c8e51ae3
[Tabs] Add delegate support to MDCTabBarView ( #7725 )
...
This PR is adding the delegate support for the MDCTabBarView. Two delegate methods shoudSelect and didSelect is defined.
close #7658
2019-06-27 13:00:55 -04:00
Ang
60d5f0dbef
[Tabs] Adds justified and scrollable layout to MDCTabBarView ( #7704 )
...
Adds justified and scrollable layout for MDCTabBarView and corresponding tests.
## Example View Controller
|Before|After (Portrait)|After (Landscape)
|---|---|---|
||||
Part of Issue #7645
2019-06-26 11:13:30 -04:00
Robert Moore
88e145c62b
[Tabs] Add imageTintColorForState APIs. ( #7714 )
...
Adds an image tint color for the `.normal` and `.selected` states.
## Example View Controller
The intrinsic content size is known to be incorrect for bars where items have both titles and images. It will be fixed as part of https://github.com/material-components/material-components-ios/pull/7704 .
|Before|After|
|---|---|
|||
Part of #7657
2019-06-26 08:09:38 -04:00
mikefan1991
e243456b42
[Tabs] Add user selection support to the MDCTabBarView ( #7713 )
...
Adds basic tap support to items in the tab bar.
## TabBarView Example View Controller
|Before|After|
|---|---|
|||
Part of #7644
2019-06-26 00:40:53 -04:00
Robert Moore
41369ecc17
[Tabs] Add barTintColor API. ( #7711 )
...
Adding a `barTintColor` to match APIs on MDCBottomNavigationBar, MDCBottomAppBar, MDCTabBar, and UITabBar.
Part of #7657
2019-06-25 15:37:35 -04:00
Robert Moore
d202640cd3
[Tabs] Send tab item title/image to views ( #7698 )
...
Initial configuration of title and image for itemviews. Does not yet have KVO (coming later). Is using a temporary layout that will be replaced later.
## Dragon Example Screenshots
|Before|After|
|---|---|
|||
Part of #7697
2019-06-24 13:53:46 -04:00
Robert Moore
d0f3843388
[Tabs] Add missing example. ( #7671 )
...
The example was moved but I failed to add it to git from its new location.
Follow-up to #7655
2019-06-21 10:54:30 -04:00