More cosmetic changes: added option to colorize task list, bigger bubbles, and some changes to the label titles.

pull/14/head
Tim Su 16 years ago
parent b6f44dd53a
commit 6293161863

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

@ -85,6 +85,6 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_width="26px" android:layout_width="26px"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:paddingLeft="6dip"/> android:paddingLeft="12dip"/>
</LinearLayout> </LinearLayout>

@ -23,6 +23,10 @@
<color name="task_list_overdue">#FFFB6666</color> <color name="task_list_overdue">#FFFB6666</color>
<color name="task_list_normal">#FFFFFFFF</color> <color name="task_list_normal">#FFFFFFFF</color>
<color name="task_list_done">#ff777777</color> <color name="task_list_done">#ff777777</color>
<color name="task_list_importance_1">#ffFF8281</color>
<color name="task_list_importance_2">#ffF7F1BD</color>
<color name="task_list_importance_3">#ff597AFF</color>
<color name="task_list_importance_4">#ffB4B4B4</color>
<color name="taskList_dueDateOverdue">#FFFB6666</color> <color name="taskList_dueDateOverdue">#FFFB6666</color>
<color name="taskList_dueDate">#ffF0E89E</color> <color name="taskList_dueDate">#ffF0E89E</color>

@ -226,7 +226,9 @@ If you don\'t want to see the new task right after you complete the old one, you
<string name="key_notification_ringtone">notification_ringtone</string> <string name="key_notification_ringtone">notification_ringtone</string>
<string name="p_fontSize">font_size</string> <string name="p_fontSize">font_size</string>
<string name="p_deadlineTime">deadline_time</string> <string name="p_deadlineTime">deadline_time</string>
<string name="p_colorize">colorize</string>
<string name="prefs_category_alerts">Notifications</string>
<string name="prefs_quietStart_title">Quiet Hours Start</string> <string name="prefs_quietStart_title">Quiet Hours Start</string>
<string name="prefs_quietStart_desc">Starting hour when Astrid should be quiet (e.g. 22)</string> <string name="prefs_quietStart_desc">Starting hour when Astrid should be quiet (e.g. 22)</string>
<string name="prefs_quietEnd_title">Quiet Hours End</string> <string name="prefs_quietEnd_title">Quiet Hours End</string>
@ -235,8 +237,14 @@ If you don\'t want to see the new task right after you complete the old one, you
<string name="prefs_annoy_desc">If checked, Astrid will try a bit harder to get your attention</string> <string name="prefs_annoy_desc">If checked, Astrid will try a bit harder to get your attention</string>
<string name="prefs_notification_title">Notification Ringtone</string> <string name="prefs_notification_title">Notification Ringtone</string>
<string name="prefs_notification_desc">Choose how Astrid alerts you!</string> <string name="prefs_notification_desc">Choose how Astrid alerts you!</string>
<string name="prefs_category_appearance">Appearance</string>
<string name="prefs_fontSize_title">Task List Font</string> <string name="prefs_fontSize_title">Task List Font</string>
<string name="prefs_fontSize_desc">Font on the main listing page (i.e. 22)</string> <string name="prefs_fontSize_desc">Font on the main listing page (i.e. 22)</string>
<string name="prefs_deadlineTime_title">Default Deadline Time</string> <string name="prefs_colorize_title">Colorize Task List</string>
<string name="prefs_deadlineTime_desc"># of days from now to set new deadlines (i.e. 7)</string> <string name="prefs_colorize_desc">Different colors for different priorities</string>
<string name="prefs_category_other">Other</string>
<string name="prefs_deadlineTime_title">Default Deadlines</string>
<string name="prefs_deadlineTime_desc"># of days from now to set new deadlines</string>
</resources> </resources>

@ -1,32 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"> xmlns:android="http://schemas.android.com/apk/res/android">
<EditTextPreference
android:key="@string/p_notif_quietStart" <PreferenceCategory
android:title="@string/prefs_quietStart_title" android:title="@string/prefs_category_alerts">
android:summary="@string/prefs_quietStart_desc" /> <EditTextPreference
<EditTextPreference android:key="@string/p_notif_quietStart"
android:key="@string/p_notif_quietEnd" android:title="@string/prefs_quietStart_title"
android:title="@string/prefs_quietEnd_title" android:summary="@string/prefs_quietStart_desc" />
android:summary="@string/prefs_quietEnd_desc" /> <EditTextPreference
<CheckBoxPreference android:key="@string/p_notif_quietEnd"
android:key="@string/p_notif_annoy" android:title="@string/prefs_quietEnd_title"
android:title="@string/prefs_annoy_title" android:summary="@string/prefs_quietEnd_desc" />
android:summary="@string/prefs_annoy_desc" /> <CheckBoxPreference
<RingtonePreference android:key="@string/p_notif_annoy"
android:key="@string/key_notification_ringtone" android:title="@string/prefs_annoy_title"
android:title="@string/prefs_notification_title" android:summary="@string/prefs_annoy_desc" />
android:summary="@string/prefs_notification_desc" <RingtonePreference
android:ringtoneType="notification" android:key="@string/key_notification_ringtone"
android:showDefault="true" android:title="@string/prefs_notification_title"
android:showSilent="true" android:summary="@string/prefs_notification_desc"
/> android:ringtoneType="notification"
<EditTextPreference android:showDefault="true"
android:key="@string/p_fontSize" android:showSilent="true"
android:title="@string/prefs_fontSize_title" />
android:summary="@string/prefs_fontSize_desc" /> </PreferenceCategory>
<EditTextPreference
android:key="@string/p_deadlineTime" <PreferenceCategory
android:title="@string/prefs_deadlineTime_title" android:title="@string/prefs_category_appearance">
android:summary="@string/prefs_deadlineTime_desc" /> <CheckBoxPreference
android:key="@string/p_colorize"
android:title="@string/prefs_colorize_title"
android:summary="@string/prefs_colorize_desc" />
<EditTextPreference
android:key="@string/p_fontSize"
android:title="@string/prefs_fontSize_title"
android:summary="@string/prefs_fontSize_desc" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/prefs_category_other">
<EditTextPreference
android:key="@string/p_deadlineTime"
android:title="@string/prefs_deadlineTime_title"
android:summary="@string/prefs_deadlineTime_desc" />
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

@ -280,7 +280,7 @@ public class TaskListAdapter extends ArrayAdapter<TaskModelForList> {
progress.setButtonDrawable(R.drawable.btn_check0); progress.setButtonDrawable(R.drawable.btn_check0);
} else { } else {
name.setBackgroundDrawable(null); name.setBackgroundDrawable(null);
name.setTextColor(r.getColor(task.getTaskColorResource())); name.setTextColor(r.getColor(task.getTaskColorResource(getContext())));
if(task.getProgressPercentage() >= 75) if(task.getProgressPercentage() >= 75)
progress.setButtonDrawable(R.drawable.btn_check75); progress.setButtonDrawable(R.drawable.btn_check75);

@ -24,22 +24,36 @@ import com.timsu.astrid.R;
public enum Importance { public enum Importance {
// MOST IMPORTANT // MOST IMPORTANT
LEVEL_1(R.string.importance_1, R.color.importance_1, R.drawable.bullet_red), LEVEL_1(R.string.importance_1,
LEVEL_2(R.string.importance_2, R.color.importance_2, R.drawable.bullet_orange), R.color.importance_1,
LEVEL_3(R.string.importance_3, R.color.importance_3, R.drawable.bullet_blue), R.color.task_list_importance_1,
LEVEL_4(R.string.importance_4, R.color.importance_4, R.drawable.bullet_white), R.drawable.bubble_red),
LEVEL_2(R.string.importance_2,
R.color.importance_2,
R.color.task_list_importance_2,
R.drawable.bubble_yellow),
LEVEL_3(R.string.importance_3,
R.color.importance_3,
R.color.task_list_importance_3,
R.drawable.bubble_blue),
LEVEL_4(R.string.importance_4,
R.color.importance_4,
R.color.task_list_importance_4,
R.drawable.bubble_gray),
// LEAST IMPORTANT // LEAST IMPORTANT
; ;
int label; int label;
int color; int color;
int taskListColor;
int icon; int icon;
public static final Importance DEFAULT = LEVEL_3; public static final Importance DEFAULT = LEVEL_3;
private Importance(int label, int color, int icon) { private Importance(int label, int color, int taskListColor, int icon) {
this.label = label; this.label = label;
this.color = color; this.color = color;
this.taskListColor = taskListColor;
this.icon = icon; this.icon = icon;
} }
@ -51,6 +65,10 @@ public enum Importance {
return color; return color;
} }
public int getTaskListColor() {
return taskListColor;
}
public int getIconResource() { public int getIconResource() {
return icon; return icon;
} }

@ -33,6 +33,7 @@ import com.timsu.astrid.data.AbstractController;
import com.timsu.astrid.data.AbstractModel; import com.timsu.astrid.data.AbstractModel;
import com.timsu.astrid.data.enums.Importance; import com.timsu.astrid.data.enums.Importance;
import com.timsu.astrid.data.enums.RepeatInterval; import com.timsu.astrid.data.enums.RepeatInterval;
import com.timsu.astrid.utilities.Preferences;
/** Abstract model of a task. Subclasses implement the getters and setters /** Abstract model of a task. Subclasses implement the getters and setters
@ -187,10 +188,12 @@ public abstract class AbstractTaskModel extends AbstractModel {
// --- utility methods // --- utility methods
/** Gets task color. Requires definiteDueDate and importance */ /** Gets task color. Requires definiteDueDate and importance */
protected int getTaskColorResource() { protected int getTaskColorResource(Context context) {
if(getDefiniteDueDate() != null && getDefiniteDueDate().getTime() < if(getDefiniteDueDate() != null && getDefiniteDueDate().getTime() <
System.currentTimeMillis()) { System.currentTimeMillis()) {
return R.color.task_list_overdue; return R.color.task_list_overdue;
} else if(Preferences.isColorize(context)) {
return getImportance().getTaskListColor();
} else { } else {
return R.color.task_list_normal; return R.color.task_list_normal;
} }

@ -26,6 +26,7 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import android.content.Context;
import android.database.Cursor; import android.database.Cursor;
import com.timsu.astrid.data.AbstractController; import com.timsu.astrid.data.AbstractController;
@ -140,8 +141,8 @@ public class TaskModelForList extends AbstractTaskModel {
} }
@Override @Override
public int getTaskColorResource() { public int getTaskColorResource(Context context) {
return super.getTaskColorResource(); return super.getTaskColorResource(context);
} }
@Override @Override

@ -64,11 +64,6 @@ public class TaskModelForView extends AbstractTaskModel {
return super.isTaskCompleted(); return super.isTaskCompleted();
} }
@Override
public int getTaskColorResource() {
return super.getTaskColorResource();
}
@Override @Override
public int getProgressPercentage() { public int getProgressPercentage() {
return super.getProgressPercentage(); return super.getProgressPercentage();

@ -17,6 +17,7 @@ public class Preferences {
// default values // default values
private static final boolean DEFAULT_PERSISTENCE_MODE = true; private static final boolean DEFAULT_PERSISTENCE_MODE = true;
private static final boolean DEFAULT_COLORIZE = false;
/** Set preference defaults, if unset. called at startup */ /** Set preference defaults, if unset. called at startup */
public static void setPreferenceDefaults(Context context) { public static void setPreferenceDefaults(Context context) {
@ -34,6 +35,9 @@ public class Preferences {
if(!prefs.contains(r.getString(R.string.p_deadlineTime))) { if(!prefs.contains(r.getString(R.string.p_deadlineTime))) {
editor.putString(r.getString(R.string.p_deadlineTime), "7"); editor.putString(r.getString(R.string.p_deadlineTime), "7");
} }
if(!prefs.contains(r.getString(R.string.p_colorize))) {
editor.putBoolean(r.getString(R.string.p_colorize), DEFAULT_COLORIZE);
}
editor.commit(); editor.commit();
} }
@ -101,6 +105,13 @@ public class Preferences {
return getIntegerValue(context, R.string.p_deadlineTime); return getIntegerValue(context, R.string.p_deadlineTime);
} }
/** Get perstence mode setting */
public static boolean isColorize(Context context) {
Resources r = context.getResources();
return getPrefs(context).getBoolean(r.getString(
R.string.p_colorize), DEFAULT_COLORIZE);
}
// --- helper methods // --- helper methods
private static SharedPreferences getPrefs(Context context) { private static SharedPreferences getPrefs(Context context) {

Loading…
Cancel
Save