Search in sources :

Example 1 with Meizhi

use of me.drakeet.meizhi.data.entity.Meizhi in project Meizhi by drakeet.

the class MeizhiListAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(final ViewHolder viewHolder, final int position) {
    Meizhi meizhi = mList.get(position);
    int limit = 48;
    String text = meizhi.desc.length() > limit ? meizhi.desc.substring(0, limit) + "..." : meizhi.desc;
    viewHolder.meizhi = meizhi;
    viewHolder.titleView.setText(text);
    viewHolder.card.setTag(meizhi.desc);
    Glide.with(mContext).load(meizhi.url).centerCrop().into(viewHolder.meizhiView).getSize((width, height) -> {
        if (!viewHolder.card.isShown()) {
            viewHolder.card.setVisibility(View.VISIBLE);
        }
    });
}
Also used : Meizhi(me.drakeet.meizhi.data.entity.Meizhi)

Aggregations

Meizhi (me.drakeet.meizhi.data.entity.Meizhi)1