- Added implementation of
notifyDataSetChanged()callednotifyParentDataSetChanged(), please read the documentation for the method before considering using it. - Added generic types for the Parent and Child model objects inside of ExpandableRecyclerAdapter
- ParentListItem interface now takes a generic object type, which allows for
getChildItemListto return a typed List instead ofList<?> - The
ExpandableRecyclerAdaptertakes two more generic object types- A child model object of any type
- A parent model object that must extend
ParentListItemwhich includes the previous child type
- As a result
onBindParentViewHolderandonBindChildViewHoldernow give the specific object type specified in the class - Cleaned up a lot of internal logic within
ExpandableRecyclerAdapterto avoid casting to Object - Removed protected method
getListItem, with generics it is now more sane to accessmItemListyourself if you need it in the subclass
- ParentListItem interface now takes a generic object type, which allows for
- Rename of
ParentListItemandChildListItem, this affects many getters and setters names to eliminate the item word. Some examples:Parentinterface now has the methodgetChildList()instead ofgetChildItemList()ExpandableRecyclerAdapterrenamed method fromgetParentItemList()togetParentList()- All the notify methods now are name
notifyParent...instead of ofnotifyParentItem...(Same for children) - The
ExpandCollapseListenerhas methodsonParentExpandedandonParentCollapsedinstead ofonListItemExpanded
- Changed the name and visibility of
onParentListItemExpandedandonParentListItemCollapsed- Now protected and named
parentExpandedFromViewHolderandparentCollapsedFromViewHolder - Not meant to be called from outside the adapter and viewholder, can be overriden to give some custom behaviour for collapsing/expanding
- Now protected and named
- Added support for multiple view types within recyclerview
getParentViewType(),getChildViewType(), andisParentViewType()added with default implementation for single view type- Modified signatures of
onCreateParentViewHolder()andonCreateChildViewHolder()to pass view type being created
ParentViewHolderpackage location modified fromcom.bignerdranch.expandablerecyclerview.Adapter.ExpandableRecyclerAdaptertocom.bignerdranch.expandablerecyclerview.ExpandableRecyclerAdapterChildViewHolderpackage location modified fromcom.bignerdranch.expandablerecyclerview.Adapter.ExpandableRecyclerAdaptertocom.bignerdranch.expandablerecyclerview.ExpandableRecyclerAdapter- Added ParentViewHolder methods:
getParent()getParentAdapterPosition()
- Added ChildViewHolder methods:
getChild()getParentAdapterPosition()getChildAdapterPosition()
- Added
SimpleParentListItemfor quick implementation of ParentListItem interface (no need to override methods or subclass)
- Updated Support Library dependencies
- Improved expand/collapse performance
- Reduced frequency of notify calls in expand/collapse methods
- Added ability to expand and collapse list items by range
- Added
ExpandableRecyclerAdapter.expandParentRangeso that a subset of parents in a list can be expanded at once with one call - Added
ExpandableRecyclerAdapter.collapseParentRangeso that a subset of parents in a list can be collapsed at once with one call
- Added
- Added additional
notifyDatasetChangedmethods- Added
ExpandableRecyclerAdapter.notifyParentItemRangeRemovedto notify the RecyclerView when a subset of parents is removed - Added
ExpandableRecyclerAdapter.notifyParentItemRangeChangedto notify the RecyclerView when a subset of parents is changed - Added
ExpandableRecyclerAdapter.notifyChildItemRangeInsertedto notify the RecyclerView when a subset of children is inserted - Added
ExpandableRecyclerAdapter.notifyChildItemRangeRemovedto notify the RecyclerView when a subset of children is removed - Added
ExpandableRecyclerAdapter.notifyChildItemRangeChangedto notify the RecyclerView when a subset of children is changed - Added
ExpandableRecyclerAdapter.notifyParentItemMovedto notify the RecyclerView when a parent's adapter position is changed - Added
ExpandableRecyclerAdapter.notifyChildItemMovedto notify the RecyclerView when a child's adapter position is changed
- Added
- Replaced content in vertical linear sample with a more realistic, food-themed example
- Fix crash when restoring state when an initially expanded row has been collapsed
- Change
onListItemExpandedandonListItemCollapsedto be called after list is updated, fixes bug in issue #112
- Fix
notifyChildItemChangedandnotifyParentItemChanged, previously child objects were not being replaced
- Fix crash occurring when using notifyParentItemRangeInserted to add a group of items at the end of the list
For a migration guide from 1.0.3 to 2.0.0, see here.
- Significant renaming/reorganizing of library
ParentObjectis now namedParentListItem.ExpandableRecyclerAdapter#mHelperItemListnow hasprotectedvisibility and is namedmItemList. ThisListcan be used to gain access to all expanded list items.ParentItemClickListeneris nowParentViewHolder.ParentListItemExpandCollapseListener.
- Fleshed out Javadocs.
- Added ability to specify if a parent should be expanded initially.
- Added ability to expand and collapse list items programmatically (without relying on a click event).
- Added
ExpandableRecyclerAdapter.ExpandCollapseListener. - Added horizontal linear sample project, demoing many of the new features in 2.0.0.
- Added ability to notify the adapter of changes to the parent list items and child items. Methods begin with
notifyParentItemornotifyChildItem- Note: RecyclerView.Adapter's notify methods will not work correctly with this adapter.
- Reorganized sample project.
- Removed
setChildObjectListfromParentListIteminterface. - Removed inaccurate "stable" id map.
- Removed application tag from manifest.
- Removed animation and click handling details from the adapter,
ParentViewHoldernow has methods used for implementing that behavior in your own subclasses (examples given in the samples with this library). - README updates
- Added usage instructions for new features.
- Updated references to the library where naming has changed.
- Bug fixes: #42, #46, #47
- Initial Version