Skip to content

Releases: drakeet/MultiType

v2.4.3

09 Mar 08:45
Compare
Choose a tag to compare
  • Supplied getItems() method for MultiTypeAdapter

v2.4.2

03 Mar 11:55
Compare
Choose a tag to compare
  • Updated the support libs to v25.2.0 (#81)
  • Changed the MultiTypePool to be non-final
  • Supplied setTypePool() and getTypePool() for MultiTypeAdapter
  • Changed registerAll(MultiTypePool pool) to registerAll(TypePool pool)

v2.4.1

20 Jan 13:25
Compare
Choose a tag to compare

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

14 Jan 12:00
Compare
Choose a tag to compare
  • Changed items to be nullable and added setItems(List<?> items) for MultiTypeAdapter
/**
 * 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

07 Jan 15:27
Compare
Choose a tag to compare
  • 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

01 Jan 12:13
Compare
Choose a tag to compare
  • Added getAdapter() to ItemViewProvider (#54)

v2.3.2

21 Dec 13:22
Compare
Choose a tag to compare

library:

  • Added setFlatTypeAdapter method to MultiTypeAdapter

    • Added FlatTypeClassAdapter
    • Added FlatTypeItemAdapter
  • Added initialCapacity for MultiTypePool #45

sample:

  • Added OneDataToManyActivity sample

v2.3.0

08 Dec 15:47
Compare
Choose a tag to compare
  • Added getPosition() to ItemViewProvider(#43 #36):
/**
 * Get the adapter position of current item,
 * the internal position is equals RecyclerView.ViewHolder#getAdapterPosition().
 *
 * @return the adapter position
 * @since v2.3.0
 */
protected final int getPosition() {
    return position;
}

v2.2.2

29 Nov 14:33
Compare
Choose a tag to compare
  • 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 use Object to instead of it, and keep the interface but Deprecated so that we don't change our old type classes, the Item 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

16 Oct 15:43
Compare
Choose a tag to compare

v2.2.1

  • Changed MultiTypeAdapter.delegate to be a TypePool 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