package com.angcyo.uiview.recycler.adapter;

import android.content.Context;

import com.angcyo.uiview.recycler.adapter.RBaseAdapter;

import java.util.List;

/**
 * Created by angcyo on 2017-1-14.
 */
public abstract class RMaxAdapter<T> extends RBaseAdapter<T> {

    private int max_count = 1;

    public RMaxAdapter(Context context) {
        super(context);
        mEnableLoadMore = false;
    }

    public RMaxAdapter(Context context, List<T> datas) {
        super(context, datas);
        mEnableLoadMore = false;
    }

    /**
     * 设置显示的最大的数量
     */
    public void setMaxCount(int max_count) {
        this.max_count = max_count;
    }

    @Override
    public void setEnableLoadMore(boolean enableLoadMore) {
        //不支持加载更多模式
    }

    @Override
    public int getItemCount() {
        return Math.min(max_count, super.getItemCount());
    }

    /**
     * 真实Item的数量
     */
    public int getItemRawCount() {
        if (mAllDatas == null) {
            return 0;
        }
        return mAllDatas.size();
    }
}

@@ -75,65 +75,8 @@
 t;%0A%0A
-import com.angcyo.uiview.recycler.adapter.RBaseAdapter;%0A%0A
 impo
@@ -230,16 +230,17 @@
 count = 
+-
 1;%0A%0A    
@@ -730,32 +730,112 @@
 etItemCount() %7B%0A
+        if (max_count %3C 0) %7B%0A            return super.getItemCount();%0A        %7D%0A
         return M

fix base