xuxiuxi
2017-05-02 c4a62d7bd683d94ae246bac811be47f93e38b5ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package cn.com.basic.face.widget.phonecall;
 
import android.content.Context;
import android.os.Parcelable;
import android.util.AttributeSet;
 
import com.camnter.easyrecyclerview.widget.EasyRecyclerView;
 
import cn.com.basic.face.adapter.PhoneCallFragment.PhoneCallLeftAdapter;
import cn.com.basic.face.discern.common.CommonVariables;
 
import java.util.ArrayList;
import java.util.List;
 
public class PhoneCallLeftListView extends EasyRecyclerView {
 
    private PhoneCallLeftAdapter adapter ;
    private Parcelable recyclerViewState;
 
    private void initView() {
        adapter = new PhoneCallLeftAdapter();
        setAdapter(adapter);
    }
 
    public PhoneCallLeftListView(Context context) {
        super(context);
        initView();
    }
 
    public PhoneCallLeftListView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView();
    }
 
    public PhoneCallLeftListView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        initView();
    }
 
    public void show(boolean isSortByDept, List list, boolean append) {
        recyclerViewState = this.getLayoutManager().onSaveInstanceState();
        adapter.setList(list);
        setAdapter(adapter);
        adapter.setSortByDept(isSortByDept);
        this.getLayoutManager().onRestoreInstanceState(recyclerViewState);
    }
 
    public List getPrevList() {
        return adapter.getList();
    }
 
}