mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
MediaWikiImageView: add javadoc
This commit is contained in:
parent
a38e465cd6
commit
7118234ebf
1 changed files with 11 additions and 0 deletions
|
|
@ -38,6 +38,10 @@ public class MediaWikiImageView extends SimpleDraweeView {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the media. Fetches its thumbnail if necessary.
|
||||||
|
* @param media the new media
|
||||||
|
*/
|
||||||
public void setMedia(Media media) {
|
public void setMedia(Media media) {
|
||||||
if (currentThumbnailTask != null) {
|
if (currentThumbnailTask != null) {
|
||||||
currentThumbnailTask.cancel(true);
|
currentThumbnailTask.cancel(true);
|
||||||
|
|
@ -63,6 +67,9 @@ public class MediaWikiImageView extends SimpleDraweeView {
|
||||||
super.onDetachedFromWindow();
|
super.onDetachedFromWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes MediaWikiImageView.
|
||||||
|
*/
|
||||||
private void init() {
|
private void init() {
|
||||||
((CommonsApplication) getContext().getApplicationContext()).injector().inject(this);
|
((CommonsApplication) getContext().getApplicationContext()).injector().inject(this);
|
||||||
setHierarchy(GenericDraweeHierarchyBuilder
|
setHierarchy(GenericDraweeHierarchyBuilder
|
||||||
|
|
@ -74,6 +81,10 @@ public class MediaWikiImageView extends SimpleDraweeView {
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays the image from the URL.
|
||||||
|
* @param url the URL of the image
|
||||||
|
*/
|
||||||
private void setImageUrl(@Nullable String url) {
|
private void setImageUrl(@Nullable String url) {
|
||||||
setImageURI(url);
|
setImageURI(url);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue