// Path: pullrecyclerview/src/main/java/com/andfast/pullrecyclerview/layoutmanager/ILayoutManager.java
// public interface ILayoutManager {
// 
//     int getFirstVisibleItemPosition();
// 
//     int getLastVisibleItemPosition();
// 
//     RecyclerView.LayoutManager getLayoutManager();
// 
//     void setRecyclerAdapter(BaseRecyclerAdapter adapter);
// 
//     boolean isScrollToFooter(int itemCount);
// 
// }
// 
// Path: pullrecyclerview/src/main/java/com/andfast/pullrecyclerview/layoutmanager/XLinearLayoutManager.java
// public class XLinearLayoutManager extends LinearLayoutManager implements ILayoutManager {
// 
//     public XLinearLayoutManager(Context context) {
//         super(context);
//     }
// 
//     public XLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
//         super(context, orientation, reverseLayout);
//     }
// 
//     public XLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
//         super(context, attrs, defStyleAttr, defStyleRes);
//     }
// 
//     @Override
//     public int getFirstVisibleItemPosition() {
//         return this.findFirstVisibleItemPosition();
//     }
// 
//     @Override
//     public int getLastVisibleItemPosition() {
//         return this.findLastVisibleItemPosition();
//     }
// 
//     @Override
//     public RecyclerView.LayoutManager getLayoutManager() {
//         return this;
//     }
// 
//     @Override
//     public void setRecyclerAdapter(BaseRecyclerAdapter adapter) {
// 
//     }
// 
//     @Override
//     public boolean isScrollToFooter(int itemCount) {
//         int position = findLastVisibleItemPosition();
//         return position == itemCount - 1;
//     }
// }


import android.content.Context;
import android.support.annotation.ColorRes;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import com.andfast.pullrecyclerview.layoutmanager.ILayoutManager;
import com.andfast.pullrecyclerview.layoutmanager.XLinearLayoutManager;
package com.andfast.pullrecyclerview;




/**
 * Created by holenzhou on 16/5/10.
 * 基于RecyclerView和SwipeRefreshLayout进行封装，提供下拉刷新、上拉加载更多、添加header和footer、
 * 设置空页面等多种功能的组合控件
 */
public class PullRecyclerView extends FrameLayout implements SwipeRefreshLayout.OnRefreshListener {

    protected RecyclerView recyclerView;
    protected SwipeRefreshLayout swipeRefreshLayout;
    private OnRecyclerRefreshListener listener;
    public static final int RECYCLER_ACTION_PULL_REFRESH = 1;
    public static final int RECYCLER_ACTION_LOAD_MORE = 2;
    public static final int RECYCLER_ACTION_IDLE = 0;
    int mCurrentAction = RECYCLER_ACTION_IDLE;
    private boolean isLoadMoreEnable;
    private boolean isPullRefreshEnabled = true;
    private boolean isShowLoadDoneTipEnable;
// Path: pullrecyclerview/src/main/java/com/andfast/pullrecyclerview/layoutmanager/ILayoutManager.java
// public interface ILayoutManager {
// 
//     int getFirstVisibleItemPosition();
// 
//     int getLastVisibleItemPosition();
// 
//     RecyclerView.LayoutManager getLayoutManager();
// 
//     void setRecyclerAdapter(BaseRecyclerAdapter adapter);
// 
//     boolean isScrollToFooter(int itemCount);
// 
// }
// 
// Path: pullrecyclerview/src/main/java/com/andfast/pullrecyclerview/layoutmanager/XLinearLayoutManager.java
// public class XLinearLayoutManager extends LinearLayoutManager implements ILayoutManager {
// 
//     public XLinearLayoutManager(Context context) {
//         super(context);
//     }
// 
//     public XLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
//         super(context, orientation, reverseLayout);
//     }
// 
//     public XLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
//         super(context, attrs, defStyleAttr, defStyleRes);
//     }
// 
//     @Override
//     public int getFirstVisibleItemPosition() {
//         return this.findFirstVisibleItemPosition();
//     }
// 
//     @Override
//     public int getLastVisibleItemPosition() {
//         return this.findLastVisibleItemPosition();
//     }
// 
//     @Override
//     public RecyclerView.LayoutManager getLayoutManager() {
//         return this;
//     }
// 
//     @Override
//     public void setRecyclerAdapter(BaseRecyclerAdapter adapter) {
// 
//     }
// 
//     @Override
//     public boolean isScrollToFooter(int itemCount) {
//         int position = findLastVisibleItemPosition();
//         return position == itemCount - 1;
//     }
// }


// Path: pullrecyclerview/src/main/java/com/andfast/pullrecyclerview/PullRecyclerView.java
import android.content.Context;
import android.support.annotation.ColorRes;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import com.andfast.pullrecyclerview.layoutmanager.ILayoutManager;
import com.andfast.pullrecyclerview.layoutmanager.XLinearLayoutManager;

package com.andfast.pullrecyclerview;




/**
 * Created by holenzhou on 16/5/10.
 * 基于RecyclerView和SwipeRefreshLayout进行封装，提供下拉刷新、上拉加载更多、添加header和footer、
 * 设置空页面等多种功能的组合控件
 */
public class PullRecyclerView extends FrameLayout implements SwipeRefreshLayout.OnRefreshListener {

    protected RecyclerView recyclerView;
    protected SwipeRefreshLayout swipeRefreshLayout;
    private OnRecyclerRefreshListener listener;
    public static final int RECYCLER_ACTION_PULL_REFRESH = 1;
    public static final int RECYCLER_ACTION_LOAD_MORE = 2;
    public static final int RECYCLER_ACTION_IDLE = 0;
    int mCurrentAction = RECYCLER_ACTION_IDLE;
    private boolean isLoadMoreEnable;
    private boolean isPullRefreshEnabled = true;
    private boolean isShowLoadDoneTipEnable;
    private ILayoutManager layoutManager;