Skip to content

Commit 7118234

Browse files
sfanxiangnicolas-raoul
authored andcommitted
MediaWikiImageView: add javadoc
1 parent a38e465 commit 7118234

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/src/main/java/fr/free/nrw/commons/MediaWikiImageView.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public MediaWikiImageView(Context context, AttributeSet attrs, int defStyle) {
3838
init();
3939
}
4040

41+
/**
42+
* Sets the media. Fetches its thumbnail if necessary.
43+
* @param media the new media
44+
*/
4145
public void setMedia(Media media) {
4246
if (currentThumbnailTask != null) {
4347
currentThumbnailTask.cancel(true);
@@ -63,6 +67,9 @@ protected void onDetachedFromWindow() {
6367
super.onDetachedFromWindow();
6468
}
6569

70+
/**
71+
* Initializes MediaWikiImageView.
72+
*/
6673
private void init() {
6774
((CommonsApplication) getContext().getApplicationContext()).injector().inject(this);
6875
setHierarchy(GenericDraweeHierarchyBuilder
@@ -74,6 +81,10 @@ R.drawable.ic_image_black_24dp, getContext().getTheme()))
7481
.build());
7582
}
7683

84+
/**
85+
* Displays the image from the URL.
86+
* @param url the URL of the image
87+
*/
7788
private void setImageUrl(@Nullable String url) {
7889
setImageURI(url);
7990
}

0 commit comments

Comments
 (0)