36 Commits

Author SHA1 Message Date
dniz
fed90a9e57 [Nav Rail / Bottom Nav / Nav Bar] API Fixes
Resolves https://github.com/material-components/material-components-android/issues/2131

PiperOrigin-RevId: 365873683
2021-03-31 10:27:45 -04:00
raajkumars
aca5bfb6f7 [Bottom Navigation] Extracted common logic from bottom navigation component into navigation package.
PiperOrigin-RevId: 345029590
2020-12-02 09:55:26 -05:00
connieshi
9487c33b8a Automated g4 rollback of changelist 336347365
PiperOrigin-RevId: 336978123
2020-10-15 13:23:56 -07:00
Material Design Team
0f717f8cce Automated g4 rollback of changelist 336306885
PiperOrigin-RevId: 336347365
2020-10-15 13:01:02 -07:00
connieshi
5e35d14c18 [Badge] Update badge to support being anchored to any view in pre 18.
In <API18, BadgeDrawable will dynamically 1) wrap the anchor in a FrameLayout and 2) replace the anchor with the FrameLayout in the anchor' view hierarchy. BadgeDrawable will set itself as foreground on the FrameLayout.

If the user does not want BadgeDrawable to manipulate its view hierarchy, the user can pass in an instance of FrameLayout `customBadgeParent` in #attachBadgeDrawable instead.

Labeled BadgeUtils as experimental and removed the RestrictedTo(Scope.Library) annotation.

Updated TopAppBar main demo to show a badge on a toolbar menu item.

PiperOrigin-RevId: 336306885
2020-10-15 12:31:14 -07:00
hunterstich
8ec11a1460 [BottomNavigationView] Updated menu item selection animation to match spec
Bottom nav item labels now slide up when fading in instead of scaling.

PiperOrigin-RevId: 331163684
2020-09-11 14:51:00 -04:00
connieshi
e8e901ecd4 [BottomNavigation] When setting the CollectionItemInfo on a BottomNavigationItemView, figure out its position amongst the visible menu items instead of using its item position.
PiperOrigin-RevId: 328923164
2020-08-28 10:12:15 -04:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
Material Design Team
073382034a Migrate android.support.v4.content.ContextCompat to androidx
Android X migration

PiperOrigin-RevId: 315791679
2020-06-11 17:27:51 -07:00
Material Design Team
bcaca401c2 Fix the role description of the GMDC bottom navigation item view's accessibility node.
It was a raw string "Tab", which results in it being never translated. Thus, when Talkback announces the bottom navigation item in other languages, it still announces "Tab" in English.

PiperOrigin-RevId: 310158712
2020-05-07 11:55:49 -04:00
Material Design Team
f1053dfffb Add roleDescriptions to tabs for accessibility
PiperOrigin-RevId: 292620627
2020-02-03 10:22:49 -05:00
Material Design Team
1febcf94b1 Automated g4 rollback of changelist 292560239
PiperOrigin-RevId: 292606404
2020-01-31 16:53:08 -05:00
Material Design Team
811ea17e60 Add roleDescriptions to tabs for accessibility
PiperOrigin-RevId: 292560239
2020-01-31 13:38:39 -05:00
Material Design Team
5de9f01ade Move a11y delegate code from BottomNavigationView and TabLayout to onInitializeA11yNodeInfo.
PiperOrigin-RevId: 286929652
2019-12-23 15:44:28 -05:00
Material Design Team
cc9b9c1103 Add CollectionInfos and CollectionItemInfos to tabs for accessibility. Also make a tab non-clickable by a11y when it is selected.
PiperOrigin-RevId: 281785987
2019-11-22 21:25:50 +00:00
cketcham
08a26c929e Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 264750215
2019-08-26 11:21:15 -04:00
dniz
cc73c2a630 Update TODOs
PiperOrigin-RevId: 259535844
2019-07-23 11:21:39 -04:00
isabellekim
a628bf516b Revert the library to compile with Java 7: revert lambdas, add necessary casts, and make some variables final.
Continue compile shrine demo, catalog, and tests with Java 8.

PiperOrigin-RevId: 257874888
2019-07-15 19:19:23 -04:00
Material Design Team
c42b77fdad Do not unconditionally override icon tint in BottomNavigationItemView.
PiperOrigin-RevId: 257828981
2019-07-15 19:14:14 -04:00
ataulm
c045cca69d [BottomNavigation] Add tooltip fallback to Bottom Navigation item titles
Resolves https://github.com/material-components/material-components-android/pull/409

GIT_ORIGIN_REV_ID=c6cbfcc4ff9cf7c0fa48a929f7950848f5b9dd8e
PiperOrigin-RevId: 254824856
2019-06-24 17:33:01 -04:00
marianomartin
2de39fafe0 Internal cleanup
PiperOrigin-RevId: 253799644
2019-06-18 13:57:49 -04:00
cketcham
bff75f2d3e Update to lamdas
PiperOrigin-RevId: 252846439
2019-06-18 13:21:02 -04:00
connieshi
6aab297f53 Remove context parameter from BadgeDrawable#getContentDescription(Context)
PiperOrigin-RevId: 251492075
2019-06-10 08:55:30 -07:00
connieshi
a9f135b882 Only set clipPadding and clipChildren to false when BottomNavigationItemView is going to display a badge.
PiperOrigin-RevId: 249981675
2019-05-29 15:49:15 -04:00
connieshi
ddc56c800d Add convenience method to check if VERSION.SDK_INT < VERSION_CODES.JELLY_BEAN_MR2 in BadgeUtils.
PiperOrigin-RevId: 249855393
2019-05-24 14:28:16 -04:00
connieshi
3ad423e6b9 Update BottomNavigationItemView to include BadgeDrawable's content description.
Add setter for numberless and numbered badge content descriptions.

PiperOrigin-RevId: 244910418
2019-04-29 15:28:30 -07:00
connieshi
9d488d9208 Begin integrating BadgeDrawable into BottomNavigationView.
TODO:
- update javadocs to provide guidance on how to interact with BottomNavigation + Badging.
- Save badge states.
- Support displaying badges when bottom navigation item doesn't show an icon.
PiperOrigin-RevId: 244197244
2019-04-19 21:51:25 -04:00
connieshi
7d8b2117a0 Automated g4 rollback of changelist 242675939
PiperOrigin-RevId: 242751222
2019-04-19 13:26:30 -04:00
connieshi
00ffe5eea8 Begin integrating BadgeDrawable into BottomNavigationView.
TODO:
- update javadocs to provide guidance on how to call Badging API.
- Save badge states.
- Support displaying badges when bottom navigation item doesn't show an icon.
PiperOrigin-RevId: 242675939
2019-04-19 13:21:35 -04:00
marianomartin
51bee714f6 Preserve icon after updating menus in BottomNav
PiperOrigin-RevId: 228525610
2019-01-10 17:11:43 -05:00
cketcham
dc72aaeed4 Migrate Gradle build and sources to androidx
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -05:00
isabellekim
fdbf02569b Ensures that bottom navigation item background Drawables don't share the same constant state.
PiperOrigin-RevId: 216355891
2018-10-11 18:13:32 -04:00
afohrman
5b2d4d667a Allow bottom nav items to gain focus on keyboard traversal.
Set the bottom nav items to always be focusable. This addresses a bug in which bottom nav items didn't gain focus by keyboard pre-O.

PiperOrigin-RevId: 204518309
2018-07-17 18:08:53 -04:00
dniz
91196d1163 Add get/setItemBackground() Drawable methods to BottomNavigationView
PiperOrigin-RevId: 198911383
2018-06-04 10:50:40 -04:00
Material Design Team
b3c9024218 [a11y] Set the content description of BottomNavigation navigation items explicitly, instead of relying on the label text.
PiperOrigin-RevId: 193724313
2018-04-30 11:36:37 -04:00
dniz
9ca33544ac Update package name to com.google.android.material
PiperOrigin-RevId: 193236235
2018-04-30 11:24:23 -04:00