MediaWikiImageView: add javadoc

This commit is contained in:
Xiang Fan 2017-12-30 19:26:41 +08:00 committed by Nicolas Raoul
parent a38e465cd6
commit 7118234ebf

View file

@ -38,6 +38,10 @@ public class MediaWikiImageView extends SimpleDraweeView {
init();
}
/**
* Sets the media. Fetches its thumbnail if necessary.
* @param media the new media
*/
public void setMedia(Media media) {
if (currentThumbnailTask != null) {
currentThumbnailTask.cancel(true);
@ -63,6 +67,9 @@ public class MediaWikiImageView extends SimpleDraweeView {
super.onDetachedFromWindow();
}
/**
* Initializes MediaWikiImageView.
*/
private void init() {
((CommonsApplication) getContext().getApplicationContext()).injector().inject(this);
setHierarchy(GenericDraweeHierarchyBuilder
@ -74,6 +81,10 @@ public class MediaWikiImageView extends SimpleDraweeView {
.build());
}
/**
* Displays the image from the URL.
* @param url the URL of the image
*/
private void setImageUrl(@Nullable String url) {
setImageURI(url);
}