| | |
| | | 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;
|
| | |
| | | private void VisitorFromViewHolder(EasyRecyclerViewHolder holder, final int posistion) {
|
| | | LinearLayout mLayout = holder.findViewById(R.id.item_visitor_from_base);
|
| | |
|
| | | // mLayout.setOnClickListener(new View.OnClickListener(){
|
| | | // @Override
|
| | | // public void onClick(View view) {
|
| | | // Toast.makeText(MainActivity.getInstance(), "1", Toast.LENGTH_SHORT).show();
|
| | | // }
|
| | | // });
|
| | | // holder.setOnItemClickListener(new EasyRecyclerViewHolder.OnItemClickListener() {
|
| | | // @Override
|
| | | // public void onItemClick(View convertView, int position) {
|
| | | // Toast.makeText(MainActivity.getInstance(), ""+position, Toast.LENGTH_SHORT).show();
|
| | | // }
|
| | | // }, posistion);
|
| | |
|
| | | TextView nameTv = (TextView)mLayout.findViewById(R.id.item_visitor_name);
|
| | | ImageView photoIv = (ImageView)mLayout.findViewById(R.id.item_visitor_photo);
|
| | |
|
| | |
| | | itemVisitorFromRl.setOnClickListener(new View.OnClickListener(){
|
| | | @Override
|
| | | public void onClick(View view) {
|
| | | //Toast.makeText(MainActivity.getInstance(), posistion+"", Toast.LENGTH_SHORT).show();
|
| | | Object data = getList().get(posistion);
|
| | | if (data instanceof VisitorQueryItem) {
|
| | | VisitorQueryItem item = (VisitorQueryItem) data;
|
| | |
| | | * @param holder
|
| | | * @param posistion
|
| | | */
|
| | | private void VisitorToViewHolder(EasyRecyclerViewHolder holder, int posistion) {
|
| | | private void VisitorToViewHolder(EasyRecyclerViewHolder holder, final int posistion) {
|
| | | 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);
|
| | |
|
| | | Object data = getList().get(posistion);
|
| | | if (data instanceof VisitorQueryItem) {
|
| | | VisitorQueryItem item = (VisitorQueryItem) data;
|
| | | mToNameTv.setText(item.getName());
|
| | | }
|
| | |
|
| | | 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;
|
| | | VisitorRegisterFragment.getInstance().setIntervieweeInfo(item);
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | mTvDepartment = holder.findViewById(R.id.item_visitor_to_department);
|
| | | if (mTypeColor == TYPE_DEPARTMENT) {
|
| | | mTvName.setTextColor(mContext.getResources().getColor(R.color.colorText_b));
|