Releases: drakeet/MultiType
v2.4.3
v2.4.2
v2.4.1
Removed the notifyDataSetChanged from setItems (#62)
OLD, v2.4.0
:
public void setItems(@Nullable List<?> items) {
this.items = items;
notifyDataSetChanged();
}
NOW, v2.4.1
:
/**
* Update the items atomically and safely.
* It is recommended to use this method to update the data.
* <p>e.g. {@code adapter.setItems(new Items(changedItems));}</p>
*
* <p>Note: If you want to refresh the list views, you should
* call {@link RecyclerView.Adapter#notifyDataSetChanged()} by yourself.</p>
*
* @param items The <b>new</b> items list.
* @since v2.4.1
*/
public void setItems(@Nullable List<?> items) {
this.items = items;
}
NOTE: If you are updating from v2.4.0 to v2.4.1,
note that the setItems(items)
method has removed the notifyDataSetChanged()
and you need to call it by yourself.
v.2.4.0
- Changed items to be nullable and added
setItems(List<?> items)
forMultiTypeAdapter
/**
* Update the items and views atomically and safely.
* It is recommended to use this method to update the data.
*
* @param items The <b>new</b> items list.
* @since v2.4.0
*/
public void setItems(@Nullable List<?> items) {
this.items = items;
notifyDataSetChanged();
}
- Supplied full constructors for
Items
v2.3.5
- Fixed the
getPosition()
sometimes cannot get the correct position #57
Below v2.3.5 we may provide getPosition() method to get the position.
It exists BUG, and sometimes can not get the correct position.
It is recommended to immediately stop using it
and use the new getPosition(RecyclerView.ViewHolder) instead.
- Improved the
ItemViewProvider.getAdapter()
system
v2.3.4
v2.3.2
v2.3.0
v2.2.2
-
Deprecated the
Item
interface(#40)Finally, I decided to discard the
Item
interface. It brings meaning can not offset the trouble it brings. So, I useObject
to instead of it, and keep the interface butDeprecated
so that we don't change our old type classes, theItem
is useless and harmless now.Chinese:
对于 MultiType
Item
这个接口,最后我决定抛弃它,因为它带来的意义无法抵消它带来的麻烦,比如我们无法在一个纯 java module 里定义我们的 item types(若要如此,这个 module 势必要引用 MultiType,但实际上它不应该引用任何 Android library);另外,对于嵌套 item class,从面向对象观点看来它们不应该实现Item
接口。因此现在使用Object
替代Item
,但仍然保留了Item
接口,只是标记了废弃,使得开发者们无须修改旧的代码即可兼容。虽然它不再被使用,但即使使用了它也是没关系的,它是无用的、无害的,不会产生任何影响。
v2.2.1
v2.2.1
- Changed
MultiTypeAdapter.delegate
to be aTypePool
for replaceable - Changed
MultiTypePool
class' constructor to be public, fixed #31
v2.2.0
Supported local type pool!(#29)
- Added
GlobalMultiTypePool
- Added
MultiTypeAdapter.register/registerAll
- Added
MultiTypeAsserts
- Removed the
Savable
interface - Updated the Bilibili sample