use of com.zhjh.androidnews.bean.PhotoGirl in project AndroidNews by zhjohow.
the class PhotosFragment method initView.
@Override
public void initView() {
if (getArguments() != null) {
mPhotoType = getArguments().getString(AppConstant.PHOTO_TYPE);
}
adapter = new CommonRecycleViewAdapter<PhotoGirl>(getContext(), R.layout.item_photo) {
@Override
public void convert(ViewHolderHelper helper, final PhotoGirl photoGirl) {
ImageView imageView = helper.getView(R.id.iv_photo);
Glide.with(mContext).load(photoGirl.getThumbUrl()).diskCacheStrategy(DiskCacheStrategy.SOURCE).placeholder(R.drawable.ic_image_loading).error(R.drawable.ic_empty_picture).centerCrop().override(1090, 1090 * 3 / 4).crossFade().into(imageView);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
PhotosDetailActivity.startAction(mContext, photoGirl.getThumbUrl());
}
});
}
};
irc.setAdapter(adapter);
irc.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
irc.setOnLoadMoreListener(this);
irc.setOnRefreshListener(this);
// fab.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// irc.smoothScrollToPosition(0);
// }
// });
mPresenter.getPhotosListDataRequest(mPhotoType, SIZE, mStartPage);
}
Aggregations