mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-30 14:23:55 +01:00
Remove unused classes
This commit is contained in:
parent
511e663f9b
commit
edc17afa0a
3 changed files with 0 additions and 133 deletions
|
|
@ -1,59 +0,0 @@
|
|||
package fr.free.nrw.commons.media;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v4.content.AsyncTaskLoader;
|
||||
import android.util.Log;
|
||||
|
||||
import org.mediawiki.api.ApiResult;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import fr.free.nrw.commons.CommonsApplication;
|
||||
import fr.free.nrw.commons.Media;
|
||||
import fr.free.nrw.commons.Utils;
|
||||
|
||||
public class CategoryImagesLoader extends AsyncTaskLoader<List<Media>>{
|
||||
private final CommonsApplication app;
|
||||
private final String category;
|
||||
|
||||
public CategoryImagesLoader(Context context, String category) {
|
||||
super(context);
|
||||
this.app = (CommonsApplication) context.getApplicationContext();
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStartLoading() {
|
||||
super.onStartLoading();
|
||||
super.forceLoad();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Media> loadInBackground() {
|
||||
ArrayList<Media> mediaList = new ArrayList<>();
|
||||
ApiResult result;
|
||||
try {
|
||||
result = app.getApi().action("query")
|
||||
.param("list", "categorymembers")
|
||||
.param("cmtitle", "Category:" + category)
|
||||
.param("cmprop", "title|timestamp")
|
||||
.param("cmtype", "file")
|
||||
.param("cmsort", "timestamp")
|
||||
.param("cmdir", "descending")
|
||||
.param("cmlimit", 50)
|
||||
.get();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Log.d("Commons", Utils.getStringFromDOM(result.getDocument()));
|
||||
|
||||
List<ApiResult> members = result.getNodes("/api/query/categorymembers/cm");
|
||||
for(ApiResult member : members) {
|
||||
mediaList.add(new Media(member.getString("@title")));
|
||||
}
|
||||
return mediaList;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue