<h4>
```diff
- Warning - This may break screenshot testing -
```
</h4>
### Context
Currently the badge is centered on the top of the `iconImageView`. The `iconImageView`'s `origin.y` is at 8.883 in MDC because we vertically center the _content_ in the MDCBottomNavigationItemView. We get the _content_ height by:
_contentHeight_ = icon.height + label.height + contentVerticalMargin
_contentVerticalMargin_ is the spacing between the icon and label.
The **_badge_** is 14dp tall. Centering the badge on the `iconImageView`'s `origin.y` puts the badge at 1.883.
### The problem
The badge is too high in relation to the top of the bottom navigation bar and doesn't match internal guidance.
### The fix
Make the badge and iconImageView have the same origin y, giving users more separation between the top of the navigation bar and the top of the badge.
### Related PR
Closes#4731
### Screenshots
| Before | After |
| - | - |
|||
Removes the need to copy-paste stanzas from other files anymore as we'll rely on #4478 to generate the correct stanza for us instead.
This was an automated change generated by running a find-and-replace regular expression:
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at
http://www\.apache\.org/licenses/LICENSE-2\.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at
http://www\.apache\.org/licenses/LICENSE-2\.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at
http://www\.apache\.org/licenses/LICENSE-2\.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```
```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
All items should share the same (ink) ripple color, based on the
`selectedItemTintColor`. For currently-unselected items, the ripple color
would only be updated if the `unselectedItemTintColor` property was set.
The problem was caused by earlier behavior where the ripple color would be
derived from the current state of the button. If an unselected item were
pressed, its ripple color would be based on the `unselectedItemTintColor`.
That behavior was changed so that the `selectedItemTintColor` was used for the
ripple color in all states, but the logic was not moved outside of the
state-based conditional logic.
||Animated Screenshot|
|--|--|
|Before | |
|After | |
Closes#4937
When the `badgeValue` property is updated, the `accessibilityValue` of the
item view should also be updated. However, recent changes to improve
accessibility resulted in the first badge value persisting forever as the
accessibilityValue (unless accessibilityValue was updated manually).
Fixes#4733
* Explicitly update label visibility after titleVisibility is set
* Add unit test for titleVisibility
* Make switch statement less explicit and fewer lines
* Give UITabBarItems' accessibilityIdentifiers to MDCBottomNavigationBar's items' buttons
* KVO tab bar item accessibilityIdentifier in MDCBottomNavigationItemView
* Add unit test for tracking UITabBarItem accessibilityIdentifier
* Fix KVO and associated spec
* Move accessibilityIdentifier spec
Added an example to showcase when items are reset to an new array.
Fixed the bug when we reset items and they don't layout correctly.
After a reset, set the selected tab to Null to mirror UITabBar
https://developer.apple.com/documentation/uikit/uitabbar/1623453-selecteditem?language=objc
Added two test to check for selection being Null after a reset and frames not being zero after a reset.
Closes#4429
* Fix setItems bug
* Clean up changes I didn't intend to include
* Add test to make sure when we add items they don't just continue to append to the array but reset it back to empty then add the items.
* Update the test so we set twice.
* Add line.
* Update test to use same type in comparison.
* Use NSUInt instead of unsigned int.
* Undo whitespace changes.
Exposes a selected item title color. Does not implement the full title color image color for state pattern as MDCNavigationBar does not display a title in its unselected state, which made just this single property addition seem cleaner.
https://www.pivotaltracker.com/story/show/156742634
The BottomNavigationBarColorThemer would not work for color schemes generated
from some named UIColors (like .red, .orange). It also generated a poor
contrast ratio when using the MDC Catalog color scheme (dark greys). Instead,
it should use the `primaryColor` for the selected item and leave the other
at the default. This should generally create a simple, effective set of
colors.
Mitigates #3115
The `itemTitleFont` property was not defaulted to a non-nil value, breaking
the API header contract. It was also not being applied when the set of items
in the bar were changed.
Closes#2734Closes#2735