use of us.koller.cameraroll.ui.widget.ParallaxImageView in project Camera-Roll-Android-App by kollerlukas.
the class AlbumHolder method loadImage.
void loadImage(final ImageView image) {
if (album.getAlbumItems().size() == 0) {
Glide.with(getContext()).load(R.drawable.error_placeholder).apply(new RequestOptions().skipMemoryCache(true)).into(image);
return;
}
final AlbumItem coverImage = album.getAlbumItems().get(0);
Glide.with(getContext()).asBitmap().load(coverImage.getPath()).listener(new RequestListener<Bitmap>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {
coverImage.error = true;
if (image instanceof ParallaxImageView) {
((ParallaxImageView) image).setParallaxTranslation();
}
return false;
}
@Override
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
if (!coverImage.hasFadedIn) {
coverImage.hasFadedIn = true;
ColorFade.fadeSaturation(image);
}
if (image instanceof ParallaxImageView) {
((ParallaxImageView) image).setParallaxTranslation();
}
return false;
}
}).apply(coverImage.getGlideRequestOptions(getContext())).into(image);
}
use of us.koller.cameraroll.ui.widget.ParallaxImageView in project Camera-Roll-Android-App by kollerlukas.
the class SimpleAlbumHolder method setAlbum.
@Override
public void setAlbum(Album album) {
super.setAlbum(album);
final ImageView image = itemView.findViewById(R.id.image);
if (image instanceof ParallaxImageView) {
((ParallaxImageView) image).setParallaxTranslation();
}
loadImage(image);
}
Aggregations