diff --git a/library/src/main/java/me/drakeet/multitype/MultiTypeAdapter.java b/library/src/main/java/me/drakeet/multitype/MultiTypeAdapter.java index 6f7494a8..c39187b4 100644 --- a/library/src/main/java/me/drakeet/multitype/MultiTypeAdapter.java +++ b/library/src/main/java/me/drakeet/multitype/MultiTypeAdapter.java @@ -39,7 +39,7 @@ public MultiTypeAdapter(@NonNull List typeItems) { @Override public int getItemViewType(int position) { ItemContent content = typeItems.get(position).content; - return ItemTypePool.getContents().indexOf(content.getClass()); + return MultiTypePool.getContents().indexOf(content.getClass()); } @@ -48,7 +48,7 @@ public ViewHolder onCreateViewHolder(ViewGroup parent, int indexViewType) { if (inflater == null) { inflater = LayoutInflater.from(parent.getContext()); } - return ItemTypePool.getProviderByIndex(indexViewType).onCreateViewHolder(inflater, parent); + return MultiTypePool.getProviderByIndex(indexViewType).onCreateViewHolder(inflater, parent); } @@ -56,7 +56,7 @@ public ViewHolder onCreateViewHolder(ViewGroup parent, int indexViewType) { public void onBindViewHolder(ViewHolder holder, int position) { int type = getItemViewType(position); TypeItem typeItem = typeItems.get(position); - ItemTypePool.getProviderByIndex(type).onBindViewHolder(holder, typeItem); + MultiTypePool.getProviderByIndex(type).onBindViewHolder(holder, typeItem); } diff --git a/library/src/main/java/me/drakeet/multitype/ItemTypePool.java b/library/src/main/java/me/drakeet/multitype/MultiTypePool.java similarity index 98% rename from library/src/main/java/me/drakeet/multitype/ItemTypePool.java rename to library/src/main/java/me/drakeet/multitype/MultiTypePool.java index 170af7c4..c6d461b2 100644 --- a/library/src/main/java/me/drakeet/multitype/ItemTypePool.java +++ b/library/src/main/java/me/drakeet/multitype/MultiTypePool.java @@ -22,7 +22,7 @@ /** * @author drakeet */ -public final class ItemTypePool { +public final class MultiTypePool { private static ArrayList> contents = new ArrayList<>(); private static ArrayList providers = new ArrayList<>(); @@ -54,5 +54,4 @@ public synchronized static void register( @NonNull public static ItemViewProvider getProviderByIndex(int index) { return providers.get(index); } - } diff --git a/sample/src/main/java/me/drakeet/multitype/sample/App.java b/sample/src/main/java/me/drakeet/multitype/sample/App.java index d0484dbc..1ea4d7a9 100644 --- a/sample/src/main/java/me/drakeet/multitype/sample/App.java +++ b/sample/src/main/java/me/drakeet/multitype/sample/App.java @@ -17,7 +17,7 @@ package me.drakeet.multitype.sample; import android.app.Application; -import me.drakeet.multitype.ItemTypePool; +import me.drakeet.multitype.MultiTypePool; /** * @author drakeet @@ -26,8 +26,8 @@ public class App extends Application { @Override public void onCreate() { super.onCreate(); - ItemTypePool.register(TextItemContent.class, new TextItemViewProvider()); - ItemTypePool.register(ImageItemContent.class, new ImageItemViewProvider()); - ItemTypePool.register(RichItemContent.class, new RichItemViewProvider()); + MultiTypePool.register(TextItemContent.class, new TextItemViewProvider()); + MultiTypePool.register(ImageItemContent.class, new ImageItemViewProvider()); + MultiTypePool.register(RichItemContent.class, new RichItemViewProvider()); } }