| | |
| | | package com.bsk.zhangbo.demoforbsk.adapter;
|
| | |
|
| | | import android.content.Context;
|
| | | import android.view.View;
|
| | | import android.view.ViewGroup;
|
| | | import android.widget.ImageView;
|
| | | import android.widget.LinearLayout;
|
| | | import android.widget.RelativeLayout;
|
| | | import android.widget.TextView;
|
| | | import android.widget.Toast;
|
| | |
|
| | | import com.bsk.zhangbo.demoforbsk.R;
|
| | | import com.bsk.zhangbo.demoforbsk.ui.activity.MainActivity;
|
| | | import com.bsk.zhangbo.demoforbsk.ui.fragment.VisitorRegisterFragment;
|
| | | import com.bsk.zhangbo.demoforbsk.util.Constant;
|
| | | import com.camnter.easyrecyclerview.adapter.EasyRecyclerViewAdapter;
|
| | | import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder;
|
| | |
| | | * @param holder
|
| | | * @param posistion
|
| | | */
|
| | | private void VisitorFromViewHolder(EasyRecyclerViewHolder holder, int posistion) {
|
| | | 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);
|
| | |
|
| | | RelativeLayout itemVisitorFromRl = (RelativeLayout)mLayout.findViewById(R.id.item_visitor_from_rl);
|
| | |
|
| | | 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;
|
| | | VisitorRegisterFragment.getInstance().setVisitorInfo(item);
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | nameTv.setText("");
|
| | |
|
| | | Object data = getList().get(posistion);
|