xuxiuxi
2017-04-05 39badcdcd8322af6b74406bf13fd5d7e5967520f
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package cn.com.basic.face.fragment;
 
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RadioGroup;
 
import com.bsk.zhangbo.demoforbsk.R;
 
import cn.com.basic.face.adapter.CheckInFragment.CheckInLeftListViewAdapter;
import cn.com.basic.face.base.LeftRightBaseFragment;
import cn.com.basic.face.base.MainActivity;
import cn.com.basic.face.service.PhoneCallMng;
import cn.com.basic.face.util.Constant;
import cn.com.basic.face.widget.checkin.CheckInIntervieweeCell;
import cn.com.basic.face.widget.phonecall.PhoneCallLeftListView;
 
import com.camnter.easyrecyclerview.widget.EasyRecyclerView;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
 
import java.util.ArrayList;
import java.util.List;
 
public class PhoneCallFragment extends LeftRightBaseFragment {
 
    private static PhoneCallFragment instance = new PhoneCallFragment();
    public static PhoneCallFragment getInstance() {
        return instance;
    }
 
    private View fragment_phone_call_left;
    private View mViewRight;
 
    @ViewInject(R.id.fragment_phone_call_left_sort_radio_group)
    private RadioGroup fragment_phone_call_left_sort_radio_group;
    @ViewInject(R.id.fragment_phone_call_left_sort_type_linear_layout)
    private LinearLayout fragment_phone_call_left_sort_type_linear_layout;
    @ViewInject(R.id.fragment_phone_call_right_interviewee_cell)
    private CheckInIntervieweeCell fragment_phone_call_right_interviewe_cell;
    @ViewInject(R.id.fragment_phone_call_left_list_view)
    private PhoneCallLeftListView fragment_phone_call_left_list_view;
 
    private CheckInLeftListViewAdapter mAdapter;
    private List mList;
 
    public View addLeftLayout() {
        fragment_phone_call_left = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_phone_call_left,null);
        ViewUtils.inject(this, fragment_phone_call_left);
        fragment_phone_call_left_list_view.setLayoutManager(new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false));
        mAdapter = new CheckInLeftListViewAdapter(getActivity(),Constant.CheckIn.VISITOR_ROW);
 
        fragment_phone_call_left_sort_type_linear_layout.setVisibility(View.VISIBLE);
        mAdapter = new CheckInLeftListViewAdapter(getActivity(), Constant.CheckIn.INTERVIEWEE_ROW);
        mAdapter.set_fragment_check_in_left_sort_radio_group_type(CheckInLeftListViewAdapter.TYPE_NAME);
        mAdapter.setList(mList);
        fragment_phone_call_left_list_view.setAdapter(mAdapter);
 
        return fragment_phone_call_left;
    }
 
    public View addRightLayout() {
        mViewRight = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_phone_call_right,null);
        fragment_phone_call_right_interviewe_cell = (CheckInIntervieweeCell) mViewRight.findViewById(R.id.fragment_phone_call_right_interviewee_cell);
        return mViewRight;
    }
 
    protected void initListeners() {
        fragment_phone_call_left_sort_radio_group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup radioGroup, int i) {
                switch (radioGroup.getCheckedRadioButtonId()){
                    case R.id.fragment_phone_call_left_sort_by_name_radio_button:
                        mAdapter.set_fragment_check_in_left_sort_radio_group_type(CheckInLeftListViewAdapter.TYPE_NAME);
                        mAdapter.setList(mList);
                        fragment_phone_call_left_list_view.setAdapter(mAdapter);
                        break;
                    case R.id.fragment_phone_call_left_sort_by_dept_radio_button:
                        mAdapter.set_fragment_check_in_left_sort_radio_group_type(CheckInLeftListViewAdapter.TYPE_DEPARTMENT);
                        mAdapter.setList(mList);
                        fragment_phone_call_left_list_view.setAdapter(mAdapter);
                        break;
                }
            }
        });
 
    }
 
    @Override
    public void setMenuVisibility(boolean menuVisible) {
        super.setMenuVisibility(menuVisible);
        if (menuVisible && fragment_phone_call_left_list_view != null) {
            PhoneCallMng.getInstance().findPhoneCallLeftList(true, "");
        }
    }
 
    protected void initData() {
//        mList = new ArrayList();
//        for (int i=0;i<3;i++){
//            cn.com.basic.face.service.vo.PhoneCallFragment.PhoneCallQueryItem item =
//                    new cn.com.basic.face.service.vo.PhoneCallFragment.PhoneCallQueryItem();
//            mList.add(item);
//        }
//        mAdapter.setList(mList);
//        fragment_phone_call_left_list_view.setAdapter(mAdapter);
    }
 
    @OnClick(R.id.fragment_phone_call_left_back)
    public void fragment_phone_call_left_back_click(View view) {
        MainActivity.selectPage(0);
    }
 
    public PhoneCallLeftListView get_fragment_phone_call_left_list_view() {
        return fragment_phone_call_left_list_view;
    }
 
}