package cn.com.basic.face.widget.checkin; import android.content.Context; import android.os.Parcelable; import android.util.AttributeSet; import com.camnter.easyrecyclerview.adapter.EasyRecyclerViewAdapter; import com.camnter.easyrecyclerview.widget.EasyRecyclerView; import java.util.ArrayList; import java.util.List; import cn.com.basic.face.adapter.CheckInFragment; import cn.com.basic.face.discern.common.CommonVariables; import cn.com.basic.face.util.Constant; public class CheckInLeftInterviewee extends EasyRecyclerView { private static CheckInFragment.CheckInLeftIntervieweeAdapter adapter = new CheckInFragment.CheckInLeftIntervieweeAdapter(); private static List list = new ArrayList(); private static Parcelable recyclerViewState; public void setAdapter(Context context) { setAdapter(adapter); } public CheckInLeftInterviewee(Context context) { super(context); setAdapter(context); } public CheckInLeftInterviewee(Context context, AttributeSet attrs) { super(context, attrs); setAdapter(context); } public CheckInLeftInterviewee(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); setAdapter(context); } public void show(List list, boolean isSortByDept, boolean append) { refresh(list, isSortByDept, append); } public void refresh(List list, boolean isSortByDept, boolean append) { recyclerViewState = this.getLayoutManager().onSaveInstanceState(); adapter.setList(list); adapter.setSortByDept(isSortByDept); this.setAdapter(adapter); this.getLayoutManager().onRestoreInstanceState(recyclerViewState); } public List getPrevList() { return adapter.getList(); } }