mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Stub adapter for the recent cats view...
This commit is contained in:
parent
0e23531f59
commit
fd1de3cdd8
1 changed files with 27 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ package org.wikimedia.commons;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
|
|
@ -18,6 +19,8 @@ import com.actionbarsherlock.view.Menu;
|
|||
import com.actionbarsherlock.view.MenuItem;
|
||||
import org.mediawiki.api.ApiResult;
|
||||
import org.mediawiki.api.MWApi;
|
||||
import org.wikimedia.commons.category.Category;
|
||||
import org.wikimedia.commons.contributions.Contribution;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
|
|
@ -201,6 +204,30 @@ public class CategorizationFragment extends SherlockFragment{
|
|||
}
|
||||
}
|
||||
|
||||
private class RecentCategoriesAdapter extends CursorAdapter {
|
||||
|
||||
public RecentCategoriesAdapter(Context context, Cursor c, int flags) {
|
||||
super(context, c, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View newView(Context context, Cursor cursor, ViewGroup viewGroup) {
|
||||
return getSherlockActivity().getLayoutInflater().inflate(R.layout.layout_categories_item, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindView(View view, Context context, Cursor cursor) {
|
||||
CheckedTextView checkedView;
|
||||
|
||||
Category category = Category.fromCursor(cursor);
|
||||
checkedView = (CheckedTextView) view;
|
||||
|
||||
checkedView.setChecked(false);
|
||||
checkedView.setText(category.getName());
|
||||
checkedView.setTag(category.getName());
|
||||
}
|
||||
}
|
||||
|
||||
public int getCurrentSelectedCount() {
|
||||
int count = 0;
|
||||
for(CategoryItem item: categoriesAdapter.getItems()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue