Generate remote image URL if it isn't set

Since the imageURL can be generated if it isn't set, we can
generate it once and then just return it. This is overriden when
we explicitly set it if we get it back from the API

Change-Id: I55939f2d9c0c2679847ec104f8029d9e533e202b
This commit is contained in:
YuviPanda 2013-09-19 16:29:44 -07:00
parent 2503f54731
commit 16913eed4e

View file

@ -56,6 +56,9 @@ public class Media implements Parcelable {
}
public String getImageUrl() {
if(imageUrl == null) {
imageUrl = Utils.makeThumbBaseUrl(this.getFilename());
}
return imageUrl;
}
@ -100,7 +103,7 @@ public class Media implements Parcelable {
}
public String getThumbnailUrl(int width) {
return Utils.makeThumbUrl(imageUrl, filename, width);
return Utils.makeThumbUrl(getImageUrl(), getFilename(), width);
}
public int getWidth() {