From 1b1ac234c8b2175dde10982502073c70224414ad Mon Sep 17 00:00:00 2001 From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674> Date: 星期三, 29 三月 2017 17:22:24 +0800 Subject: [PATCH] --- VisitFace/DemoForBsk/app/src/main/res/layout/fragment_home_bottom_visitor_cell.xml | 8 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/HomeFragment.java | 6 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/CheckInRightCellAdapter.java | 149 ++++++++++++++++ VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/HomeAdapter.java | 62 ++---- VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/CheckInFragment.java | 26 +- VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/VisitFragment.java | 6 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/AttendanceFragment.java | 12 /dev/null | 176 ------------------- VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/PhoneCallFragment.java | 25 +- VisitFace/DemoForBsk/app/src/main/res/layout/fragment_check_in_left_interviewee_row.xml | 16 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/AttendanceAdapter.java | 2 VisitFace/DemoForBsk/app/src/main/res/layout/fragment_check_in_left_visitor_row.xml | 10 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/Constant.java | 2 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/VisitAdapter.java | 2 14 files changed, 226 insertions(+), 276 deletions(-) diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/AttendanceRecyclerViewAdapter.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/AttendanceAdapter.java similarity index 90% rename from VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/AttendanceRecyclerViewAdapter.java rename to VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/AttendanceAdapter.java index 944da03..aa0b470 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/AttendanceRecyclerViewAdapter.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/AttendanceAdapter.java @@ -10,7 +10,7 @@ * Created by Sinoe on 2017/2/23. */ -public class AttendanceRecyclerViewAdapter extends EasyRecyclerViewAdapter { +public class AttendanceAdapter extends EasyRecyclerViewAdapter { private TextView mTvNumber,mTvTime,mTvAddress,mTvState; @Override public int[] getItemLayouts() { diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/CheckInRightCellAdapter.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/CheckInRightCellAdapter.java new file mode 100644 index 0000000..b284874 --- /dev/null +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/CheckInRightCellAdapter.java @@ -0,0 +1,149 @@ +package cn.com.basic.face.adapter; + +import android.content.Context; +import android.net.Uri; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.bsk.zhangbo.demoforbsk.R; +import cn.com.basic.face.fragment.CheckInFragment; +import cn.com.basic.face.util.AppApi; +import cn.com.basic.face.util.Constant; +import com.camnter.easyrecyclerview.adapter.EasyRecyclerViewAdapter; +import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; +import com.facebook.drawee.view.SimpleDraweeView; + +import java.util.List; + +import cn.com.basic.face.discern.query.item.VisitorQueryItem; + +/** + * Created by Sinoe on 2017/2/23. + */ + +public class CheckInRightCellAdapter extends EasyRecyclerViewAdapter { + private Context mContext; + private int type, mTypeColor; + private List list; + private TextView fragment_check_in_left_interviewee_row_name; + private TextView fragment_check_in_left_interviewee_row_dept; + public static final int TYPE_NAME = 10000; + public static final int TYPE_DEPARTMENT = 10001; + private SimpleDraweeView fragment_check_in_left_interviewee_row_photo; + + public CheckInRightCellAdapter(Context mContext, int type) { + this.mContext = mContext; + this.type = type; + } + + @Override + public int[] getItemLayouts() { + return new int[]{R.layout.fragment_check_in_left_visitor_row, R.layout.fragment_check_in_left_interviewee_row}; + } + + @Override + public void onBindRecycleViewHolder(EasyRecyclerViewHolder viewHolder, int position) { + switch (type) { + case Constant.VISITOR_CELL: + visitorCellHolder(viewHolder, position); + break; + case Constant.INTERVIEWEE_CELL: + intervieweeCellHolder(viewHolder, position); + break; + } + } + + @Override + public int getRecycleViewItemType(int position) { + switch (type) { + case Constant.VISITOR_CELL: + return 0; + case Constant.INTERVIEWEE_CELL: + return 1; + default: + return 1; + } + } + + /** + * 鏉ヨ浜篐older + * + * @param holder + * @param posistion + */ + private void visitorCellHolder(EasyRecyclerViewHolder holder, final int posistion) { + LinearLayout fragment_check_in_left_visitor_row_linear_layout = holder.findViewById(R.id.fragment_check_in_left_visitor_row_linear_layout); + + TextView fragment_check_in_left_visitor_row_name = (TextView)fragment_check_in_left_visitor_row_linear_layout.findViewById(R.id.fragment_check_in_left_visitor_row_name); + SimpleDraweeView fragment_check_in_left_visitor_row_photo = (SimpleDraweeView) fragment_check_in_left_visitor_row_linear_layout.findViewById(R.id.fragment_check_in_left_visitor_row_photo); + + RelativeLayout fragment_check_in_left_visitor_row_relative_layout = (RelativeLayout)fragment_check_in_left_visitor_row_linear_layout.findViewById(R.id.fragment_check_in_left_visitor_row_relative_layout); + + fragment_check_in_left_visitor_row_relative_layout.setOnClickListener(new View.OnClickListener(){ + @Override + public void onClick(View view) { + Object data = getList().get(posistion); + if (data instanceof VisitorQueryItem) { + VisitorQueryItem item = (VisitorQueryItem) data; + CheckInFragment.getInstance().setVisitorInfo(item); + } + } + }); + + fragment_check_in_left_visitor_row_name.setText(""); + + Object data = getList().get(posistion); + if (data instanceof VisitorQueryItem) { + VisitorQueryItem item = (VisitorQueryItem) data; + fragment_check_in_left_visitor_row_name.setText(item.getName()); + fragment_check_in_left_visitor_row_photo.setImageURI(Uri.parse(AppApi.IMAGEURL_BASE + item.getImagePath())); + } + + } + + /** + * 琚闂瓾older + * + * @param holder + * @param posistion + */ + private void intervieweeCellHolder(EasyRecyclerViewHolder holder, final int posistion) { + fragment_check_in_left_interviewee_row_dept = holder.findViewById(R.id.fragment_check_in_left_interviewee_row_dept); + fragment_check_in_left_interviewee_row_photo = holder.findViewById(R.id.fragment_check_in_left_interviewee_row_photo); + + Object data = getList().get(posistion); + if (data instanceof VisitorQueryItem) { + VisitorQueryItem item = (VisitorQueryItem) data; + fragment_check_in_left_interviewee_row_name.setText(item.getName()); + fragment_check_in_left_interviewee_row_dept.setText(item.getDeptName()); + fragment_check_in_left_interviewee_row_photo.setImageURI(Uri.parse(AppApi.IMAGEURL_BASE + item.getImagePath())); + } + + holder.findViewById(R.id.fragment_check_in_left_interviewee_row_relativeLayout).setOnClickListener(new View.OnClickListener(){ + @Override + public void onClick(View view) { + Object data = getList().get(posistion); + if (data instanceof VisitorQueryItem) { + VisitorQueryItem item = (VisitorQueryItem) data; + CheckInFragment.getInstance().setIntervieweeInfo(item); + } + } + }); + + if (mTypeColor == TYPE_DEPARTMENT) { + fragment_check_in_left_interviewee_row_name.setTextColor(mContext.getResources().getColor(R.color.colorText_b)); + fragment_check_in_left_interviewee_row_dept.setTextColor(mContext.getResources().getColor(R.color.colorText_5)); + } else { + fragment_check_in_left_interviewee_row_name.setTextColor(mContext.getResources().getColor(R.color.colorText_5)); + fragment_check_in_left_interviewee_row_dept.setTextColor(mContext.getResources().getColor(R.color.colorText_b)); + } + + } + + public void setVisitorToColor(int type) { + this.mTypeColor = type; + } + +} diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/OneBottomRecylerViewAdapter.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/HomeAdapter.java similarity index 65% rename from VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/OneBottomRecylerViewAdapter.java rename to VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/HomeAdapter.java index c2c41db..877cd45 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/OneBottomRecylerViewAdapter.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/HomeAdapter.java @@ -25,12 +25,12 @@ * Created by zhangbo on 2017/2/15. */ -public class OneBottomRecylerViewAdapter extends EasyRecyclerViewAdapter { +public class HomeAdapter extends EasyRecyclerViewAdapter { private int TYPE_1 = 0,TYPE_2 = 1; private int type; private Context context; private List list; - public OneBottomRecylerViewAdapter(Context context) { + public HomeAdapter(Context context) { this.context = context; } @@ -66,20 +66,6 @@ } } -// @Override -// public void onAttachedToRecyclerView(RecyclerView recyclerView) { -// super.onAttachedToRecyclerView(recyclerView); -// RecyclerView.LayoutManager manager = recyclerView.getLayoutManager(); -// if (manager instanceof GridLayoutManager) { -// final GridLayoutManager gridManager = ((GridLayoutManager) manager); -// gridManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { -// @Override -// public int getSpanSize(int position) { -// return getRecycleViewItemType(position) == BANNER_TYPE ? gridManager.getSpanCount() : 1; -// } -// }); -// } -// } /** * 绗竴鍒楁敞鍐� * @param holder @@ -104,12 +90,6 @@ System.out.println(data.toString()); } }); - -// ImageView mSdv = holder.findViewById(R.id.item_register_bcg); -// ViewGroup.LayoutParams mSdvLayoutParams = mSdv.getLayoutParams(); -// mSdvLayoutParams.height = WindowsUtil.dip2px(context, 60); -// mSdvLayoutParams.width = WindowsUtil.dip2px(context, 60); -// mSdv.setLayoutParams(mSdvLayoutParams); } @@ -126,10 +106,10 @@ layoutParams.width = WindowsUtil.dip2px(context, 104); mLayout.setLayoutParams(layoutParams); - ImageView photoIv = (ImageView) mLayout.findViewById(R.id.item_user_bcg); - TextView warningTv = (TextView) mLayout.findViewById(R.id.item_user_warning); - TextView nameTv = (TextView) mLayout.findViewById(R.id.item_user_name); - TextView statusTv = (TextView) mLayout.findViewById(R.id.item_user_status); + ImageView fragment_home_bottom_visitor_cell_photo = (ImageView) mLayout.findViewById(R.id.fragment_home_bottom_visitor_cell_photo); + TextView fragment_home_bottom_visitor_cell_warning = (TextView) mLayout.findViewById(R.id.fragment_home_bottom_visitor_cell_warning); + TextView fragment_home_bottom_visitor_cell_name = (TextView) mLayout.findViewById(R.id.fragment_home_bottom_visitor_cell_name); + TextView fragment_home_bottom_visitor_cell_status = (TextView) mLayout.findViewById(R.id.fragment_home_bottom_visitor_cell_status); //statusTv.setText(""); Object data = this.getItem(posistion); @@ -138,20 +118,20 @@ if (item.getWarning().length() > 0 && "鏉ヨ鐧昏".equals(item.getStatus())) { //warningTv.setText("璀﹀憡"); - warningTv.setVisibility(View.VISIBLE); + fragment_home_bottom_visitor_cell_warning.setVisibility(View.VISIBLE); } else { - warningTv.setVisibility(View.GONE); + fragment_home_bottom_visitor_cell_warning.setVisibility(View.GONE); } - nameTv.setText(item.getName()); + fragment_home_bottom_visitor_cell_name.setText(item.getName()); - statusTv.setText(item.getStatus()); + fragment_home_bottom_visitor_cell_status.setText(item.getStatus()); if ("鏉ヨ鐧昏".equals(item.getStatus())) { - statusTv.setBackground(context.getDrawable(R.drawable.rectangle_textview)); + fragment_home_bottom_visitor_cell_status.setBackground(context.getDrawable(R.drawable.rectangle_textview)); - statusTv.setHeight((int)(context.getResources().getDisplayMetrics().density * 45)); - statusTv.setOnClickListener(new View.OnClickListener(){ + fragment_home_bottom_visitor_cell_status.setHeight((int)(context.getResources().getDisplayMetrics().density * 45)); + fragment_home_bottom_visitor_cell_status.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View view) { MainActivity.selectPage(2); @@ -159,21 +139,21 @@ } }); } else { - statusTv.setBackground(null); - statusTv.setOnClickListener(null); + fragment_home_bottom_visitor_cell_status.setBackground(null); + fragment_home_bottom_visitor_cell_status.setOnClickListener(null); } } - nameTv.setText(""); + fragment_home_bottom_visitor_cell_name.setText(""); if (data instanceof VisitorQueryItem) { final VisitorQueryItem item = (VisitorQueryItem)data; - nameTv.setText(item.getName()); - photoIv.setImageURI(Uri.parse(AppApi.IMAGEURL_BASE +item.getImagePath())); + fragment_home_bottom_visitor_cell_name.setText(item.getName()); + fragment_home_bottom_visitor_cell_photo.setImageURI(Uri.parse(AppApi.IMAGEURL_BASE +item.getImagePath())); if (1==1) { - statusTv.setBackground(context.getDrawable(R.drawable.rectangle_textview)); + fragment_home_bottom_visitor_cell_status.setBackground(context.getDrawable(R.drawable.rectangle_textview)); - statusTv.setHeight((int)(context.getResources().getDisplayMetrics().density * 45)); - statusTv.setOnClickListener(new View.OnClickListener(){ + fragment_home_bottom_visitor_cell_status.setHeight((int)(context.getResources().getDisplayMetrics().density * 45)); + fragment_home_bottom_visitor_cell_status.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View view) { MainActivity.selectPage(2); diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/ToRegisterOnClickListener.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/ToRegisterOnClickListener.java deleted file mode 100644 index ad0c503..0000000 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/ToRegisterOnClickListener.java +++ /dev/null @@ -1,2 +0,0 @@ -package cn.com.basic.face.adapter; - diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/VisitorManagerListAdapter.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/VisitAdapter.java similarity index 96% rename from VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/VisitorManagerListAdapter.java rename to VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/VisitAdapter.java index efcaeec..4d11926 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/VisitorManagerListAdapter.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/VisitAdapter.java @@ -10,7 +10,7 @@ * Created by Sinoe on 2017/2/23. */ -public class VisitorManagerListAdapter extends EasyRecyclerViewAdapter { +public class VisitAdapter extends EasyRecyclerViewAdapter { private CheckBox mCheckBox; private int oldPosition,newPosition; @Override diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/VisitorRecyclerViewAdapter.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/VisitorRecyclerViewAdapter.java deleted file mode 100644 index b350e3a..0000000 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/VisitorRecyclerViewAdapter.java +++ /dev/null @@ -1,176 +0,0 @@ -package cn.com.basic.face.adapter; - -import android.content.Context; -import android.net.Uri; -import android.view.View; -import android.view.ViewGroup; -import android.widget.LinearLayout; -import android.widget.RelativeLayout; -import android.widget.TextView; - -import com.bsk.zhangbo.demoforbsk.R; -import cn.com.basic.face.fragment.CheckInFragment; -import cn.com.basic.face.util.AppApi; -import cn.com.basic.face.util.Constant; -import com.camnter.easyrecyclerview.adapter.EasyRecyclerViewAdapter; -import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; -import com.facebook.drawee.view.SimpleDraweeView; - -import java.util.List; - -import cn.com.basic.face.discern.query.item.VisitorQueryItem; - -/** - * Created by Sinoe on 2017/2/23. - */ - -public class VisitorRecyclerViewAdapter extends EasyRecyclerViewAdapter { - private Context mContext; - private int type, mTypeColor; - private List list; - private TextView mTvName, mTvDepartment; - public static final int TYPE_NAME = 10000; - public static final int TYPE_DEPARTMENT = 10001; - private TextView mToNameTv; - private TextView mToDepartmentTv; - - public VisitorRecyclerViewAdapter(Context mContext, int type) { - this.mContext = mContext; - this.type = type; - } - - @Override - public int[] getItemLayouts() { - return new int[]{R.layout.fragment_check_in_left_visitor_row, R.layout.fragment_check_in_left_interviewee_row}; - } - - @Override - public void onBindRecycleViewHolder(EasyRecyclerViewHolder viewHolder, int position) { - switch (type) { - case Constant.VISITOR_FROM: - VisitorFromViewHolder(viewHolder, position); - break; - case Constant.VISITOR_TO: - VisitorToViewHolder(viewHolder, position); - break; - } - } - - @Override - public int getRecycleViewItemType(int position) { - switch (type) { - case Constant.VISITOR_FROM: - return 0; - case Constant.VISITOR_TO: - return 1; - default: - return 1; - } - } - - /** - * 鏉ヨ浜篐older - * - * @param holder - * @param posistion - */ - private void VisitorFromViewHolder(EasyRecyclerViewHolder holder, final int posistion) { - LinearLayout mLayout = holder.findViewById(R.id.item_visitor_from_base); - - TextView nameTv = (TextView)mLayout.findViewById(R.id.item_visitor_name); - SimpleDraweeView photoIv = (SimpleDraweeView) mLayout.findViewById(R.id.item_visitor_photo); - - - - RelativeLayout itemVisitorFromRl = (RelativeLayout)mLayout.findViewById(R.id.item_visitor_from_rl); - - itemVisitorFromRl.setOnClickListener(new View.OnClickListener(){ - @Override - public void onClick(View view) { - Object data = getList().get(posistion); - if (data instanceof VisitorQueryItem) { - VisitorQueryItem item = (VisitorQueryItem) data; - CheckInFragment.getInstance().setVisitorInfo(item); - } - } - }); - - nameTv.setText(""); - - Object data = getList().get(posistion); - if (data instanceof VisitorQueryItem) { - VisitorQueryItem item = (VisitorQueryItem) data; - nameTv.setText(item.getName()); - - photoIv.setImageURI(Uri.parse(AppApi.IMAGEURL_BASE + item.getImagePath())); - - } - - ViewGroup.LayoutParams layoutParams = mLayout.getLayoutParams(); - mLayout.setLayoutParams(layoutParams); - } - - /** - * 琚闂瓾older - * - * @param holder - * @param posistion - */ - private void VisitorToViewHolder(EasyRecyclerViewHolder holder, final int posistion) { - LinearLayout mLayout = holder.findViewById(R.id.item_visitor_to_base); - mTvName = holder.findViewById(R.id.item_visitor_to_name); - - mToNameTv = (TextView) mTvName.findViewById(R.id.item_visitor_to_name); - mToDepartmentTv = (TextView) mTvName.findViewById(R.id.item_visitor_to_department); - mTvDepartment = holder.findViewById(R.id.item_visitor_to_department); - SimpleDraweeView photoIv = (SimpleDraweeView) mLayout.findViewById(R.id.item_visitor_to_avatar); - - Object data = getList().get(posistion); - if (data instanceof VisitorQueryItem) { - VisitorQueryItem item = (VisitorQueryItem) data; - mToNameTv.setText(item.getName()); - mTvDepartment.setText(item.getDeptName()); - photoIv.setImageURI(Uri.parse(AppApi.IMAGEURL_BASE + item.getImagePath())); - } - - RelativeLayout itemVisitorToRl = (RelativeLayout) holder.findViewById(R.id.item_visitor_to_rl); - itemVisitorToRl.setOnClickListener(new View.OnClickListener(){ - @Override - public void onClick(View view) { - Object data = getList().get(posistion); - if (data instanceof VisitorQueryItem) { - VisitorQueryItem item = (VisitorQueryItem) data; - CheckInFragment.getInstance().setIntervieweeInfo(item); - } - } - }); - - - if (mTypeColor == TYPE_DEPARTMENT) { - mTvName.setTextColor(mContext.getResources().getColor(R.color.colorText_b)); - mTvDepartment.setTextColor(mContext.getResources().getColor(R.color.colorText_5)); - } else { - mTvName.setTextColor(mContext.getResources().getColor(R.color.colorText_5)); - mTvDepartment.setTextColor(mContext.getResources().getColor(R.color.colorText_b)); - } - - } - - public void setVisitorToColor(int type) { - this.mTypeColor = type; - } -// public void setVisitorToTextColor(int type){ -// switch (type){ -// case TYPE_DEPARTMENT: -// mTvName.setTextColor(mContext.getResources().getColor(R.color.colorText_b)); -// mTvDepartment.setTextColor(mContext.getResources().getColor(R.color.colorText_5)); -// notifyDataSetChanged(); -// break; -// case TYPE_NAME: -// mTvName.setTextColor(mContext.getResources().getColor(R.color.colorText_5)); -// mTvDepartment.setTextColor(mContext.getResources().getColor(R.color.colorText_b)); -// notifyDataSetChanged(); -// break; -// } -// } -} diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/AttendanceFragment.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/AttendanceFragment.java index 40576c7..dec1439 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/AttendanceFragment.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/AttendanceFragment.java @@ -6,8 +6,8 @@ import android.widget.Toast; import com.bsk.zhangbo.demoforbsk.R; -import cn.com.basic.face.adapter.AttendanceRecyclerViewAdapter; -import cn.com.basic.face.adapter.VisitorManagerListAdapter; +import cn.com.basic.face.adapter.AttendanceAdapter; +import cn.com.basic.face.adapter.VisitAdapter; import cn.com.basic.face.base.MainUIBaseFragment; import cn.com.basic.face.base.MainActivity; @@ -26,8 +26,8 @@ public class AttendanceFragment extends MainUIBaseFragment implements EasyRecyclerViewHolder.OnItemClickListener{ private View mViewLeft,mViewRight; private EasyRecyclerView mRightRecyclerView,mLeftRecyclerView; - private AttendanceRecyclerViewAdapter mRightAdapter; - private VisitorManagerListAdapter mLeftAdapter; + private AttendanceAdapter mRightAdapter; + private VisitAdapter mLeftAdapter; public static AttendanceFragment newInstance(){ return new AttendanceFragment(); } @@ -37,7 +37,7 @@ mLeftRecyclerView = (EasyRecyclerView) mViewLeft.findViewById(R.id.visitor_manager_recycler); LinearLayoutManager manager = new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false); mLeftRecyclerView.setLayoutManager(manager); - mLeftAdapter = new VisitorManagerListAdapter(); + mLeftAdapter = new VisitAdapter(); ViewUtils.inject(this, mViewLeft); return mViewLeft; } @@ -46,7 +46,7 @@ public View addRightLayout() { mViewRight = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_attendance_right, null); mRightRecyclerView = (EasyRecyclerView) mViewRight.findViewById(R.id.attendance_recycler); - mRightAdapter = new AttendanceRecyclerViewAdapter(); + mRightAdapter = new AttendanceAdapter(); ViewUtils.inject(this, mViewRight); return mViewRight; } diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/CheckInFragment.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/CheckInFragment.java index e6e5778..11f5d61 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/CheckInFragment.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/CheckInFragment.java @@ -1,6 +1,5 @@ package cn.com.basic.face.fragment; -import android.net.Uri; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.text.Editable; @@ -9,20 +8,19 @@ import android.view.LayoutInflater; import android.view.View; import android.widget.EditText; -import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; import com.bsk.zhangbo.demoforbsk.R; -import cn.com.basic.face.adapter.VisitorRecyclerViewAdapter; + +import cn.com.basic.face.adapter.CheckInRightCellAdapter; import cn.com.basic.face.base.MainUIBaseFragment; import cn.com.basic.face.listeners.OkButtonClickedListener; import cn.com.basic.face.service.DictionaryMng; import cn.com.basic.face.service.VisitorCheckInMng; import cn.com.basic.face.base.MainActivity; -import cn.com.basic.face.util.AppApi; import cn.com.basic.face.util.Constant; import cn.com.basic.face.widget.CheckInIntervieweeCell; import cn.com.basic.face.widget.CheckInRightVisitorCell; @@ -59,7 +57,7 @@ private LinearLayout fragment_check_in_left_sort_type_linear_layout; private CheckInIntervieweeCell fragment_check_in_right_interviewee_cell; private CheckInRightVisitorCell fragment_check_in_right_visitor_cell; - private VisitorRecyclerViewAdapter mAdapter; + private CheckInRightCellAdapter mAdapter; private EasyRecyclerView fragment_check_in_left_list_view; private List mList = new ArrayList();; @@ -96,7 +94,7 @@ switch (radioGroup.getCheckedRadioButtonId()){ case R.id.fragment_check_in_left_visitor_radio: fragment_check_in_left_sort_type_linear_layout.setVisibility(View.GONE); - mAdapter = new VisitorRecyclerViewAdapter(getActivity(), Constant.VISITOR_FROM); + mAdapter = new CheckInRightCellAdapter(getActivity(), Constant.VISITOR_CELL); //mList.clear(); mAdapter.setList(mList); fragment_check_in_left_list_view.setAdapter(mAdapter); @@ -105,8 +103,8 @@ break; case R.id.fragment_check_in_left_interviewee_radio: fragment_check_in_left_sort_type_linear_layout.setVisibility(View.VISIBLE); - mAdapter = new VisitorRecyclerViewAdapter(getActivity(), Constant.VISITOR_TO); - mAdapter.setVisitorToColor(VisitorRecyclerViewAdapter.TYPE_NAME); + mAdapter = new CheckInRightCellAdapter(getActivity(), Constant.INTERVIEWEE_CELL); + mAdapter.setVisitorToColor(CheckInRightCellAdapter.TYPE_NAME); //mList.clear(); mAdapter.setList(mList); fragment_check_in_left_list_view.setAdapter(mAdapter); @@ -121,15 +119,15 @@ public void onCheckedChanged(RadioGroup radioGroup, int i) { switch (radioGroup.getCheckedRadioButtonId()){ case R.id.fragment_check_in_left_sort_by_name_radio_button: -// mAdapter.setVisitorToTextColor(VisitorRecyclerViewAdapter.TYPE_NAME); - mAdapter.setVisitorToColor(VisitorRecyclerViewAdapter.TYPE_NAME); +// mAdapter.setVisitorToTextColor(CheckInRightCellAdapter.TYPE_NAME); + mAdapter.setVisitorToColor(CheckInRightCellAdapter.TYPE_NAME); sort(mList, false); mAdapter.setList(mList); fragment_check_in_left_list_view.setAdapter(mAdapter); break; case R.id.fragment_check_in_left_sort_by_dept_radio_button: -// mAdapter.setVisitorToTextColor(VisitorRecyclerViewAdapter.TYPE_DEPARTMENT); - mAdapter.setVisitorToColor(VisitorRecyclerViewAdapter.TYPE_DEPARTMENT); +// mAdapter.setVisitorToTextColor(CheckInRightCellAdapter.TYPE_DEPARTMENT); + mAdapter.setVisitorToColor(CheckInRightCellAdapter.TYPE_DEPARTMENT); sort(mList, true); mAdapter.setList(mList); fragment_check_in_left_list_view.setAdapter(mAdapter); @@ -141,10 +139,8 @@ visitorRegisterSearchEt.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {} - @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {} - @Override public void afterTextChanged(Editable editable) { loadList(); @@ -193,7 +189,7 @@ fragment_check_in_left_list_view = (EasyRecyclerView) fragment_check_in_left.findViewById(R.id.fragment_check_in_left_list_view); LinearLayoutManager manager = new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false); fragment_check_in_left_list_view.setLayoutManager(manager); - mAdapter = new VisitorRecyclerViewAdapter(getActivity(),Constant.VISITOR_FROM); + mAdapter = new CheckInRightCellAdapter(getActivity(),Constant.VISITOR_CELL); ViewUtils.inject(this, fragment_check_in_left); return fragment_check_in_left; diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/HomeFragment.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/HomeFragment.java index e93d6e4..de6d8e3 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/HomeFragment.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/HomeFragment.java @@ -15,7 +15,7 @@ import android.widget.RadioGroup; import com.bsk.zhangbo.demoforbsk.R; -import cn.com.basic.face.adapter.OneBottomRecylerViewAdapter; +import cn.com.basic.face.adapter.HomeAdapter; import cn.com.basic.face.base.BaseFragment; import cn.com.basic.face.service.VisitorCheckInMng; import cn.com.basic.face.util.RtspFaceNative; @@ -40,7 +40,7 @@ private RadioGroup mRadioGroup; private RadioButton mRadioButton1, mRadioButton2; private View mRadioLine1, mRadioLine2; - private OneBottomRecylerViewAdapter mAdapter; + private HomeAdapter mAdapter; private List mList; private EasyRecyclerView mRecyclerViewRegister, mRecyclerViewUser; @@ -93,7 +93,7 @@ GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 2); gridLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL); mRecyclerViewRegister.setLayoutManager(gridLayoutManager); - mAdapter = new OneBottomRecylerViewAdapter(getActivity()); + mAdapter = new HomeAdapter(getActivity()); mSurfaceView2 = (SurfaceView) view.findViewById(R.id.surfaceview2); 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 332aeb9..79cbd36 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 @@ -7,7 +7,8 @@ import android.widget.RadioGroup; import com.bsk.zhangbo.demoforbsk.R; -import cn.com.basic.face.adapter.VisitorRecyclerViewAdapter; + +import cn.com.basic.face.adapter.CheckInRightCellAdapter; import cn.com.basic.face.base.MainUIBaseFragment; import cn.com.basic.face.base.MainActivity; import cn.com.basic.face.util.Constant; @@ -30,7 +31,7 @@ private RadioGroup mRGTop,mRGClass; private LinearLayout mLlRadioGroupClass; private CheckInIntervieweeCell mVisitorTo; - private VisitorRecyclerViewAdapter mAdapter; + private CheckInRightCellAdapter mAdapter; private EasyRecyclerView mRecyclerView; private List mList; @@ -47,12 +48,12 @@ mRecyclerView = (EasyRecyclerView) mViewLeft.findViewById(R.id.fragment_check_in_left_list_view); LinearLayoutManager manager = new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false); mRecyclerView.setLayoutManager(manager); - mAdapter = new VisitorRecyclerViewAdapter(getActivity(),Constant.VISITOR_FROM); + mAdapter = new CheckInRightCellAdapter(getActivity(),Constant.VISITOR_CELL); ViewUtils.inject(this, mViewLeft); mLlRadioGroupClass.setVisibility(View.VISIBLE); - mAdapter = new VisitorRecyclerViewAdapter(getActivity(), Constant.VISITOR_TO); - mAdapter.setVisitorToColor(VisitorRecyclerViewAdapter.TYPE_NAME); + mAdapter = new CheckInRightCellAdapter(getActivity(), Constant.INTERVIEWEE_CELL); + mAdapter.setVisitorToColor(CheckInRightCellAdapter.TYPE_NAME); mAdapter.setList(mList); mRecyclerView.setAdapter(mAdapter); @@ -75,14 +76,14 @@ switch (radioGroup.getCheckedRadioButtonId()){ case R.id.fragment_check_in_left_visitor_radio: mLlRadioGroupClass.setVisibility(View.GONE); - mAdapter = new VisitorRecyclerViewAdapter(getActivity(), Constant.VISITOR_FROM); + mAdapter = new CheckInRightCellAdapter(getActivity(), Constant.VISITOR_CELL); mAdapter.setList(mList); mRecyclerView.setAdapter(mAdapter); break; case R.id.fragment_check_in_left_interviewee_radio: mLlRadioGroupClass.setVisibility(View.VISIBLE); - mAdapter = new VisitorRecyclerViewAdapter(getActivity(), Constant.VISITOR_TO); - mAdapter.setVisitorToColor(VisitorRecyclerViewAdapter.TYPE_NAME); + mAdapter = new CheckInRightCellAdapter(getActivity(), Constant.INTERVIEWEE_CELL); + mAdapter.setVisitorToColor(CheckInRightCellAdapter.TYPE_NAME); mAdapter.setList(mList); mRecyclerView.setAdapter(mAdapter); break; @@ -94,14 +95,14 @@ public void onCheckedChanged(RadioGroup radioGroup, int i) { switch (radioGroup.getCheckedRadioButtonId()){ case R.id.fragment_check_in_left_sort_by_name_radio_button: -// mAdapter.setVisitorToTextColor(VisitorRecyclerViewAdapter.TYPE_NAME); - mAdapter.setVisitorToColor(VisitorRecyclerViewAdapter.TYPE_NAME); +// mAdapter.setVisitorToTextColor(CheckInRightCellAdapter.TYPE_NAME); + mAdapter.setVisitorToColor(CheckInRightCellAdapter.TYPE_NAME); mAdapter.setList(mList); mRecyclerView.setAdapter(mAdapter); break; case R.id.fragment_check_in_left_sort_by_dept_radio_button: -// mAdapter.setVisitorToTextColor(VisitorRecyclerViewAdapter.TYPE_DEPARTMENT); - mAdapter.setVisitorToColor(VisitorRecyclerViewAdapter.TYPE_DEPARTMENT); +// mAdapter.setVisitorToTextColor(CheckInRightCellAdapter.TYPE_DEPARTMENT); + mAdapter.setVisitorToColor(CheckInRightCellAdapter.TYPE_DEPARTMENT); mAdapter.setList(mList); mRecyclerView.setAdapter(mAdapter); break; diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/VisitFragment.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/VisitFragment.java index 974e208..f687096 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/VisitFragment.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/VisitFragment.java @@ -8,7 +8,7 @@ import android.widget.Toast; import com.bsk.zhangbo.demoforbsk.R; -import cn.com.basic.face.adapter.VisitorManagerListAdapter; +import cn.com.basic.face.adapter.VisitAdapter; import cn.com.basic.face.base.MainUIBaseFragment; import cn.com.basic.face.base.MainActivity; @@ -29,7 +29,7 @@ private LinearLayout mRowLayout1,mRowLayout2,mRowLayout3,mRowLayout4,mRowLayout5,mRowLayout6,mRowLayout7; private TextView mRow1TextViewLeft,mRow1TextViewRight,mRow2TextViewLeft,mRow2TextViewRight,mRow3TextViewLeft,mRow3TextViewRight,mRow4TextViewLeft,mRow4TextViewRight, mRow5TextViewLeft,mRow5TextViewRight,mRow6TextViewLeft,mRow6TextViewRight,mRow7TextViewLeft,mRow7TextViewRight; - private VisitorManagerListAdapter mAdapter; + private VisitAdapter mAdapter; private EasyRecyclerView mRecyclerView; private int mOldPosition = 0,mNewPosition = 0; public static VisitFragment newInstance(){ @@ -44,7 +44,7 @@ mRecyclerView = (EasyRecyclerView) mViewLeft.findViewById(R.id.visitor_manager_recycler); LinearLayoutManager manager = new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false); mRecyclerView.setLayoutManager(manager); - mAdapter = new VisitorManagerListAdapter(); + mAdapter = new VisitAdapter(); ViewUtils.inject(this, mViewLeft); return mViewLeft; } diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/Constant.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/Constant.java index 116b660..3da9ebc 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/Constant.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/Constant.java @@ -5,5 +5,5 @@ */ public class Constant { - public static final int VISITOR_TO = 1,VISITOR_FROM = 2; + public static final int INTERVIEWEE_CELL = 1, VISITOR_CELL = 2; } diff --git a/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_check_in_left_interviewee_row.xml b/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_check_in_left_interviewee_row.xml index 1b8ac6f..fe00beb 100644 --- a/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_check_in_left_interviewee_row.xml +++ b/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_check_in_left_interviewee_row.xml @@ -1,38 +1,38 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:fresco="http://schemas.android.com/apk/res-auto" - android:id="@+id/item_visitor_to_base" + android:id="@+id/fragment_check_in_left_interviewee_row_linear_layout" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="20dp" android:paddingRight="20dp"> <RelativeLayout - android:id="@+id/item_visitor_to_rl" + android:id="@+id/fragment_check_in_left_interviewee_row_relativeLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="12dp" android:paddingBottom="12dp"> <TextView - android:id="@+id/item_visitor_to_name" + android:id="@+id/fragment_check_in_left_interviewee_row_name" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="闃垮皵娉�" + android:text="" android:layout_centerVertical="true" android:textSize="@dimen/text_size_big" android:textColor="@color/colorText_b"/> <TextView - android:id="@+id/item_visitor_to_department" + android:id="@+id/fragment_check_in_left_interviewee_row_dept" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="淇濆崼绉�" + android:text="" android:layout_centerVertical="true" - android:layout_toRightOf="@id/item_visitor_to_name" + android:layout_toRightOf="@id/fragment_check_in_left_interviewee_row_name" android:layout_marginLeft="20dp" android:textSize="@dimen/text_size_big" android:textColor="@color/colorText_5"/> <com.facebook.drawee.view.SimpleDraweeView - android:id="@+id/item_visitor_to_avatar" + android:id="@+id/fragment_check_in_left_interviewee_row_photo" android:layout_width="36dp" android:layout_height="36dp" fresco:roundAsCircle = "true" diff --git a/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_check_in_left_visitor_row.xml b/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_check_in_left_visitor_row.xml index ff0250a..b84c9aa 100644 --- a/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_check_in_left_visitor_row.xml +++ b/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_check_in_left_visitor_row.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:fresco="http://schemas.android.com/apk/res-auto" - android:id="@+id/item_visitor_from_base" + android:id="@+id/fragment_check_in_left_visitor_row_linear_layout" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" @@ -9,21 +9,21 @@ android:paddingRight="20dp"> <RelativeLayout - android:id="@+id/item_visitor_from_rl" + android:id="@+id/fragment_check_in_left_visitor_row_relative_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="12dp" android:paddingBottom="12dp"> <TextView - android:id="@+id/item_visitor_name" + android:id="@+id/fragment_check_in_left_visitor_row_name" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="闃垮皵娉�" + android:text="" android:layout_centerVertical="true" android:textSize="@dimen/text_size_big" android:textColor="@color/colorText_b"/> <com.facebook.drawee.view.SimpleDraweeView - android:id="@+id/item_visitor_photo" + android:id="@+id/fragment_check_in_left_visitor_row_photo" android:layout_width="36dp" android:layout_height="36dp" fresco:roundAsCircle = "true" diff --git a/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_home_bottom_visitor_cell.xml b/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_home_bottom_visitor_cell.xml index 2375523..b5f4d09 100644 --- a/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_home_bottom_visitor_cell.xml +++ b/VisitFace/DemoForBsk/app/src/main/res/layout/fragment_home_bottom_visitor_cell.xml @@ -5,14 +5,14 @@ android:layout_height="wrap_content"> <com.facebook.drawee.view.SimpleDraweeView - android:id="@+id/item_user_bcg" + android:id="@+id/fragment_home_bottom_visitor_cell_photo" android:layout_width="104dp" android:layout_height="127dp" android:layout_alignParentBottom="true" android:scaleType="centerCrop" android:src="@mipmap/timg"/> <TextView - android:id="@+id/item_user_warning" + android:id="@+id/fragment_home_bottom_visitor_cell_warning" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/colorRed" @@ -31,7 +31,7 @@ android:layout_alignParentBottom="true"> <TextView - android:id="@+id/item_user_name" + android:id="@+id/fragment_home_bottom_visitor_cell_name" android:layout_width="@dimen/view_size_0" android:layout_height="match_parent" android:layout_weight="1" @@ -44,7 +44,7 @@ android:layout_height="match_parent" android:background="@android:color/white"/> <TextView - android:id="@+id/item_user_status" + android:id="@+id/fragment_home_bottom_visitor_cell_status" android:layout_width="@dimen/view_size_0" android:layout_height="match_parent" android:layout_weight="1" -- Gitblit v1.8.0