MultiTypeAdapter主要是为了解决 :
简化具有多个ItemType的RecyclerView.Adapter的构建代码,不用在Adapter里面搞一堆ViewType,导致整个Adapter很臃肿.
MultiTypeAdapter 2.0
MultiTypeAdapter 1.0
推荐使用MultiTypeAdapter 2.0
但我更强烈推荐你去star原作者的项目MultiType
因为MultiTypeAdapter 2.0的代码来源于MultiType
MultiTypeAdapter 2.0
代码来自MultiType 3.x
在了解了其设计原理以及代码技巧后,并且在使用过程中根据项目实际的业务需求进行修改.
具体描述请看这里readme
MultiTypeAdapter 1.0
之前自己写的,但具有一些缺点,
如果你感兴趣的话,具体描述请看这里readme
- sockeqwe / AdapterDelegates
https://github.com/sockeqwe/AdapterDelegates - hongyangAndroid / baseAdapter
https://github.com/hongyangAndroid/baseAdapter - drakeet/MultiType
https://github.com/drakeet/MultiType
Copyright (C) cxMax Copyright (C) MultiTypeAdapter
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.