-
Notifications
You must be signed in to change notification settings - Fork 57
Migration
Alexander Dadukin edited this page Apr 3, 2021
·
9 revisions
Removed methods:
| Name | Use |
|---|---|
| ExpandableBottomBar#setNotificationBadgeBackgroundColor | Was removed due to undefined behaviour in a few cases |
| ExpandableBottomBar#setNotificationBadgeBackgroundColorRes | Was removed due to undefined behaviour in a few cases |
| ExpandableBottomBar#setNotificationBadgeTextColor | Was removed due to undefined behaviour in a few cases |
| ExpandableBottomBar#setNotificationBadgeTextColorRes | Was removed due to undefined behaviour in a few cases |
| ExpandableBottomBar#getMenuItemFor | Menu#findItemById |
| ExpandableBottomBar#getNotificationFor | Was completely removed due to deprecation level |
| ExpandableBottomBar#addItems | Menu#add |
| ExpandableBottomBar#getMenuItems | Menu#items or Menu#iterator |
| ExpandableBottomBar#select | Menu#select |
| ExpandableBottomBar#getSelected | Menu#selectedItem |
New methods:
| Method | Description |
|---|---|
| Menu#deselect | Removes selection from the selected item and selects the first visible item in menu |
| Menu#remove | Removes the given menu item |
| Menu#removesAll | Removes all menu items |
Changed signature:
| Method | Description |
|---|---|
| MenuItem#hide | Does not throw an exception if hide was performed on the selected item, in that case calls deselect from menu |
Note: Introduced Menu class
Renamed the following classes:
| Was | Now |
|---|---|
| ExpandableBottomBarMenuItem | MenuItemDescriptor |
| ItemBuildRequest | BuildRequest |
| ExpandableBottomBarNotification | Notification |
Deprecated methods:
| Was | Use |
|---|---|
| ExpandableBottomBar#getNotificationFor | expandableBottomBar.getMenuItemFor(id).notification() |
New methods:
| Method | Description |
|---|---|
| ExpandableBottomBar#getMenuItemFor(@IdRes id: Int) | Returns menu item for the given id |
| ExpandableBottomBar#getMenuItems() | Returns all menu items |
Note: Introduced MenuItem class
Migration XML declared menu property from app:exb_icon to native android:icon. Now you can reuse your whole android xml file between bottom bar and any android menu.
To avoid conflict in user custom view attributes names we have implemented view attributes extension exb_ and menu items.
Update note: really huge update, made with ❤️
| Description | Was | Now |
|---|---|---|
onItemClickListener removed |
bottomBar.onItemClickListener = { v, i -> } |
bottomBar.onItemSelectedListener = { v, i -> } |
ExpandableBottomBarMenuItem.Builder.addItem(Int, Int, CharSequence, Int) removed |
.addItem(R.id.icon_home, R.drawable.ic_home, "Raw Text", Color.GRAY) |
.addItem(R.id.icon_likes, R.drawable.ic_likes).text("Raw Text").colorRes(R.color.colorLike).create() |
constraint layout's behavior classes moved into behavior package |
app:layout_behavior="github.com.st235.lib_expandablebottombar.ExpandableBottomBarScrollableBehavior" |
app:layout_behavior="github.com.st235.lib_expandablebottombar.behavior.ExpandableBottomBarScrollableBehavior" |
Update note: for competent work with newer versions of the library, you may need to replace the Items Builders code.
| Description | Was | Now |
|---|---|---|
Changes at ExpandableBottomBarMenuItem.Builder's constructor |
ExpandableBottomBarMenuItem.Builder() |
ExpandableBottomBarMenuItem.Builder(context = this) |