RecyclerView-Multi-Type

简介:A simple recyclerview multi type for Android
更多:作者   提 Bug   
标签:
recyclerview-multi-recyclerview-multi-recyclerview-multi-recyclerview-multi-

A grace recyclerview multi type for Android

Screenshots

Gradle

Add it in your root build.gradle at the end of repositories:


    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }

Add the dependency:


    dependencies {
               compile 'com.github.ruzhan123:RecyclerView-Multi-Type:v2.1'
    }

Usage


    oneList = MultiType.setMultiTypeListA(oneList,SPAN_SIZE_MAX);
    twoList = MultiType.setMultiTypeListB(twoList, SPAN_SIZE_MAX / 2);
    ......

    adapter.putHolderA(new MultiHolderData<>(OneMultiHolder.class, R.layout.holder01))
            .putHolderB(new MultiHolderData<>(TwoMultiHolder.class, R.layout.holder02))
            .putHolderC(new MultiHolderData<>(ThreeAMultiHolder.class, R.layout.holder03a))
            .putHolderD(new MultiHolderData<>(ThreeBMultiHolder.class, R.layout.holder03b))
            .putHolderE(new MultiHolderData<>(FourMultiHolder.class, R.layout.holder04))
            .putHolderF(new MultiHolderData<>(LoadMoreHolder.class, R.layout.load_more));

    adapter.setData(oneList)
        .setData(twoList)
        .setData(threeAList)
        .setData(threeBList)
        .setData(fourList)
        .setData(loadMoreBean)
        .notifyDataSetChanged();

Library Class

Developed by

ruzhan - dev19921116@gmail.com

License

Copyright 2017 ruzhan

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.
Android 开发经验分享
用了一年多的理财推荐
Android 开发经验分享
用了一年多的理财推荐