Reversed completed task ordering.

pull/14/head
Tim Su 16 years ago
parent 33ea2a1f43
commit da02524fa9

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.timsu.astrid"
android:versionCode="27"
android:versionName="1.9.2">
android:versionCode="28"
android:versionName="1.9.3">
<uses-permission android:name="android.permission.VIBRATE"/>

@ -92,6 +92,7 @@ public class TaskModelForList extends AbstractTaskModel {
System.currentTimeMillis())/1000/3600;
if(hoursLeft < 5*24)
weight += (hoursLeft - 5*24);
weight -= 20;
}
// looming preferred deadline
@ -100,15 +101,16 @@ public class TaskModelForList extends AbstractTaskModel {
System.currentTimeMillis())/1000/3600;
if(hoursLeft < 5*24)
weight += (hoursLeft - 5*24)/2;
weight -= 10;
}
// bubble completed tasks to the bottom
if(isTaskCompleted()) {
if(getCompletionDate() == null)
weight += 5e6;
weight += 20000;
else
weight = (int)Math.max(5e6 - (System.currentTimeMillis() -
getCompletionDate().getTime()) / 1000, 5000);
weight = (int)Math.max(10000 + (System.currentTimeMillis() -
getCompletionDate().getTime()) / 1000, 10000);
return weight;
}

Loading…
Cancel
Save