use of com.github.obsessive.library.pla.PLAImageView in project SimplifyReader by chentao0707.
the class ImagesListFragment method initViewsAndEvents.
@Override
protected void initViewsAndEvents() {
mListViewAdapter = new ListViewDataAdapter<ImagesListEntity>(new ViewHolderCreator<ImagesListEntity>() {
@Override
public ViewHolderBase<ImagesListEntity> createViewHolder(int position) {
return new ViewHolderBase<ImagesListEntity>() {
PLAImageView mItemImage;
@Override
public View createView(LayoutInflater layoutInflater) {
View convertView = layoutInflater.inflate(R.layout.list_item_images_list, null);
mItemImage = ButterKnife.findById(convertView, R.id.list_item_images_list_image);
return convertView;
}
@Override
public void showData(int position, ImagesListEntity itemData) {
int width = itemData.getThumbnailWidth();
int height = itemData.getThumbnailHeight();
String imageUrl = itemData.getThumbnailUrl();
if (!CommonUtils.isEmpty(imageUrl)) {
ImageLoader.getInstance().displayImage(imageUrl, mItemImage);
}
mItemImage.setImageWidth(width);
mItemImage.setImageHeight(height);
}
};
}
});
mListView.setOnItemClickListener(this);
mListView.setOnLoadMoreListener(this);
mListView.setAdapter(mListViewAdapter);
mSwipeRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.gplus_color_1), getResources().getColor(R.color.gplus_color_2), getResources().getColor(R.color.gplus_color_3), getResources().getColor(R.color.gplus_color_4));
mSwipeRefreshLayout.setOnRefreshListener(this);
}
Aggregations