File was renamed from VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/adapter/OneBottomRecylerViewAdapter.java |
| | |
| | | * 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; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // @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 |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | |
| | | 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); |
| | |
| | | |
| | | 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); |
| | |
| | | } |
| | | }); |
| | | } 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); |