|
|
|
@ -83,6 +83,7 @@ public class TagListSubActivity extends SubActivity {
|
|
|
|
HashMap<TagModelForView, Integer> tagToTaskCount;
|
|
|
|
HashMap<TagModelForView, Integer> tagToTaskCount;
|
|
|
|
private Handler handler;
|
|
|
|
private Handler handler;
|
|
|
|
private TextView loadingText;
|
|
|
|
private TextView loadingText;
|
|
|
|
|
|
|
|
private boolean untaggedTagDisplayed;
|
|
|
|
|
|
|
|
|
|
|
|
private static SortMode sortMode = SortMode.SIZE;
|
|
|
|
private static SortMode sortMode = SortMode.SIZE;
|
|
|
|
private static boolean sortReverse = false;
|
|
|
|
private static boolean sortReverse = false;
|
|
|
|
@ -164,9 +165,12 @@ public class TagListSubActivity extends SubActivity {
|
|
|
|
// show "untagged" as a category at the top, in the proper language/localization
|
|
|
|
// show "untagged" as a category at the top, in the proper language/localization
|
|
|
|
String untaggedLabel = getResources().getString(R.string.tagList_untagged);
|
|
|
|
String untaggedLabel = getResources().getString(R.string.tagList_untagged);
|
|
|
|
TagModelForView untaggedModel = TagModelForView.getUntaggedModel(untaggedLabel);
|
|
|
|
TagModelForView untaggedModel = TagModelForView.getUntaggedModel(untaggedLabel);
|
|
|
|
tagArray.addFirst(untaggedModel);
|
|
|
|
|
|
|
|
int count = countActiveTasks(activeTasks, getTagController().getUntaggedTasks());
|
|
|
|
int count = countActiveTasks(activeTasks, getTagController().getUntaggedTasks());
|
|
|
|
tagToTaskCount.put(untaggedModel, count);
|
|
|
|
if(count > 0) {
|
|
|
|
|
|
|
|
untaggedTagDisplayed = true;
|
|
|
|
|
|
|
|
tagArray.addFirst(untaggedModel);
|
|
|
|
|
|
|
|
tagToTaskCount.put(untaggedModel, count);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(sortReverse)
|
|
|
|
if(sortReverse)
|
|
|
|
Collections.reverse(tagArray);
|
|
|
|
Collections.reverse(tagArray);
|
|
|
|
@ -208,10 +212,13 @@ public class TagListSubActivity extends SubActivity {
|
|
|
|
private void setUpListUI(ListAdapter adapter) {
|
|
|
|
private void setUpListUI(ListAdapter adapter) {
|
|
|
|
// set up the title
|
|
|
|
// set up the title
|
|
|
|
Resources r = getResources();
|
|
|
|
Resources r = getResources();
|
|
|
|
|
|
|
|
int tags = tagArray.size();
|
|
|
|
|
|
|
|
if(untaggedTagDisplayed)
|
|
|
|
|
|
|
|
tags--;
|
|
|
|
StringBuilder title = new StringBuilder().
|
|
|
|
StringBuilder title = new StringBuilder().
|
|
|
|
append(r.getString(R.string.tagList_titlePrefix)).
|
|
|
|
append(r.getString(R.string.tagList_titlePrefix)).
|
|
|
|
append(" ").append(r.getQuantityString(R.plurals.Ntags,
|
|
|
|
append(" ").append(r.getQuantityString(R.plurals.Ntags,
|
|
|
|
tagArray.size(), tagArray.size()));
|
|
|
|
tags, tags));
|
|
|
|
final CharSequence finalTitle = title;
|
|
|
|
final CharSequence finalTitle = title;
|
|
|
|
handler.post(new Runnable() {
|
|
|
|
handler.post(new Runnable() {
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
@ -439,7 +446,7 @@ public class TagListSubActivity extends SubActivity {
|
|
|
|
name.setText(new StringBuilder(tag.getName()).
|
|
|
|
name.setText(new StringBuilder(tag.getName()).
|
|
|
|
append(" (").append(tagCount.get(tag)).append(")"));
|
|
|
|
append(" (").append(tagCount.get(tag)).append(")"));
|
|
|
|
|
|
|
|
|
|
|
|
if(tagCount.get(tag) == 0)
|
|
|
|
if(tagCount == null || tagCount.get(tag) == null || tagCount.get(tag) == 0)
|
|
|
|
name.setTextColor(r.getColor(R.color.task_list_done));
|
|
|
|
name.setTextColor(r.getColor(R.color.task_list_done));
|
|
|
|
else
|
|
|
|
else
|
|
|
|
name.setTextColor(r.getColor(android.R.color.white));
|
|
|
|
name.setTextColor(r.getColor(android.R.color.white));
|
|
|
|
|