Bug fixes: have tag list hide completed tasks from count, add a @ to tags.

pull/14/head
Tim Su 16 years ago
parent c792d99467
commit c6ce2d9a23

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.timsu.astrid"
android:versionCode="93"
android:versionName="2.4.8">
android:versionCode="96"
android:versionName="2.5.3-1">
<meta-data android:name="com.a0soft.gphone.aTrackDog.webURL"
android:value="http://www.weloveastrid.com" />
<meta-data android:name="com.a0soft.gphone.aTrackDog.testVersion"
android:value="73" />
android:value="94" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"/>

@ -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<TaskIdentifier> activeTasks =
getTaskController().getActiveTaskIdentifiers();
// get task count for each tag
tagToTaskCount = new HashMap<TagModelForView, Integer>();
for(TagModelForView tag : tagArray) {
LinkedList<TaskIdentifier> 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");

@ -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;

Loading…
Cancel
Save