Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file support added #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

25 changes: 5 additions & 20 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import com.squareup.picasso.Picasso;

import java.io.File;

import ss.com.bannerslider.ImageLoadingService;

/**
Expand Down Expand Up @@ -33,4 +35,9 @@ public void loadImage(int resource, ImageView imageView) {
public void loadImage(String url, int placeHolder, int errorDrawable, ImageView imageView) {
Picasso.with(context).load(url).placeholder(placeHolder).error(errorDrawable).into(imageView);
}

@Override
public void loadImage(File file, ImageView imageView) {
Picasso.with(context).load(file).into(imageView);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import android.support.annotation.DrawableRes;
import android.widget.ImageView;

import java.io.File;

/**
* @author S.Shahini
* @since 4/4/18
Expand All @@ -14,4 +16,7 @@ public interface ImageLoadingService {
void loadImage(@DrawableRes int resource, ImageView imageView);

void loadImage(String url, @DrawableRes int placeHolder, @DrawableRes int errorDrawable, ImageView imageView);

void loadImage(File file, ImageView imageView);

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.view.View;
import android.widget.ImageView;

import java.io.File;

import ss.com.bannerslider.Slider;

public class ImageSlideViewHolder extends RecyclerView.ViewHolder {
Expand All @@ -29,4 +31,7 @@ public void bindImageSlide(String url, @DrawableRes int placeHolder, @DrawableRe
Slider.getImageLoadingService().loadImage(url, placeHolder, error, imageView);
}

public void bindImageSlide(File file) {
Slider.getImageLoadingService().loadImage(file, imageView);
}
}