|
|
@ -163,7 +163,7 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
|
|
|
|
filterCounts.put(filter, size);
|
|
|
|
filterCounts.put(filter, size);
|
|
|
|
activity.runOnUiThread(new Runnable() {
|
|
|
|
activity.runOnUiThread(new Runnable() {
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
notifyDataSetInvalidated();
|
|
|
|
notifyDataSetChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
@ -181,7 +181,7 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void add(Filter item) {
|
|
|
|
public void add(Filter item) {
|
|
|
|
super.add(item);
|
|
|
|
super.add(item);
|
|
|
|
|
|
|
|
notifyDataSetChanged();
|
|
|
|
// load sizes
|
|
|
|
// load sizes
|
|
|
|
offerFilter(item);
|
|
|
|
offerFilter(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -197,7 +197,7 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int newCount = Math.max(filterCount + delta, 0);
|
|
|
|
int newCount = Math.max(filterCount + delta, 0);
|
|
|
|
filterCounts.put(filter, newCount);
|
|
|
|
filterCounts.put(filter, newCount);
|
|
|
|
notifyDataSetInvalidated();
|
|
|
|
notifyDataSetChanged();
|
|
|
|
return newCount;
|
|
|
|
return newCount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -209,6 +209,23 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
|
|
|
|
return adjustFilterCount(filter, -1);
|
|
|
|
return adjustFilterCount(filter, -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void refreshFilterCount(final Filter filter) {
|
|
|
|
|
|
|
|
filterExecutor.submit(new Runnable() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
int size = taskService.countTasks(filter);
|
|
|
|
|
|
|
|
filterCounts.put(filter, size);
|
|
|
|
|
|
|
|
activity.runOnUiThread(new Runnable() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
notifyDataSetChanged();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Create or reuse a view
|
|
|
|
* Create or reuse a view
|
|
|
|
* @param convertView
|
|
|
|
* @param convertView
|
|
|
|