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
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
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
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
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:

Here's an after gif:

Closes#9422.
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+
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
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