xuxiuxi
2017-03-29 d17be73f53c21c5ceae03fe8494c195f0bbf4abf
VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/adapter/VisitorRecyclerViewAdapter.java
@@ -45,22 +45,9 @@
    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
@@ -126,7 +113,7 @@
            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()));
        }
@@ -141,17 +128,20 @@
     * @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);