| | |
| | | private TextView mToNameTv;
|
| | | private TextView mToDepartmentTv;
|
| | |
|
| | | private ImageLoader imageLoader = null;
|
| | | private DisplayImageOptions options = null;
|
| | |
|
| | | public VisitorRecyclerViewAdapter(Context mContext, int type) {
|
| | | this.mContext = mContext;
|
| | | this.type = type;
|
| | | options = new DisplayImageOptions.Builder()
|
| | | // .showImageOnLoading(R.drawable.zhanwei)
|
| | | // .showImageForEmptyUri(R.drawable.zhanwei)
|
| | | // .showImageOnFail(R.drawable.zhanwei).cacheInMemory(false)
|
| | | .cacheOnDisc(true).considerExifParams(true)
|
| | | .displayer(new FadeInBitmapDisplayer(500))
|
| | | .bitmapConfig(Bitmap.Config.ALPHA_8) // default 设置图片的解码类型
|
| | | .build();
|
| | | imageLoader = ImageLoader.getInstance();
|
| | | imageLoader.init(ImageLoaderConfiguration.createDefault(MainActivity.getInstance()));
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | VisitorQueryItem item = (VisitorQueryItem) data;
|
| | | nameTv.setText(item.getName());
|
| | |
|
| | | photoIv.setImageURI(Uri.parse("https://i.imgur.com/tGbaZCY.jpg"));
|
| | | photoIv.setImageURI(Uri.parse(AppApi.CHENXINGGROUND_IMAGEURL_BASE + item.getImagePath()));
|
| | |
|
| | | }
|
| | |
|
| | |
| | | * @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.CHENXINGGROUND_IMAGEURL_BASE + item.getImagePath()));
|
| | | }
|
| | |
|
| | | RelativeLayout itemVisitorToRl = (RelativeLayout) holder.findViewById(R.id.item_visitor_to_rl);
|