mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
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:
parent
2503f54731
commit
16913eed4e
1 changed files with 4 additions and 1 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue