use of com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener in project Slide by ccrama.
the class Image method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.submission_imagecard, container, false);
final SubsamplingScaleImageView image = (SubsamplingScaleImageView) rootView.findViewById(R.id.image);
TextView title = (TextView) rootView.findViewById(R.id.title);
TextView desc = (TextView) rootView.findViewById(R.id.desc);
title.setVisibility(View.GONE);
desc.setVisibility(View.GONE);
((Reddit) getContext().getApplicationContext()).getImageLoader().loadImage(url, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
image.setImage(ImageSource.bitmap(loadedImage));
}
});
return rootView;
}
use of com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener in project NewPipe by TeamNewPipe.
the class VideoDetailFragment method initThumbnailViews.
private void initThumbnailViews(@NonNull StreamInfo info) {
thumbnailImageView.setImageResource(R.drawable.dummy_thumbnail_dark);
if (!TextUtils.isEmpty(info.getThumbnailUrl())) {
final String infoServiceName = NewPipe.getNameOfService(info.getServiceId());
final ImageLoadingListener onFailListener = new SimpleImageLoadingListener() {
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
showSnackBarError(failReason.getCause(), UserAction.LOAD_IMAGE, infoServiceName, imageUri, R.string.could_not_load_thumbnails);
}
};
imageLoader.displayImage(info.getThumbnailUrl(), thumbnailImageView, ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS, onFailListener);
}
if (!TextUtils.isEmpty(info.getUploaderAvatarUrl())) {
imageLoader.displayImage(info.getUploaderAvatarUrl(), uploaderThumb, ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
}
}
use of com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener in project BlogSource by TeachCourse.
the class DownloadImgAPI method setImageViewSize.
/**
* 指定加载图片的大小
*
* @param imageView
* @param url
*/
public static void setImageViewSize(final ImageView imageView, String url) {
ImageSize targetSize = new ImageSize(80, 50);
App.getApplication().getImageLoader().loadImage(url, targetSize, options, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
imageView.setImageBitmap(loadedImage);
}
});
}
use of com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener in project ForPDA by RadiationX.
the class PanelItemAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
ButtonData item = items.get(position);
if (type == TYPE_ASSET) {
ImageLoader.getInstance().loadImage(urlsToAssets.get(position), new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
holder.button.setImageBitmap(loadedImage);
}
});
} else if (type == TYPE_DRAWABLE) {
holder.button.setImageDrawable(App.getVecDrawable(holder.itemView.getContext(), item.getIconRes()));
// holder.button.setColorFilter(colorFilter);
}
if (item.getTitle() == null) {
holder.title.setVisibility(View.GONE);
holder.itemView.setContentDescription(item.getText());
} else {
holder.itemView.setContentDescription(item.getTitle());
holder.title.setText(item.getTitle());
holder.title.setVisibility(View.VISIBLE);
}
}
use of com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener in project ForPDA by RadiationX.
the class ImagesAdapter method loadImage.
private void loadImage(View imageLayout, int position) {
assert imageLayout != null;
CircularProgressView progressBar = (CircularProgressView) imageLayout.findViewById(R.id.progress_bar);
PhotoView photoView = (PhotoView) imageLayout.findViewById(R.id.photo_view);
if (crop)
photoView.setScaleType(ImageView.ScaleType.CENTER_CROP);
if (clickListener != null)
photoView.setOnClickListener(v -> clickListener.itemClick(v, position));
imageLoader.displayImage(urls.get(position), photoView, options, new SimpleImageLoadingListener() {
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
progressBar.setVisibility(View.GONE);
}
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
progressBar.setVisibility(View.GONE);
// delayedHide(1000);
}
@Override
public void onLoadingCancelled(String imageUri, View view) {
progressBar.setVisibility(View.GONE);
}
@Override
public void onLoadingStarted(String imageUri, View view) {
progressBar.setVisibility(View.VISIBLE);
if (progressBar.isIndeterminate()) {
progressBar.setIndeterminate(false);
progressBar.stopAnimation();
}
}
}, (s, view, i, i1) -> progressBar.setProgress((int) (100F * i / i1)));
photoView.setOnPhotoTapListener(tapListener);
}
Aggregations