Search in sources :

Example 1 with StfalconImageViewer

use of com.stfalcon.imageviewer.StfalconImageViewer in project android-client by GenesisVision.

the class CreatePostActivity method showImageViewer.

@Override
public void showImageViewer(ImageView imageView, int position, List<NewPostImage> images) {
    ImageViewerOverlayView overlayView = new ImageViewerOverlayView(this);
    overlayView.setImagesCount(images.size());
    StfalconImageViewer imageViewer = new StfalconImageViewer.Builder<>(this, images, (loadingImageView, image) -> Glide.with(this).load(ImageUtils.getImageUriById(image.getImage())).into(loadingImageView)).withStartPosition(position).withHiddenStatusBar(false).withTransitionFrom(imageView).withOverlayView(overlayView).withImageChangeListener(overlayView).show();
    overlayView.setImageViewer(imageViewer);
}
Also used : StfalconImageViewer(com.stfalcon.imageviewer.StfalconImageViewer) ImageViewerOverlayView(vision.genesis.clientapp.ui.ImageViewerOverlayView)

Example 2 with StfalconImageViewer

use of com.stfalcon.imageviewer.StfalconImageViewer in project android-client by GenesisVision.

the class PostDetailsActivity method showImageViewer.

@Override
public void showImageViewer(ImageView imageView, int position, List<NewPostImage> images) {
    ImageViewerOverlayView overlayView = new ImageViewerOverlayView(this);
    overlayView.setImagesCount(images.size());
    StfalconImageViewer imageViewer = new StfalconImageViewer.Builder<>(this, images, (loadingImageView, image) -> Glide.with(this).load(ImageUtils.getImageUriById(image.getImage())).into(loadingImageView)).withStartPosition(position).withHiddenStatusBar(false).withTransitionFrom(imageView).withOverlayView(overlayView).withImageChangeListener(overlayView).show();
    overlayView.setImageViewer(imageViewer);
}
Also used : StfalconImageViewer(com.stfalcon.imageviewer.StfalconImageViewer) ImageViewerOverlayView(vision.genesis.clientapp.ui.ImageViewerOverlayView)

Example 3 with StfalconImageViewer

use of com.stfalcon.imageviewer.StfalconImageViewer in project android-client by GenesisVision.

the class SocialPostView method onPostImageClicked.

@Override
public void onPostImageClicked(ImageView imageView, String imageUrl, int position, UUID postId) {
    if (post != null && post.getId().equals(postId)) {
        ArrayList<String> images = new ArrayList<>();
        for (PostImage image : post.getImages()) {
            for (PostImageResize resize : image.getResizes()) {
                if (resize.getQuality().equals(ImageQuality.ORIGINAL)) {
                    images.add(resize.getLogoUrl());
                    break;
                }
            }
        }
        ImageViewerOverlayView overlayView = new ImageViewerOverlayView(getContext());
        overlayView.setImagesCount(images.size());
        StfalconImageViewer imageViewer = new StfalconImageViewer.Builder<>(getContext(), images, (loadingImageView, image) -> Glide.with(getContext()).load(image).into(loadingImageView)).withStartPosition(position).withHiddenStatusBar(false).withTransitionFrom(imageView).withOverlayView(overlayView).withImageChangeListener(overlayView).show();
        overlayView.setImageViewer(imageViewer);
    }
}
Also used : PostImage(io.swagger.client.model.PostImage) ArrayList(java.util.ArrayList) SpannableString(android.text.SpannableString) StfalconImageViewer(com.stfalcon.imageviewer.StfalconImageViewer) PostImageResize(io.swagger.client.model.PostImageResize)

Example 4 with StfalconImageViewer

use of com.stfalcon.imageviewer.StfalconImageViewer in project android-client by GenesisVision.

the class SocialCommentView method onPostImageClicked.

@Override
public void onPostImageClicked(ImageView imageView, String imageUrl, int position, UUID postId) {
    if (comment != null && comment.getId().equals(postId)) {
        ArrayList<String> images = new ArrayList<>();
        for (PostImage image : comment.getImages()) {
            for (PostImageResize resize : image.getResizes()) {
                if (resize.getQuality().equals(ImageQuality.ORIGINAL)) {
                    images.add(resize.getLogoUrl());
                    break;
                }
            }
        }
        ImageViewerOverlayView overlayView = new ImageViewerOverlayView(getContext());
        overlayView.setImagesCount(images.size());
        StfalconImageViewer imageViewer = new StfalconImageViewer.Builder<>(getContext(), images, (loadingImageView, image) -> Glide.with(getContext()).load(image).into(loadingImageView)).withStartPosition(position).withHiddenStatusBar(false).withTransitionFrom(imageView).withOverlayView(overlayView).withImageChangeListener(overlayView).show();
        overlayView.setImageViewer(imageViewer);
    }
}
Also used : PostImage(io.swagger.client.model.PostImage) ArrayList(java.util.ArrayList) SpannableString(android.text.SpannableString) StfalconImageViewer(com.stfalcon.imageviewer.StfalconImageViewer) PostImageResize(io.swagger.client.model.PostImageResize)

Aggregations

StfalconImageViewer (com.stfalcon.imageviewer.StfalconImageViewer)4 SpannableString (android.text.SpannableString)2 PostImage (io.swagger.client.model.PostImage)2 PostImageResize (io.swagger.client.model.PostImageResize)2 ArrayList (java.util.ArrayList)2 ImageViewerOverlayView (vision.genesis.clientapp.ui.ImageViewerOverlayView)2