From c6ce2d9a23770596200ca156fef7b8cf3a53e7e6 Mon Sep 17 00:00:00 2001 From: Tim Su Date: Thu, 12 Mar 2009 06:39:08 +0000 Subject: [PATCH] Bug fixes: have tag list hide completed tasks from count, add a @ to tags. --- AndroidManifest.xml | 6 +++--- .../astrid/activities/TagListSubActivity.java | 14 +++++++++----- src/com/timsu/astrid/activities/TaskList.java | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index bef2c9293..bf2ce27e8 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,13 +1,13 @@ + android:versionCode="96" + android:versionName="2.5.3-1"> + android:value="94" /> diff --git a/src/com/timsu/astrid/activities/TagListSubActivity.java b/src/com/timsu/astrid/activities/TagListSubActivity.java index 3910f17e6..a7c24b31b 100644 --- a/src/com/timsu/astrid/activities/TagListSubActivity.java +++ b/src/com/timsu/astrid/activities/TagListSubActivity.java @@ -21,6 +21,7 @@ package com.timsu.astrid.activities; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; @@ -30,7 +31,6 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.res.Resources; -import android.database.Cursor; import android.database.StaleDataException; import android.graphics.drawable.BitmapDrawable; import android.net.Uri; @@ -127,15 +127,19 @@ public class TagListSubActivity extends SubActivity { private synchronized void sortTagArray() { // get all tasks - Cursor taskCursor = getTaskController().getActiveTaskListCursor(); - startManagingCursor(taskCursor); + HashSet activeTasks = + getTaskController().getActiveTaskIdentifiers(); // get task count for each tag tagToTaskCount = new HashMap(); for(TagModelForView tag : tagArray) { LinkedList tasks = getTagController().getTaggedTasks( getParent(), tag.getTagIdentifier()); - tagToTaskCount.put(tag, tasks.size()); + int count = 0; + for(TaskIdentifier task : tasks) + if(activeTasks.contains(task)) + count++; + tagToTaskCount.put(tag, count); } // do sort @@ -338,7 +342,7 @@ public class TagListSubActivity extends SubActivity { String label = tag.getName(); if(tag.shouldHideFromMainList()) label = label.substring(1); - createShortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, label); + createShortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "@" + label); createShortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON, ((BitmapDrawable)r.getDrawable(R.drawable.icon_tag)).getBitmap()); createShortcutIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT"); diff --git a/src/com/timsu/astrid/activities/TaskList.java b/src/com/timsu/astrid/activities/TaskList.java index bf25ce192..46f1ea8d2 100644 --- a/src/com/timsu/astrid/activities/TaskList.java +++ b/src/com/timsu/astrid/activities/TaskList.java @@ -71,10 +71,10 @@ public class TaskList extends Activity { private static final int FLING_DIST_THRESHOLD = 160; /** Maximum distance in the other axis for a fling */ - private static final int MAX_FLING_OTHER_AXIS = 60; + private static final int MAX_FLING_OTHER_AXIS = 100; /** Minimum velocity a fling must have to trigger motion */ - private static final int FLING_VEL_THRESHOLD = 200; + private static final int FLING_VEL_THRESHOLD = 300; // view components private ViewFlipper viewFlipper;