Permalink
Browse files

change a bit the signature of the methods .. using preview as idea fo…

…r the preloading image
  • Loading branch information...
1 parent cd052d7 commit e75f01c71ba80e9f35fa6905a9bf9a71f3ee020a @luigi-agosti luigi-agosti committed May 2, 2012
@@ -45,9 +45,9 @@ public void load(ImageView imageView) {
w.setBitmap(b);
return;
}
- String thumbUrl = w.getThumbUrl();
+ String thumbUrl = w.getPreviewUrl();
if(thumbUrl != null) {
- b = loaderContext.getCache().get(thumbUrl, w.getThumbHeight(), w.getThumbWidth());
+ b = loaderContext.getCache().get(thumbUrl, w.getPreviewHeight(), w.getPreviewWidth());
if (b != null) {
w.setBitmap(b);
}
@@ -56,9 +56,9 @@ public void load(ImageView imageView) {
imageView.setImageBitmap(b);
return;
}
- String thumbUrl = w.getThumbUrl();
+ String thumbUrl = w.getPreviewUrl();
if(thumbUrl != null) {
- b = loaderContext.getCache().get(thumbUrl, w.getThumbHeight(), w.getThumbWidth());
+ b = loaderContext.getCache().get(thumbUrl, w.getPreviewHeight(), w.getPreviewWidth());
if (b != null) {
w.setBitmap(b);
}
@@ -18,13 +18,13 @@
public class ImageTag {
private String url;
- private String thumbUrl;
+ private String previewUrl;
private int loadingResourceId;
private int notFoundResourceId;
private int height;
private int width;
- private int thumbHeight;
- private int thumbWidth;
+ private int previewHeight;
+ private int previewWidth;
private boolean useOnlyCache;
private boolean saveThumbnail;
@@ -34,7 +34,7 @@ public ImageTag(String url, int loadingResourceId, int notFoundResourceId, int w
this.notFoundResourceId = notFoundResourceId;
this.width = width;
this.height = height;
- this.setThumbUrl(thumbUrl);
+ this.setPreviewUrl(previewUrl);
}
public String getUrl() {
@@ -73,28 +73,28 @@ public void setSaveThumbnail(boolean saveThumbnail) {
this.saveThumbnail = saveThumbnail;
}
- public String getThumbUrl() {
- return thumbUrl;
+ public String getPreviewUrl() {
+ return previewUrl;
}
- public void setThumbUrl(String thumbUrl) {
- this.thumbUrl = thumbUrl;
+ public void setPreviewUrl(String previewUrl) {
+ this.previewUrl = previewUrl;
}
- public int getThumbWidth() {
- return thumbWidth;
+ public int getPreviewWidth() {
+ return previewWidth;
}
- public void setThumbWidth(int thumbWidth) {
- this.thumbWidth = thumbWidth;
+ public void setPreviewWidth(int previewWidth) {
+ this.previewWidth = previewWidth;
}
- public int getThumbHeight() {
- return thumbHeight;
+ public int getPreviewHeight() {
+ return previewHeight;
}
- public void setThumbHeight(int thumbHeight) {
- this.thumbHeight = thumbHeight;
+ public void setPreviewHeight(int previewHeight) {
+ this.previewHeight = previewHeight;
}
}
@@ -22,15 +22,15 @@
public class ImageTagFactory {
- private int thumbWidth;
- private int thumbHeight;
+ private int previewImageWidth;
+ private int previewImageHeight;
private int width;
private int height;
private int defaultImageResId;
private int errorImageResId;
private boolean useOnlyCache;
private boolean saveThumbnail;
- private boolean useSameUrlForThumbnail;
+ private boolean useSameUrlForPreviewImage;
public ImageTagFactory(int width, int height, int defaultImageResId) {
this.width = width;
@@ -49,10 +49,10 @@ public ImageTagFactory(Context context, int defaultImageResId) {
this.errorImageResId = defaultImageResId;
}
- public void useThumbnailOnPreload(int thumbWidth, int thumbHeight, boolean useSameUrl) {
- this.thumbWidth = thumbWidth;
- this.thumbHeight = thumbHeight;
- this.useSameUrlForThumbnail = useSameUrl;
+ public void usePreviewImage(int previewImageWidth, int previewImageHeight, boolean useSameUrlForPreviewImage) {
+ this.previewImageWidth = previewImageWidth;
+ this.previewImageHeight = previewImageHeight;
+ this.useSameUrlForPreviewImage = useSameUrlForPreviewImage;
}
public void setErrorImageId(int errorImageResId) {
@@ -71,11 +71,11 @@ public ImageTag build(String url) {
ImageTag it = new ImageTag(url, defaultImageResId, errorImageResId, width, height);
it.setUseOnlyCache(useOnlyCache);
it.setSaveThumbnail(saveThumbnail);
- if(useSameUrlForThumbnail) {
- it.setThumbUrl(url);
+ if(useSameUrlForPreviewImage) {
+ it.setPreviewUrl(url);
}
- it.setThumbHeight(thumbHeight);
- it.setThumbWidth(thumbWidth);
+ it.setPreviewHeight(previewImageHeight);
+ it.setPreviewWidth(previewImageWidth);
return it;
}
@@ -25,11 +25,11 @@
public class ImageWrapper {
private String url;
- private String thumbUrl;
+ private String previewUrl;
private int width;
private int height;
- private int thumbWidth;
- private int thumbHeight;
+ private int previewWidth;
+ private int previewHeight;
private int loadingResourceId;
private int notFoundResourceId;
private boolean isUseCacheOnly;
@@ -48,13 +48,13 @@ public ImageWrapper(ImageView imageView) {
this.isUseCacheOnly = tag.isUseOnlyCache();
this.height = tag.getHeight();
this.width = tag.getWidth();
- this.thumbWidth = tag.getThumbHeight();
- this.thumbWidth = tag.getThumbWidth();
+ this.previewHeight = tag.getPreviewHeight();
+ this.previewWidth = tag.getPreviewWidth();
this.saveThumbnail = tag.isSaveThumbnail();
if (notFoundResourceId == 0) {
this.notFoundResourceId = tag.getLoadingResourceId();
}
- this.thumbUrl = tag.getThumbUrl();
+ this.previewUrl = tag.getPreviewUrl();
}
public String getCurrentUrl() {
@@ -115,16 +115,16 @@ public void setSaveThumbnail(boolean saveThumbnail) {
this.saveThumbnail = saveThumbnail;
}
- public String getThumbUrl() {
- return thumbUrl;
+ public String getPreviewUrl() {
+ return previewUrl;
}
- public int getThumbWidth() {
- return thumbWidth;
+ public int getPreviewWidth() {
+ return previewWidth;
}
- public int getThumbHeight() {
- return thumbHeight;
+ public int getPreviewHeight() {
+ return previewHeight;
}
}

0 comments on commit e75f01c

Please sign in to comment.