From 34b7c20da820761c393392a80ad1351a3e414c29 Mon Sep 17 00:00:00 2001 From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674> Date: 星期三, 05 四月 2017 18:18:24 +0800 Subject: [PATCH] --- VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/PhoneCallFragment.java | 66 ++++++++++++-------------------- 1 files changed, 25 insertions(+), 41 deletions(-) diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/PhoneCallFragment.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/PhoneCallFragment.java index 9c7c5f6..a36314b 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/PhoneCallFragment.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/PhoneCallFragment.java @@ -1,28 +1,26 @@ package cn.com.basic.face.fragment; import android.support.v7.widget.LinearLayoutManager; +import android.text.Editable; +import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; +import android.widget.EditText; import android.widget.LinearLayout; +import android.widget.RadioButton; 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 cn.com.basic.face.widget.phonecall.PhoneCallRightIntervieweeCell; -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 { @@ -39,31 +37,25 @@ @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; + private PhoneCallRightIntervieweeCell 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; + @ViewInject(R.id.fragment_phone_call_left_sort_by_name_radio_button) + private RadioButton fragment_phone_call_left_sort_by_name_radio_button; + @ViewInject(R.id.fragment_phone_call_left_search) + private EditText fragment_phone_call_left_search; 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); + fragment_phone_call_right_interviewe_cell = (PhoneCallRightIntervieweeCell) mViewRight.findViewById(R.id.fragment_phone_call_right_interviewee_cell); return mViewRight; } @@ -71,19 +63,13 @@ 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; - } + loadLeftList(); } + }); + fragment_phone_call_left_search.addTextChangedListener(new TextWatcher() { + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {} + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {} + public void afterTextChanged(Editable editable) { loadLeftList(); } }); } @@ -92,19 +78,13 @@ public void setMenuVisibility(boolean menuVisible) { super.setMenuVisibility(menuVisible); if (menuVisible && fragment_phone_call_left_list_view != null) { - PhoneCallMng.getInstance().findPhoneCallLeftList(true, ""); + loadLeftList(); } } - 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); + public void loadLeftList() { + PhoneCallMng.getInstance().findPhoneCallLeftList(!fragment_phone_call_left_sort_by_name_radio_button.isChecked(), + fragment_phone_call_left_search.getText().toString()); } @OnClick(R.id.fragment_phone_call_left_back) @@ -116,4 +96,8 @@ return fragment_phone_call_left_list_view; } + public PhoneCallRightIntervieweeCell get_fragment_phone_call_right_interviewe_cell() { + return fragment_phone_call_right_interviewe_cell; + } + } -- Gitblit v1.8.0