Apply Android Studio and Lint inspections

* Remove always true/false/null parameters
* Remove pointless bitwise expressions
* Remove pointless boolean expressions
* Remove unnecessary continue statements
* Convert fields to local variables
* Remove unused resources
pull/46/merge
Alex Baker 12 years ago
parent 75315a4951
commit a1c986d9e2

@ -10,7 +10,6 @@ import android.content.Context;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteConstraintException; import android.database.sqlite.SQLiteConstraintException;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log; import android.util.Log;
@ -133,7 +132,7 @@ abstract public class AbstractDatabase {
throw new NullPointerException("Null context creating database helper"); throw new NullPointerException("Null context creating database helper");
} }
helper = new DatabaseHelper(ContextManager.getContext(), helper = new DatabaseHelper(ContextManager.getContext(),
getName(), null, getVersion()); getName(), getVersion());
} }
} }
@ -219,11 +218,8 @@ abstract public class AbstractDatabase {
// --- database wrapper // --- database wrapper
/* public synchronized Cursor rawQuery(String sql) {
* @see android.database.sqlite.SQLiteDatabase#rawQuery(String sql, String[] selectionArgs) return getDatabase().rawQuery(sql, null);
*/
public synchronized Cursor rawQuery(String sql, String[] selectionArgs) {
return getDatabase().rawQuery(sql, selectionArgs);
} }
/* /*
@ -252,11 +248,8 @@ abstract public class AbstractDatabase {
return result; return result;
} }
/* public synchronized int update(String table, ContentValues values, String whereClause) {
* @see android.database.sqlite.SQLiteDatabase#update(String table, ContentValues values, String whereClause, String[] whereArgs) int result = getDatabase().update(table, values, whereClause, null);
*/
public synchronized int update(String table, ContentValues values, String whereClause, String[] whereArgs) {
int result = getDatabase().update(table, values, whereClause, whereArgs);
onDatabaseUpdated(); onDatabaseUpdated();
return result; return result;
} }
@ -268,9 +261,8 @@ abstract public class AbstractDatabase {
*/ */
private class DatabaseHelper extends SQLiteOpenHelper { private class DatabaseHelper extends SQLiteOpenHelper {
public DatabaseHelper(Context context, String name, public DatabaseHelper(Context context, String name, int version) {
CursorFactory factory, int version) { super(context, name, null, version);
super(context, name, factory, version);
} }
/** /**

@ -348,7 +348,7 @@ public abstract class AbstractModel implements Parcelable, Cloneable {
if (setValues.containsKey(item.getKey())) { if (setValues.containsKey(item.getKey())) {
continue; continue;
} }
AndroidUtilities.putInto(setValues, item.getKey(), item.getValue(), true); AndroidUtilities.putInto(setValues, item.getKey(), item.getValue());
} }
} }

@ -93,7 +93,7 @@ public class DatabaseDao<TYPE extends AbstractModel> {
if(debug) { if(debug) {
Log.i("SQL-" + modelClass.getSimpleName(), query.toString()); //$NON-NLS-1$ Log.i("SQL-" + modelClass.getSimpleName(), query.toString()); //$NON-NLS-1$
} }
Cursor cursor = database.rawQuery(query.toString(), null); Cursor cursor = database.rawQuery(query.toString());
return new TodorooCursor<TYPE>(cursor, query.getFields()); return new TodorooCursor<TYPE>(cursor, query.getFields());
} }
@ -181,7 +181,7 @@ public class DatabaseDao<TYPE extends AbstractModel> {
*/ */
public int update(Criterion where, TYPE template) { public int update(Criterion where, TYPE template) {
return database.update(table.name, template.getSetValues(), return database.update(table.name, template.getSetValues(),
where.toString(), null); where.toString());
} }
/** /**
@ -261,7 +261,7 @@ public class DatabaseDao<TYPE extends AbstractModel> {
@Override @Override
public boolean makeChange() { public boolean makeChange() {
return database.update(table.name, values, return database.update(table.name, values,
AbstractModel.ID_PROPERTY.eq(item.getId()).toString(), null) > 0; AbstractModel.ID_PROPERTY.eq(item.getId()).toString()) > 0;
} }
}; };
return insertOrUpdateAndRecordChanges(item, update); return insertOrUpdateAndRecordChanges(item, update);

@ -40,7 +40,7 @@ public abstract class Property<TYPE> extends Field implements Cloneable {
public final String name; public final String name;
/** Can this field be null? */ /** Can this field be null? */
public static final int PROP_FLAG_NULLABLE = 1 << 0; public static final int PROP_FLAG_NULLABLE = 1;
/** Is this field a date? */ /** Is this field a date? */
public static final int PROP_FLAG_DATE = 1 << 1; public static final int PROP_FLAG_DATE = 1 << 1;
/** Is this field a user id? */ /** Is this field a user id? */
@ -153,8 +153,8 @@ public abstract class Property<TYPE> extends Field implements Cloneable {
super(table, name, flags); super(table, name, flags);
} }
protected IntegerProperty(Table table, String name, String expression) { protected IntegerProperty(String name, String expression) {
super(table, name, expression); super(null, name, expression);
} }
@Override @Override
@ -271,7 +271,7 @@ public abstract class Property<TYPE> extends Field implements Cloneable {
/** Runs a SQL function and returns the result as a string */ /** Runs a SQL function and returns the result as a string */
public static class IntegerFunctionProperty extends IntegerProperty { public static class IntegerFunctionProperty extends IntegerProperty {
public IntegerFunctionProperty(String function, String columnName) { public IntegerFunctionProperty(String function, String columnName) {
super(null, columnName, function); super(columnName, function);
alias = columnName; alias = columnName;
} }
} }

@ -32,8 +32,6 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays; import java.util.Arrays;
import java.util.Comparator; import java.util.Comparator;
import java.util.Map.Entry; import java.util.Map.Entry;
@ -108,7 +106,7 @@ public class AndroidUtilities {
/** /**
* Put an arbitrary object into a {@link ContentValues} * Put an arbitrary object into a {@link ContentValues}
*/ */
public static void putInto(ContentValues target, String key, Object value, boolean errorOnFail) { public static void putInto(ContentValues target, String key, Object value) {
if (value instanceof Boolean) { if (value instanceof Boolean) {
target.put(key, (Boolean) value); target.put(key, (Boolean) value);
} else if (value instanceof Byte) { } else if (value instanceof Byte) {
@ -125,7 +123,7 @@ public class AndroidUtilities {
target.put(key, (Short) value); target.put(key, (Short) value);
} else if (value instanceof String) { } else if (value instanceof String) {
target.put(key, (String) value); target.put(key, (String) value);
} else if (errorOnFail) { } else {
throw new UnsupportedOperationException("Could not handle type " + //$NON-NLS-1$ throw new UnsupportedOperationException("Could not handle type " + //$NON-NLS-1$
value.getClass()); value.getClass());
} }
@ -134,7 +132,7 @@ public class AndroidUtilities {
/** /**
* Put an arbitrary object into a {@link ContentValues} * Put an arbitrary object into a {@link ContentValues}
*/ */
public static void putInto(Bundle target, String key, Object value, boolean errorOnFail) { public static void putInto(Bundle target, String key, Object value) {
if (value instanceof Boolean) { if (value instanceof Boolean) {
target.putBoolean(key, (Boolean) value); target.putBoolean(key, (Boolean) value);
} else if (value instanceof Byte) { } else if (value instanceof Byte) {
@ -151,9 +149,6 @@ public class AndroidUtilities {
target.putShort(key, (Short) value); target.putShort(key, (Short) value);
} else if (value instanceof String) { } else if (value instanceof String) {
target.putString(key, (String) value); target.putString(key, (String) value);
} else if (errorOnFail) {
throw new UnsupportedOperationException("Could not handle type " + //$NON-NLS-1$
value.getClass());
} }
} }
@ -448,54 +443,7 @@ public class AndroidUtilities {
* @param exitAnim the outgoing-transition of this activity * @param exitAnim the outgoing-transition of this activity
*/ */
public static void callOverridePendingTransition(Activity activity, int enterAnim, int exitAnim) { public static void callOverridePendingTransition(Activity activity, int enterAnim, int exitAnim) {
callApiMethod(5, activity.overridePendingTransition(enterAnim, exitAnim);
activity,
"overridePendingTransition", //$NON-NLS-1$
new Class<?>[] { Integer.TYPE, Integer.TYPE },
enterAnim, exitAnim);
}
/**
* Call a method via reflection if API level is at least minSdk
* @param minSdk minimum sdk number (i.e. 8)
* @param receiver object to call method on
* @param methodName method name to call
* @param params method parameter types
* @param args arguments
*/
public static void callApiMethod(int minSdk, Object receiver,
String methodName, Class<?>[] params, Object... args) {
if(getSdkVersion() < minSdk) {
return;
}
AndroidUtilities.callMethod(receiver.getClass(),
receiver, methodName, params, args);
}
/**
* Call a method via reflection
* @param receiver object to call method on (can be null)
* @param methodName method name to call
* @param params method parameter types
* @param args arguments
*/
public static void callMethod(Class<?> cls, Object receiver,
String methodName, Class<?>[] params, Object... args) {
try {
Method method = cls.getMethod(methodName, params);
method.invoke(receiver, args);
} catch (SecurityException e) {
getExceptionService().reportError("call-method", e);
} catch (NoSuchMethodException e) {
getExceptionService().reportError("call-method", e);
} catch (IllegalArgumentException e) {
getExceptionService().reportError("call-method", e);
} catch (IllegalAccessException e) {
getExceptionService().reportError("call-method", e);
} catch (InvocationTargetException e) {
getExceptionService().reportError("call-method", e);
}
} }
/** /**

@ -91,11 +91,11 @@ public class DateUtilities {
* @param date time to format * @param date time to format
* @return time, with hours and minutes * @return time, with hours and minutes
*/ */
public static String getTimeString(Context context, Date date, boolean excludeZeroMinutes) { public static String getTimeString(Context context, Date date) {
String value; String value;
if (is24HourFormat(context)) { if (is24HourFormat(context)) {
value = "H:mm"; value = "H:mm";
} else if (date.getMinutes() == 0 && excludeZeroMinutes){ } else if (date.getMinutes() == 0){
value = "h a"; value = "h a";
} }
else { else {
@ -104,10 +104,6 @@ public class DateUtilities {
return new SimpleDateFormat(value).format(date); return new SimpleDateFormat(value).format(date);
} }
public static String getTimeString(Context context, Date date) {
return getTimeString(context, date, true);
}
/* Returns true if search string is in sortedValues */ /* Returns true if search string is in sortedValues */
private static boolean arrayBinaryContains(String search, String... sortedValues) { private static boolean arrayBinaryContains(String search, String... sortedValues) {
@ -118,7 +114,7 @@ public class DateUtilities {
* @param date date to format * @param date date to format
* @return date, with month, day, and year * @return date, with month, day, and year
*/ */
public static String getDateString(Date date, boolean includeYear) { public static String getDateString(Date date) {
String month = new SimpleDateFormat("MMM").format(date); String month = new SimpleDateFormat("MMM").format(date);
String value; String value;
String standardDate; String standardDate;
@ -130,9 +126,7 @@ public class DateUtilities {
} else { } else {
value = "d'$' '#'"; value = "d'$' '#'";
} }
if (includeYear) { value += ", yyyy";
value += ", yyyy";
}
if (arrayBinaryContains(locale.getLanguage(), "ja", "zh")){ if (arrayBinaryContains(locale.getLanguage(), "ja", "zh")){
standardDate = new SimpleDateFormat(value).format(date).replace("#", month).replace("$", "\u65E5"); //$NON-NLS-1$ standardDate = new SimpleDateFormat(value).format(date).replace("#", month).replace("$", "\u65E5"); //$NON-NLS-1$
}else if ("ko".equals(Locale.getDefault().getLanguage())){ }else if ("ko".equals(Locale.getDefault().getLanguage())){
@ -140,10 +134,7 @@ public class DateUtilities {
}else{ }else{
standardDate = new SimpleDateFormat(value).format(date).replace("#", month).replace("$", ""); standardDate = new SimpleDateFormat(value).format(date).replace("#", month).replace("$", "");
} }
return standardDate;} return standardDate;
public static String getDateString(Date date) {
return getDateString(date, true);
} }
/** /**

@ -86,8 +86,7 @@ public class DialogUtilities {
* Displays a dialog box with an OK button * Displays a dialog box with an OK button
*/ */
public static void okDialog(final Activity activity, final String title, public static void okDialog(final Activity activity, final String title,
final int icon, final CharSequence text, final int icon, final CharSequence text) {
final DialogInterface.OnClickListener okListener) {
if(activity.isFinishing()) { if(activity.isFinishing()) {
return; return;
} }
@ -99,7 +98,7 @@ public class DialogUtilities {
.setTitle(title) .setTitle(title)
.setMessage(text) .setMessage(text)
.setIcon(icon) .setIcon(icon)
.setPositiveButton(android.R.string.ok, okListener) .setPositiveButton(android.R.string.ok, null)
.show().setOwnerActivity(activity); .show().setOwnerActivity(activity);
} }
}); });
@ -109,10 +108,9 @@ public class DialogUtilities {
* Displays a dialog box with OK and Cancel buttons and custom title * Displays a dialog box with OK and Cancel buttons and custom title
*/ */
public static void okCancelDialog(final Activity activity, final String title, public static void okCancelDialog(final Activity activity, final String title,
final String text, final DialogInterface.OnClickListener okListener, final String text, final DialogInterface.OnClickListener okListener) {
final DialogInterface.OnClickListener cancelListener) {
okCancelCustomDialog(activity, title, text, android.R.string.ok, android.R.string.cancel, android.R.drawable.ic_dialog_alert, okListener, cancelListener); okCancelCustomDialog(activity, title, text, android.R.string.ok, android.R.string.cancel, android.R.drawable.ic_dialog_alert, okListener, null);
} }
/** /**

@ -5,7 +5,6 @@
*/ */
package com.todoroo.astrid.api; package com.todoroo.astrid.api;
import android.content.ContentValues;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
@ -34,12 +33,11 @@ public class TextInputCriterion extends CustomFilterCriterion implements Parcela
* Create a new CustomFilterCriteria object * Create a new CustomFilterCriteria object
*/ */
public TextInputCriterion(String identifier, String title, String sql, public TextInputCriterion(String identifier, String title, String sql,
ContentValues valuesForNewTasks, String prompt, String hint, String prompt, String hint, Bitmap icon, String name) {
Bitmap icon, String name) {
this.identifier = identifier; this.identifier = identifier;
this.text = title; this.text = title;
this.sql = sql; this.sql = sql;
this.valuesForNewTasks = valuesForNewTasks; this.valuesForNewTasks = null;
this.prompt = prompt; this.prompt = prompt;
this.hint = hint; this.hint = hint;
this.icon = icon; this.icon = icon;

@ -20,7 +20,7 @@ import com.todoroo.astrid.data.TaskApiDao.TaskCriteria;
*/ */
public class SortHelper { public class SortHelper {
public static final int FLAG_REVERSE_SORT = 1 << 0; public static final int FLAG_REVERSE_SORT = 1;
public static final int FLAG_SHOW_COMPLETED = 1 << 1; public static final int FLAG_SHOW_COMPLETED = 1 << 1;
public static final int FLAG_SHOW_HIDDEN = 1 << 2; public static final int FLAG_SHOW_HIDDEN = 1 << 2;
public static final int FLAG_SHOW_DELETED = 1 << 3; public static final int FLAG_SHOW_DELETED = 1 << 3;

@ -8,7 +8,6 @@ package com.todoroo.astrid.sync;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor; import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.text.TextUtils;
import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.DateUtilities;
@ -81,11 +80,6 @@ abstract public class SyncProviderUtilities {
return getPrefs().getString(getIdentifier() + PREF_LAST_ERROR, null); return getPrefs().getString(getIdentifier() + PREF_LAST_ERROR, null);
} }
/** @return Last Error type, or null if no last error */
public String getLastErrorType() {
return getPrefs().getString(getIdentifier() + PREF_LAST_ERROR_TYPE, null);
}
/** @return Last Error, or null if no last error */ /** @return Last Error, or null if no last error */
public boolean isOngoing() { public boolean isOngoing() {
return getPrefs().getBoolean(getIdentifier() + PREF_ONGOING, false); return getPrefs().getBoolean(getIdentifier() + PREF_ONGOING, false);

@ -29,14 +29,6 @@
<item quantity="one">1 minut</item> <item quantity="one">1 minut</item>
<item quantity="other">%d Minuts</item> <item quantity="other">%d Minuts</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 segon</item>
<item quantity="other">%d Segons</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 Seg</item>
<item quantity="other">%d Seg</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 tasca</item> <item quantity="one">1 tasca</item>
<item quantity="other">%d tasques</item> <item quantity="other">%d tasques</item>

@ -21,10 +21,6 @@
<item quantity="one">1 den</item> <item quantity="one">1 den</item>
<item quantity="other">%d Dnů</item> <item quantity="other">%d Dnů</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 pracovní den</item>
<item quantity="other">%d pracovních dnů</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 hodina</item> <item quantity="one">1 hodina</item>
<item quantity="other">%d hodin</item> <item quantity="other">%d hodin</item>
@ -33,30 +29,10 @@
<item quantity="one">1 minuta</item> <item quantity="one">1 minuta</item>
<item quantity="other">%d minut</item> <item quantity="other">%d minut</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 vteřina</item>
<item quantity="other">%d vteřin</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 hod.</item>
<item quantity="other">%d hod.</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 min.</item>
<item quantity="other">%d min.</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 s</item>
<item quantity="other">%d s</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 úkol</item> <item quantity="one">1 úkol</item>
<item quantity="other">%d úkolů</item> <item quantity="other">%d úkolů</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 osoba</item>
<item quantity="other">%d lidí</item>
</plurals>
<string name="today">Dnes</string> <string name="today">Dnes</string>
<string name="tomorrow">Zítra</string> <string name="tomorrow">Zítra</string>
<string name="yesterday">Včera</string> <string name="yesterday">Včera</string>

@ -29,22 +29,6 @@
<item quantity="one">1 minut</item> <item quantity="one">1 minut</item>
<item quantity="other">%d minutter</item> <item quantity="other">%d minutter</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 sekund</item>
<item quantity="other">%d sekunder</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 time</item>
<item quantity="other">%d timer</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 min.</item>
<item quantity="other">%d min.</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 sek.</item>
<item quantity="other">%d sek.</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 opgave</item> <item quantity="one">1 opgave</item>
<item quantity="other">%d opgaver</item> <item quantity="other">%d opgaver</item>

@ -21,10 +21,6 @@
<item quantity="one">Ein Tag</item> <item quantity="one">Ein Tag</item>
<item quantity="other">%d Tage</item> <item quantity="other">%d Tage</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">Ein Wochentag</item>
<item quantity="other">%d Wochentage</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">Eine Stunde</item> <item quantity="one">Eine Stunde</item>
<item quantity="other">%d Stunden</item> <item quantity="other">%d Stunden</item>
@ -33,30 +29,10 @@
<item quantity="one">Eine Minute</item> <item quantity="one">Eine Minute</item>
<item quantity="other">%d Minuten</item> <item quantity="other">%d Minuten</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">Eine Sekunde</item>
<item quantity="other">%d Sekunden</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 Std</item>
<item quantity="other">%d Std</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 Min</item>
<item quantity="other">%d min</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 Sek</item>
<item quantity="other">%d Sek</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 Aufgabe</item> <item quantity="one">1 Aufgabe</item>
<item quantity="other">%d Aufgaben</item> <item quantity="other">%d Aufgaben</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">Eine Person</item>
<item quantity="other">%d Personen</item>
</plurals>
<string name="today">Heute</string> <string name="today">Heute</string>
<string name="tomorrow">Morgen</string> <string name="tomorrow">Morgen</string>
<string name="yesterday">Gestern</string> <string name="yesterday">Gestern</string>

@ -21,10 +21,6 @@
<item quantity="one">Un día</item> <item quantity="one">Un día</item>
<item quantity="other">%d días</item> <item quantity="other">%d días</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 día laborable</item>
<item quantity="other">%d días laborables</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 hora</item> <item quantity="one">1 hora</item>
<item quantity="other">%d horas</item> <item quantity="other">%d horas</item>
@ -33,30 +29,10 @@
<item quantity="one">1 minuto</item> <item quantity="one">1 minuto</item>
<item quantity="other">%d minutos</item> <item quantity="other">%d minutos</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 segundo</item>
<item quantity="other">%d segundos</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 hr</item>
<item quantity="other">%d hrs</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 min</item>
<item quantity="other">%d min</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 seg</item>
<item quantity="other">%d seg</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 tarea</item> <item quantity="one">1 tarea</item>
<item quantity="other">%d tareas</item> <item quantity="other">%d tareas</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 persona</item>
<item quantity="other">%d personas</item>
</plurals>
<string name="today">Hoy</string> <string name="today">Hoy</string>
<string name="tomorrow">Mañana</string> <string name="tomorrow">Mañana</string>
<string name="yesterday">Ayer</string> <string name="yesterday">Ayer</string>

@ -21,10 +21,6 @@
<item quantity="one">1 jour</item> <item quantity="one">1 jour</item>
<item quantity="other">%d jours</item> <item quantity="other">%d jours</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 jour de la semaine</item>
<item quantity="other">%d jours de la semaine</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 heure</item> <item quantity="one">1 heure</item>
<item quantity="other">%d heures</item> <item quantity="other">%d heures</item>
@ -33,30 +29,10 @@
<item quantity="one">1 minute</item> <item quantity="one">1 minute</item>
<item quantity="other">%d minutes</item> <item quantity="other">%d minutes</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 seconde</item>
<item quantity="other">%d secondes</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 h</item>
<item quantity="other">%d h</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 min</item>
<item quantity="other">%d min</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 s</item>
<item quantity="other">%d s</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 tâche</item> <item quantity="one">1 tâche</item>
<item quantity="other">%d tâches</item> <item quantity="other">%d tâches</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 personne</item>
<item quantity="other">%d personnes</item>
</plurals>
<string name="today">Aujourd\'hui</string> <string name="today">Aujourd\'hui</string>
<string name="tomorrow">Demain</string> <string name="tomorrow">Demain</string>
<string name="yesterday">Hier</string> <string name="yesterday">Hier</string>

@ -21,10 +21,6 @@
<item quantity="one">1 Giorno</item> <item quantity="one">1 Giorno</item>
<item quantity="other">%d Giorni</item> <item quantity="other">%d Giorni</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 giorno della settimana</item>
<item quantity="other">%d giorni della settimana</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 ora</item> <item quantity="one">1 ora</item>
<item quantity="other">%d ore</item> <item quantity="other">%d ore</item>
@ -33,30 +29,10 @@
<item quantity="one">1 minuto</item> <item quantity="one">1 minuto</item>
<item quantity="other">%d minuti</item> <item quantity="other">%d minuti</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 secondo</item>
<item quantity="other">%d secondi</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 ora</item>
<item quantity="other">%d ore</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 min</item>
<item quantity="other">%d min</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 sec</item>
<item quantity="other">%d sec</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 attività</item> <item quantity="one">1 attività</item>
<item quantity="other">%d attività</item> <item quantity="other">%d attività</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 persona</item>
<item quantity="other">%d persone</item>
</plurals>
<string name="today">Oggi</string> <string name="today">Oggi</string>
<string name="tomorrow">Domani</string> <string name="tomorrow">Domani</string>
<string name="yesterday">Ieri</string> <string name="yesterday">Ieri</string>

@ -21,10 +21,6 @@
<item quantity="one">יום אחד</item> <item quantity="one">יום אחד</item>
<item quantity="other">%d ימים</item> <item quantity="other">%d ימים</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">יום עבודה אחד</item>
<item quantity="other">%d ימי עבודה</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">שעה אחת</item> <item quantity="one">שעה אחת</item>
<item quantity="other">%d שעות</item> <item quantity="other">%d שעות</item>
@ -33,30 +29,10 @@
<item quantity="one">דקה אחת</item> <item quantity="one">דקה אחת</item>
<item quantity="other">%d דקות</item> <item quantity="other">%d דקות</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">שנייה אחת</item>
<item quantity="other">%d שניות</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">שעה</item>
<item quantity="other">%d שע\'</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">דקה</item>
<item quantity="other">%d דק׳</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">שנייה</item>
<item quantity="other">%d שנ\'</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">משימה אחת</item> <item quantity="one">משימה אחת</item>
<item quantity="other">%d משימות</item> <item quantity="other">%d משימות</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">שותף אחד</item>
<item quantity="other">%d שותפים</item>
</plurals>
<string name="today">היום</string> <string name="today">היום</string>
<string name="tomorrow">מחר</string> <string name="tomorrow">מחר</string>
<string name="yesterday">אתמול</string> <string name="yesterday">אתמול</string>

@ -29,30 +29,10 @@
<item quantity="one">1 分</item> <item quantity="one">1 分</item>
<item quantity="other">%d 分</item> <item quantity="other">%d 分</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 秒</item>
<item quantity="other">%d 秒</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 時間</item>
<item quantity="other">%d 時間</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 分</item>
<item quantity="other">%d 分</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 秒</item>
<item quantity="other">%d 秒</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">タスク 1 件</item> <item quantity="one">タスク 1 件</item>
<item quantity="other">タスク %d 件</item> <item quantity="other">タスク %d 件</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1人</item>
<item quantity="other">%d人</item>
</plurals>
<string name="yesterday">昨日</string> <string name="yesterday">昨日</string>
<string name="tmrw">明日</string> <string name="tmrw">明日</string>
<string name="yest">昨日</string> <string name="yest">昨日</string>

@ -21,10 +21,6 @@
<item quantity="one">1일</item> <item quantity="one">1일</item>
<item quantity="other">%d일</item> <item quantity="other">%d일</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">주중 1일</item>
<item quantity="other">주중 %d일</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1시간</item> <item quantity="one">1시간</item>
<item quantity="other">%d시간</item> <item quantity="other">%d시간</item>
@ -33,30 +29,10 @@
<item quantity="one">1분</item> <item quantity="one">1분</item>
<item quantity="other">%d분</item> <item quantity="other">%d분</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1초</item>
<item quantity="other">%d초</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1시간</item>
<item quantity="other">%d시간</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1분</item>
<item quantity="other">%d분</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1초</item>
<item quantity="other">%d초</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 일정</item> <item quantity="one">1 일정</item>
<item quantity="other">%d 일정</item> <item quantity="other">%d 일정</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 사람</item>
<item quantity="other">%d 사람</item>
</plurals>
<string name="today">오늘</string> <string name="today">오늘</string>
<string name="tomorrow">내일</string> <string name="tomorrow">내일</string>
<string name="yesterday">어제</string> <string name="yesterday">어제</string>

@ -21,10 +21,6 @@
<item quantity="one">1 dag</item> <item quantity="one">1 dag</item>
<item quantity="other">%d dager</item> <item quantity="other">%d dager</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 ukesdag</item>
<item quantity="other">%d Weekdays</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 time</item> <item quantity="one">1 time</item>
<item quantity="other">%d timer</item> <item quantity="other">%d timer</item>
@ -33,22 +29,6 @@
<item quantity="one">1 minutt</item> <item quantity="one">1 minutt</item>
<item quantity="other">%d minutter</item> <item quantity="other">%d minutter</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 sekund</item>
<item quantity="other">%d sekunder</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 t</item>
<item quantity="other">%d t</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 min</item>
<item quantity="other">%d min</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 s</item>
<item quantity="other">%d s</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 oppgave</item> <item quantity="one">1 oppgave</item>
<item quantity="other">%d oppgaver</item> <item quantity="other">%d oppgaver</item>

@ -21,10 +21,6 @@
<item quantity="one">1 dag</item> <item quantity="one">1 dag</item>
<item quantity="other">%d dagen</item> <item quantity="other">%d dagen</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 weekdag</item>
<item quantity="other">%d weekdagen</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 uur</item> <item quantity="one">1 uur</item>
<item quantity="other">%d uren</item> <item quantity="other">%d uren</item>
@ -33,30 +29,10 @@
<item quantity="one">1 minuut</item> <item quantity="one">1 minuut</item>
<item quantity="other">%d minuten</item> <item quantity="other">%d minuten</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 seconde</item>
<item quantity="other">%d seconden</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 u.</item>
<item quantity="other">%d u.</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 m.</item>
<item quantity="other">%d m.</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 s.</item>
<item quantity="other">%d s.</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 taak</item> <item quantity="one">1 taak</item>
<item quantity="other">%d taken</item> <item quantity="other">%d taken</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 persoon</item>
<item quantity="other">%d personen</item>
</plurals>
<string name="today">Vandaag</string> <string name="today">Vandaag</string>
<string name="tomorrow">Morgen</string> <string name="tomorrow">Morgen</string>
<string name="yesterday">Gisteren</string> <string name="yesterday">Gisteren</string>

@ -21,10 +21,6 @@
<item quantity="one">1 dzień</item> <item quantity="one">1 dzień</item>
<item quantity="other">%d dni</item> <item quantity="other">%d dni</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 dzień roboczy</item>
<item quantity="other">%d dni roboczych</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 godzina</item> <item quantity="one">1 godzina</item>
<item quantity="other">%d godzin</item> <item quantity="other">%d godzin</item>
@ -33,30 +29,10 @@
<item quantity="one">1 minuta</item> <item quantity="one">1 minuta</item>
<item quantity="other">%d minut</item> <item quantity="other">%d minut</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 sekunda</item>
<item quantity="other">%d sekund</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 godz.</item>
<item quantity="other">%d godz.</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 min.</item>
<item quantity="other">%d min.</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 sek.</item>
<item quantity="other">%d sek.</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 zadanie</item> <item quantity="one">1 zadanie</item>
<item quantity="other">%d zadań</item> <item quantity="other">%d zadań</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 osoba</item>
<item quantity="other">%d osób</item>
</plurals>
<string name="today">Dzisiaj</string> <string name="today">Dzisiaj</string>
<string name="tomorrow">Jutro</string> <string name="tomorrow">Jutro</string>
<string name="yesterday">Wczoraj</string> <string name="yesterday">Wczoraj</string>

@ -21,10 +21,6 @@
<item quantity="one">1 dia</item> <item quantity="one">1 dia</item>
<item quantity="other">%d dias</item> <item quantity="other">%d dias</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 dia útil</item>
<item quantity="other">%d dias úteis</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 hora</item> <item quantity="one">1 hora</item>
<item quantity="other">%d horas</item> <item quantity="other">%d horas</item>
@ -33,30 +29,10 @@
<item quantity="one">1 minuto</item> <item quantity="one">1 minuto</item>
<item quantity="other">%d minutos</item> <item quantity="other">%d minutos</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 segundo</item>
<item quantity="other">%d segundos</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 h</item>
<item quantity="other">%d h</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 min</item>
<item quantity="other">%d min</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 s</item>
<item quantity="other">%d s</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 tarefa</item> <item quantity="one">1 tarefa</item>
<item quantity="other">%d tarefas</item> <item quantity="other">%d tarefas</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 pessoa</item>
<item quantity="other">%d pessoas</item>
</plurals>
<string name="today">Hoje</string> <string name="today">Hoje</string>
<string name="tomorrow">Amanhã</string> <string name="tomorrow">Amanhã</string>
<string name="yesterday">Ontem</string> <string name="yesterday">Ontem</string>

@ -29,22 +29,6 @@
<item quantity="one">1 Minuto</item> <item quantity="one">1 Minuto</item>
<item quantity="other">%d Minutos</item> <item quantity="other">%d Minutos</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 Segundo</item>
<item quantity="other">%d Segundos</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 h</item>
<item quantity="other">%d h</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 min</item>
<item quantity="other">%d min</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 s</item>
<item quantity="other">%d s</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 tarefa</item> <item quantity="one">1 tarefa</item>
<item quantity="other">%d tarefas</item> <item quantity="other">%d tarefas</item>

@ -21,10 +21,6 @@
<item quantity="one">1 день</item> <item quantity="one">1 день</item>
<item quantity="other">%d дня/дней</item> <item quantity="other">%d дня/дней</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 рабочий день</item>
<item quantity="other">%d рабочих дня</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 час</item> <item quantity="one">1 час</item>
<item quantity="other">%d часа/часов</item> <item quantity="other">%d часа/часов</item>
@ -33,30 +29,10 @@
<item quantity="one">1 минута</item> <item quantity="one">1 минута</item>
<item quantity="other">%d минуты/минут</item> <item quantity="other">%d минуты/минут</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 секунда</item>
<item quantity="other">%d секунды/секунд</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 час</item>
<item quantity="other">%d ч</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 мин</item>
<item quantity="other">%d мин</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 с</item>
<item quantity="other">%d с</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 задача</item> <item quantity="one">1 задача</item>
<item quantity="other">%d задач(а/и)</item> <item quantity="other">%d задач(а/и)</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 человек</item>
<item quantity="other">%d человек</item>
</plurals>
<string name="today">Сегодня</string> <string name="today">Сегодня</string>
<string name="tomorrow">Завтра</string> <string name="tomorrow">Завтра</string>
<string name="yesterday">Вчера</string> <string name="yesterday">Вчера</string>

@ -21,10 +21,6 @@
<item quantity="one">1 dan</item> <item quantity="one">1 dan</item>
<item quantity="other">Št. dni: %d</item> <item quantity="other">Št. dni: %d</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 delovni dan</item>
<item quantity="other">Št. del. dni: %d</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 ura</item> <item quantity="one">1 ura</item>
<item quantity="other">Št. ur: %d</item> <item quantity="other">Št. ur: %d</item>
@ -33,30 +29,10 @@
<item quantity="one">1 minuta</item> <item quantity="one">1 minuta</item>
<item quantity="other">Št. minut: %d</item> <item quantity="other">Št. minut: %d</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 sekunda</item>
<item quantity="other">Št. sekund: %d</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 ura</item>
<item quantity="other">%d ur.</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 min.</item>
<item quantity="other">%d min.</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 sek.</item>
<item quantity="other">%d sek.</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 opravek</item> <item quantity="one">1 opravek</item>
<item quantity="other">Št. opravkov: %d</item> <item quantity="other">Št. opravkov: %d</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 oseba</item>
<item quantity="other">Št. oseb: %d</item>
</plurals>
<string name="today">Danes</string> <string name="today">Danes</string>
<string name="tomorrow">Jutri</string> <string name="tomorrow">Jutri</string>
<string name="yesterday">Včeraj</string> <string name="yesterday">Včeraj</string>

@ -21,10 +21,6 @@
<item quantity="one">1 dag</item> <item quantity="one">1 dag</item>
<item quantity="other">%d dagar</item> <item quantity="other">%d dagar</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 Veckodag</item>
<item quantity="other">%d Veckodagar</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 timme</item> <item quantity="one">1 timme</item>
<item quantity="other">%d timmar</item> <item quantity="other">%d timmar</item>
@ -33,30 +29,10 @@
<item quantity="one">1 minut</item> <item quantity="one">1 minut</item>
<item quantity="other">%d minuter</item> <item quantity="other">%d minuter</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 sekund</item>
<item quantity="other">%d sekunder</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 tim</item>
<item quantity="other">%d tim</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 min</item>
<item quantity="other">%d min</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 sek</item>
<item quantity="other">%d sek</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 uppgift</item> <item quantity="one">1 uppgift</item>
<item quantity="other">%d uppgifter</item> <item quantity="other">%d uppgifter</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 person</item>
<item quantity="other">%d personer</item>
</plurals>
<string name="yesterday">Igår</string> <string name="yesterday">Igår</string>
<string name="tmrw">imorn</string> <string name="tmrw">imorn</string>
<string name="yest">Igår</string> <string name="yest">Igår</string>

@ -17,22 +17,6 @@
<item quantity="one">1 นาที</item> <item quantity="one">1 นาที</item>
<item quantity="other">%d นาที</item> <item quantity="other">%d นาที</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 วินาที</item>
<item quantity="other">%d วินาที</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 ช.ม.</item>
<item quantity="other">%d ช.ม.</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 นาที</item>
<item quantity="other">%d นาที</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 วิ.</item>
<item quantity="other">%d วิ.</item>
</plurals>
<string name="today">วันนี้</string> <string name="today">วันนี้</string>
<string name="tomorrow">พรุ่งนี้</string> <string name="tomorrow">พรุ่งนี้</string>
<string name="yesterday">เมื่อวาน</string> <string name="yesterday">เมื่อวาน</string>

@ -21,10 +21,6 @@
<item quantity="one">1 Gün</item> <item quantity="one">1 Gün</item>
<item quantity="other">%d gün</item> <item quantity="other">%d gün</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 haftaiçi gün</item>
<item quantity="other">%d haftaiçi günü</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 Saat</item> <item quantity="one">1 Saat</item>
<item quantity="other">%d saat</item> <item quantity="other">%d saat</item>
@ -33,30 +29,10 @@
<item quantity="one">1 Dakika</item> <item quantity="one">1 Dakika</item>
<item quantity="other">%d dakika</item> <item quantity="other">%d dakika</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 Saniye</item>
<item quantity="other">%d saniye</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 saat</item>
<item quantity="other">%d saat</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 dakika</item>
<item quantity="other">%d dakika</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 saniye</item>
<item quantity="other">%d saniye</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 görev</item> <item quantity="one">1 görev</item>
<item quantity="other">%d görev</item> <item quantity="other">%d görev</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 kişi</item>
<item quantity="other">%d kişi</item>
</plurals>
<string name="today">Bugün</string> <string name="today">Bugün</string>
<string name="tomorrow">Yarın</string> <string name="tomorrow">Yarın</string>
<string name="yesterday">Dün</string> <string name="yesterday">Dün</string>

@ -21,26 +21,10 @@
<item quantity="one">1 день</item> <item quantity="one">1 день</item>
<item quantity="other">%d днів</item> <item quantity="other">%d днів</item>
</plurals> </plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 год.</item>
<item quantity="other">%d год.</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 хв.</item>
<item quantity="other">%d хв.</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 сек.</item>
<item quantity="other">%d сек.</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 завдання</item> <item quantity="one">1 завдання</item>
<item quantity="other">%d завдань</item> <item quantity="other">%d завдань</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">1 людина</item>
<item quantity="other">%d людей</item>
</plurals>
<string name="today">Сьогодні</string> <string name="today">Сьогодні</string>
<string name="tomorrow">Завтра</string> <string name="tomorrow">Завтра</string>
<string name="yesterday">Вчора</string> <string name="yesterday">Вчора</string>

@ -21,10 +21,6 @@
<item quantity="one">1 天</item> <item quantity="one">1 天</item>
<item quantity="other">%d 天</item> <item quantity="other">%d 天</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 个任务天</item>
<item quantity="other">%d 个任务天</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 小时</item> <item quantity="one">1 小时</item>
<item quantity="other">%d 小时</item> <item quantity="other">%d 小时</item>
@ -33,30 +29,10 @@
<item quantity="one">1 分钟</item> <item quantity="one">1 分钟</item>
<item quantity="other">%d 分钟</item> <item quantity="other">%d 分钟</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 秒</item>
<item quantity="other">%d 秒</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 小时</item>
<item quantity="other">%d 小时</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 分钟</item>
<item quantity="other">%d 分钟</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 秒</item>
<item quantity="other">%d 秒</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 个任务</item> <item quantity="one">1 个任务</item>
<item quantity="other">%d 个任务</item> <item quantity="other">%d 个任务</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">一个人</item>
<item quantity="other">%d 个人</item>
</plurals>
<string name="today">今天</string> <string name="today">今天</string>
<string name="tomorrow">明天</string> <string name="tomorrow">明天</string>
<string name="yesterday">昨天</string> <string name="yesterday">昨天</string>

@ -21,10 +21,6 @@
<item quantity="one">1 天</item> <item quantity="one">1 天</item>
<item quantity="other">%d 天</item> <item quantity="other">%d 天</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<item quantity="one">1 個工作天</item>
<item quantity="other">%d 個工作天</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<item quantity="one">1 小時</item> <item quantity="one">1 小時</item>
<item quantity="other">%d 小時</item> <item quantity="other">%d 小時</item>
@ -33,30 +29,10 @@
<item quantity="one">1 分鐘</item> <item quantity="one">1 分鐘</item>
<item quantity="other">%d 分鐘</item> <item quantity="other">%d 分鐘</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<item quantity="one">1 秒</item>
<item quantity="other">%d 秒</item>
</plurals>
<plurals name="DUt_hoursShort">
<item quantity="one">1 小時</item>
<item quantity="other">%d 小時</item>
</plurals>
<plurals name="DUt_minutesShort">
<item quantity="one">1 分鐘</item>
<item quantity="other">%d 分鐘</item>
</plurals>
<plurals name="DUt_secondsShort">
<item quantity="one">1 秒</item>
<item quantity="other">%d 秒</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<item quantity="one">1 個工作</item> <item quantity="one">1 個工作</item>
<item quantity="other">%d 個工作</item> <item quantity="other">%d 個工作</item>
</plurals> </plurals>
<plurals name="Npeople">
<item quantity="one">一個人</item>
<item quantity="other">%d個人</item>
</plurals>
<string name="today">今天</string> <string name="today">今天</string>
<string name="tomorrow">明天</string> <string name="tomorrow">明天</string>
<string name="yesterday">昨天</string> <string name="yesterday">昨天</string>

@ -27,12 +27,6 @@
<!-- plurals: days --> <!-- plurals: days -->
<item quantity="other">%d Days</item> <item quantity="other">%d Days</item>
</plurals> </plurals>
<plurals name="DUt_weekdays">
<!-- plurals: days -->
<item quantity="one">1 Weekday</item>
<!-- plurals: days -->
<item quantity="other">%d Weekdays</item>
</plurals>
<plurals name="DUt_hours"> <plurals name="DUt_hours">
<!-- plurals: hours --> <!-- plurals: hours -->
<item quantity="one">1 Hour</item> <item quantity="one">1 Hour</item>
@ -45,43 +39,13 @@
<!-- plurals: minutes --> <!-- plurals: minutes -->
<item quantity="other">%d Minutes</item> <item quantity="other">%d Minutes</item>
</plurals> </plurals>
<plurals name="DUt_seconds">
<!-- plurals: seconds -->
<item quantity="one">1 Second</item>
<!-- plurals: seconds -->
<item quantity="other">%d Seconds</item>
</plurals>
<plurals name="DUt_hoursShort">
<!-- plurals: hours (abbreviated) -->
<item quantity="one">1 Hr</item>
<!-- plurals: hours (abbreviated) -->
<item quantity="other">%d Hrs</item>
</plurals>
<plurals name="DUt_minutesShort">
<!-- plurals: minutes (abbreviated) -->
<item quantity="one">1 Min</item>
<!-- plurals: minutes (abbreviated) -->
<item quantity="other">%d Min</item>
</plurals>
<plurals name="DUt_secondsShort">
<!-- plurals: seconds (abbreviated) -->
<item quantity="one">1 Sec</item>
<!-- plurals: seconds (abbreviated) -->
<item quantity="other">%d Sec</item>
</plurals>
<plurals name="Ntasks"> <plurals name="Ntasks">
<!-- plurals: tasks --> <!-- plurals: tasks -->
<item quantity="one">1 task</item> <item quantity="one">1 task</item>
<!-- plurals: tasks --> <!-- plurals: tasks -->
<item quantity="other">%d tasks</item> <item quantity="other">%d tasks</item>
</plurals> </plurals>
<plurals name="Npeople">
<!-- plurals: people -->
<item quantity="one">1 person</item>
<!-- plurals: people -->
<item quantity="other">%d people</item>
</plurals>
<!-- slide 10a, 12c: today --> <!-- slide 10a, 12c: today -->
<string name="today">Today</string> <string name="today">Today</string>

@ -32,7 +32,7 @@ public class NotificationTests extends DatabaseTestCase {
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
Notifications.forceNotificationManager(true); Notifications.forceNotificationManager();
} }
@Override @Override

@ -3,7 +3,6 @@ package com.todoroo.astrid.sync;
import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.Autowired;
import com.todoroo.astrid.dao.TagDataDao; import com.todoroo.astrid.dao.TagDataDao;
import com.todoroo.astrid.dao.TaskDao; import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.data.SyncFlags;
import com.todoroo.astrid.data.TagData; import com.todoroo.astrid.data.TagData;
import com.todoroo.astrid.data.Task; import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.test.DatabaseTestCase; import com.todoroo.astrid.test.DatabaseTestCase;
@ -19,26 +18,20 @@ public class NewSyncTestCase extends DatabaseTestCase {
super.setUp(); super.setUp();
} }
protected Task createTask(String title, boolean suppress) { protected Task createTask(String title) {
Task task = new Task(); Task task = new Task();
task.setValue(Task.TITLE, title); task.setValue(Task.TITLE, title);
task.setValue(Task.IMPORTANCE, SYNC_TASK_IMPORTANCE); task.setValue(Task.IMPORTANCE, SYNC_TASK_IMPORTANCE);
if (suppress) taskDao.createNew(task);
task.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true);
taskDao.createNew(task);
return task; return task;
} }
protected Task createTask() {
return createTask(false);
}
public static final String SYNC_TASK_TITLE = "new title"; public static final String SYNC_TASK_TITLE = "new title";
public static final int SYNC_TASK_IMPORTANCE = Task.IMPORTANCE_MUST_DO; public static final int SYNC_TASK_IMPORTANCE = Task.IMPORTANCE_MUST_DO;
protected Task createTask(boolean suppress) { protected Task createTask() {
return createTask(SYNC_TASK_TITLE, suppress); return createTask(SYNC_TASK_TITLE);
} }
protected TagData createTagData(String name) { protected TagData createTagData(String name) {

@ -36,11 +36,10 @@ public final class Compatibility {
* on API 7 and below. * on API 7 and below.
* *
* @param context context to get the external files directory for * @param context context to get the external files directory for
* @param type the type of files directory to return (may be null)
* @return the path of the directory holding application files on external * @return the path of the directory holding application files on external
* storage, or null if external storage cannot be accessed * storage, or null if external storage cannot be accessed
*/ */
public static File getExternalFilesDir(final Context context, final String type) { public static File getExternalFilesDir(final Context context) {
if (METHOD_GET_EXTERNAL_FILES_DIR == null) { if (METHOD_GET_EXTERNAL_FILES_DIR == null) {
final File externalRoot = Environment.getExternalStorageDirectory(); final File externalRoot = Environment.getExternalStorageDirectory();
if (externalRoot == null) { if (externalRoot == null) {
@ -51,7 +50,7 @@ public final class Compatibility {
return new File(externalRoot, "Android/data/" + packageName + "/files"); return new File(externalRoot, "Android/data/" + packageName + "/files");
} else { } else {
try { try {
return (File) METHOD_GET_EXTERNAL_FILES_DIR.invoke(context, type); return (File) METHOD_GET_EXTERNAL_FILES_DIR.invoke(context, null);
} catch (Exception e) { } catch (Exception e) {
Log.e(LOG_TAG, "Could not invoke getExternalFilesDir: " + e.getMessage(), e); Log.e(LOG_TAG, "Could not invoke getExternalFilesDir: " + e.getMessage(), e);
return null; return null;

@ -203,7 +203,7 @@ public class JUnitReportListener implements TestListener {
return mTargetContext.openFileOutput(fileName, Context.MODE_WORLD_READABLE); return mTargetContext.openFileOutput(fileName, Context.MODE_WORLD_READABLE);
} else { } else {
if (mReportDir.contains(TOKEN_EXTERNAL)) { if (mReportDir.contains(TOKEN_EXTERNAL)) {
File externalDir = Compatibility.getExternalFilesDir(mTargetContext, null); File externalDir = Compatibility.getExternalFilesDir(mTargetContext);
if (externalDir == null) { if (externalDir == null) {
Log.e(LOG_TAG, "reportDir references external storage, but external storage is not available (check mounting and permissions)"); Log.e(LOG_TAG, "reportDir references external storage, but external storage is not available (check mounting and permissions)");
throw new IOException("Cannot access external storage"); throw new IOException("Cannot access external storage");

@ -179,10 +179,6 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@android:style/Theme.Dialog" /> android:theme="@android:style/Theme.Dialog" />
<activity
android:name="com.todoroo.astrid.service.UpdateMessagePreference"
android:theme="@android:style/Theme" />
<activity <activity
android:name="com.todoroo.astrid.service.UpgradeService$UpgradeActivity" android:name="com.todoroo.astrid.service.UpgradeService$UpgradeActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />

@ -203,8 +203,7 @@ public abstract class CommentsFragment extends ListFragment {
cursor = getCursor(); cursor = getCursor();
activity.startManagingCursor(cursor); activity.startManagingCursor(cursor);
updateAdapter = new UpdateAdapter(this, R.layout.update_adapter_row, updateAdapter = new UpdateAdapter(this, R.layout.update_adapter_row, cursor);
cursor, false);
addHeaderToListView(listView); addHeaderToListView(listView);
addFooterToListView(listView); addFooterToListView(listView);
listView.setAdapter(updateAdapter); listView.setAdapter(updateAdapter);

@ -65,7 +65,7 @@ public class TagCommentsFragment extends CommentsFragment {
@Override @Override
protected Cursor getCursor() { protected Cursor getCursor() {
return tagDataService.getActivityForTagData(tagData, null); return tagDataService.getActivityForTagData(tagData);
} }
@Override @Override

@ -260,7 +260,7 @@ public class TagViewFragment extends TaskListFragment {
AndroidUtilities.tryUnregisterReceiver(getActivity(), notifyReceiver); AndroidUtilities.tryUnregisterReceiver(getActivity(), notifyReceiver);
} }
protected void reloadTagData(boolean onActivityResult) { protected void reloadTagData() {
tagData = tagDataService.fetchById(tagData.getId(), TagData.PROPERTIES); // refetch tagData = tagDataService.fetchById(tagData.getId(), TagData.PROPERTIES); // refetch
if (tagData == null) { if (tagData == null) {
// This can happen if a tag has been deleted as part of a sync // This can happen if a tag has been deleted as part of a sync
@ -279,11 +279,7 @@ public class TagViewFragment extends TaskListFragment {
((TaskListActivity) activity).setListsTitle(filter.title); ((TaskListActivity) activity).setListsTitle(filter.title);
FilterListFragment flf = ((TaskListActivity) activity).getFilterListFragment(); FilterListFragment flf = ((TaskListActivity) activity).getFilterListFragment();
if (flf != null) { if (flf != null) {
if (!onActivityResult) { flf.clear();
flf.refresh();
} else {
flf.clear();
}
} }
} }
taskAdapter = null; taskAdapter = null;
@ -293,7 +289,7 @@ public class TagViewFragment extends TaskListFragment {
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_CODE_SETTINGS && resultCode == Activity.RESULT_OK) { if (requestCode == REQUEST_CODE_SETTINGS && resultCode == Activity.RESULT_OK) {
reloadTagData(true); reloadTagData();
} else { } else {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
} }

@ -289,11 +289,10 @@ public class AstridActivity extends ActionBarActivity
// --- fragment helpers // --- fragment helpers
protected Fragment setupFragment(String tag, int container, Class<? extends Fragment> cls, boolean createImmediate, boolean replace) { protected Fragment setupFragment(String tag, int container, Class<? extends Fragment> cls) {
final FragmentManager fm = getSupportFragmentManager(); final FragmentManager fm = getSupportFragmentManager();
Fragment fragment = fm.findFragmentByTag(tag); Fragment fragment = fm.findFragmentByTag(tag);
if(fragment == null || replace) { if(fragment == null) {
Fragment oldFragment = fragment;
try { try {
fragment = cls.newInstance(); fragment = cls.newInstance();
} catch (InstantiationException e) { } catch (InstantiationException e) {
@ -304,23 +303,18 @@ public class AstridActivity extends ActionBarActivity
FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
if (container == 0) { if (container == 0) {
if (oldFragment != null && replace) {
ft.remove(oldFragment);
}
ft.add(fragment, tag); ft.add(fragment, tag);
} }
else { else {
ft.replace(container, fragment, tag); ft.replace(container, fragment, tag);
} }
ft.commit(); ft.commit();
if (createImmediate) { runOnUiThread(new Runnable() {
runOnUiThread(new Runnable() { @Override
@Override public void run() {
public void run() { fm.executePendingTransactions();
fm.executePendingTransactions(); }
} });
});
}
} }
return fragment; return fragment;
} }

@ -30,7 +30,6 @@ import java.util.HashMap;
public class BeastModePreferences extends ListActivity { public class BeastModePreferences extends ListActivity {
private TouchListView touchList;
private ArrayAdapter<String> adapter; private ArrayAdapter<String> adapter;
private ArrayList<String> items; private ArrayList<String> items;
@ -81,14 +80,11 @@ public class BeastModePreferences extends ListActivity {
Preferences.setBoolean(BEAST_MODE_ASSERTED_HIDE_ALWAYS, true); Preferences.setBoolean(BEAST_MODE_ASSERTED_HIDE_ALWAYS, true);
} }
public static void setDefaultOrder(Context context, boolean force) { public static void setDefaultOrder(Context context) {
if (Preferences.getStringValue(BEAST_MODE_ORDER_PREF) != null && !force) { if (Preferences.getStringValue(BEAST_MODE_ORDER_PREF) != null) {
return; return;
} }
if (force) {
Preferences.clear(BEAST_MODE_ORDER_PREF);
}
ArrayList<String> list = constructOrderedControlList(context); ArrayList<String> list = constructOrderedControlList(context);
StringBuilder newSetting = new StringBuilder(30); StringBuilder newSetting = new StringBuilder(30);
for (String item : list) { for (String item : list) {
@ -107,7 +103,7 @@ public class BeastModePreferences extends ListActivity {
prefsToDescriptions = new HashMap<String, String>(); prefsToDescriptions = new HashMap<String, String>();
buildDescriptionMap(getResources()); buildDescriptionMap(getResources());
touchList = (TouchListView) getListView(); TouchListView touchList = (TouchListView) getListView();
items = constructOrderedControlList(this); items = constructOrderedControlList(this);
adapter = new ArrayAdapter<String>(this, R.layout.preference_draggable_row, R.id.text, items) { adapter = new ArrayAdapter<String>(this, R.layout.preference_draggable_row, R.id.text, items) {

@ -102,8 +102,7 @@ public class FilterListFragment extends ListFragment {
} }
private FilterAdapter instantiateAdapter() { private FilterAdapter instantiateAdapter() {
return new FilterAdapter(getActivity(), null, return new FilterAdapter(getActivity(), R.layout.filter_adapter_row);
R.layout.filter_adapter_row, false);
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -114,7 +113,7 @@ public class FilterListFragment extends ListFragment {
Bundle savedInstanceState) { Bundle savedInstanceState) {
Activity activity = getActivity(); Activity activity = getActivity();
int layout = getLayout(); int layout = getLayout();
return (ViewGroup) activity.getLayoutInflater().inflate(layout, container, false); return activity.getLayoutInflater().inflate(layout, container, false);
} }
protected int getLayout() { protected int getLayout() {

@ -144,7 +144,7 @@ public class ShortcutActivity extends Activity {
Set<String> keys = extras.keySet(); Set<String> keys = extras.keySet();
for (String key : keys) { for (String key : keys) {
if (AndroidUtilities.indexOf(CUSTOM_EXTRAS, key) < 0) { if (AndroidUtilities.indexOf(CUSTOM_EXTRAS, key) < 0) {
AndroidUtilities.putInto(customExtras, key, extras.get(key), false); AndroidUtilities.putInto(customExtras, key, extras.get(key));
} }
} }

@ -178,11 +178,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
// --- UI components // --- UI components
private ImageButton voiceAddNoteButton;
private EditNotesControlSet notesControlSet = null; private EditNotesControlSet notesControlSet = null;
private HideUntilControlSet hideUntilControls = null;
private TagsControlSet tagsControlSet = null;
private FilesControlSet filesControlSet = null; private FilesControlSet filesControlSet = null;
private TimerActionControlSet timerAction; private TimerActionControlSet timerAction;
private EditText title; private EditText title;
@ -216,8 +212,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
private boolean showEditComments; private boolean showEditComments;
private int tabStyle = 0;
/* /*
* ====================================================================== * ======================================================================
* ======================================================= initialization * ======================================================= initialization
@ -300,7 +294,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
long idParam = getActivity().getIntent().getLongExtra(TOKEN_ID, -1L); long idParam = getActivity().getIntent().getLongExtra(TOKEN_ID, -1L);
tabStyle = TaskEditViewPager.TAB_SHOW_ACTIVITY; int tabStyle = TaskEditViewPager.TAB_SHOW_ACTIVITY;
if (!showEditComments) { if (!showEditComments) {
tabStyle &= ~TaskEditViewPager.TAB_SHOW_ACTIVITY; tabStyle &= ~TaskEditViewPager.TAB_SHOW_ACTIVITY;
@ -372,7 +366,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
getActivity(), getView()); getActivity(), getView());
controls.add(timerAction); controls.add(timerAction);
tagsControlSet = new TagsControlSet(getActivity(), TagsControlSet tagsControlSet = new TagsControlSet(getActivity(),
R.layout.control_set_tags, R.layout.control_set_tags,
R.layout.control_set_default_display, R.string.TEA_tags_label_long); R.layout.control_set_default_display, R.string.TEA_tags_label_long);
controls.add(tagsControlSet); controls.add(tagsControlSet);
@ -426,7 +420,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
controlSetMap.put(getString(R.string.TEA_ctrl_reminders_pref), controlSetMap.put(getString(R.string.TEA_ctrl_reminders_pref),
reminderControl); reminderControl);
hideUntilControls = new HideUntilControlSet(getActivity(), HideUntilControlSet hideUntilControls = new HideUntilControlSet(getActivity(),
R.layout.control_set_hide, R.layout.control_set_hide,
R.layout.control_set_default_display, R.layout.control_set_default_display,
R.string.hide_until_prompt); R.string.hide_until_prompt);
@ -540,12 +534,12 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
// prepare and set listener for voice-button // prepare and set listener for voice-button
if (getActivity() != null) { if (getActivity() != null) {
if (VoiceRecognizer.voiceInputAvailable(getActivity())) { if (VoiceRecognizer.voiceInputAvailable(getActivity())) {
voiceAddNoteButton = (ImageButton) notesControlSet.getView().findViewById( ImageButton voiceAddNoteButton = (ImageButton) notesControlSet.getView().findViewById(
R.id.voiceAddNoteButton); R.id.voiceAddNoteButton);
voiceAddNoteButton.setVisibility(View.VISIBLE); voiceAddNoteButton.setVisibility(View.VISIBLE);
int prompt = R.string.voice_edit_note_prompt; int prompt = R.string.voice_edit_note_prompt;
voiceNoteAssistant = new VoiceInputAssistant(voiceAddNoteButton, REQUEST_VOICE_RECOG); voiceNoteAssistant = new VoiceInputAssistant(voiceAddNoteButton, REQUEST_VOICE_RECOG);
voiceNoteAssistant.setAppend(true); voiceNoteAssistant.setAppend();
voiceNoteAssistant.setLanguageModel(RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); voiceNoteAssistant.setLanguageModel(RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
voiceNoteAssistant.configureMicrophoneButton(TaskEditFragment.this, prompt); voiceNoteAssistant.configureMicrophoneButton(TaskEditFragment.this, prompt);
} }

@ -20,7 +20,7 @@ public class TaskEditViewPager extends PagerAdapter {
private final String[] titles; private final String[] titles;
public TaskEditFragment parent; public TaskEditFragment parent;
public static final int TAB_SHOW_ACTIVITY = 1 << 0; public static final int TAB_SHOW_ACTIVITY = 1;
public TaskEditViewPager(Context context, int tabStyleMask) { public TaskEditViewPager(Context context, int tabStyleMask) {
ArrayList<String> titleList = new ArrayList<String>(); ArrayList<String> titleList = new ArrayList<String>();

@ -214,7 +214,7 @@ public class TaskListActivity extends AstridActivity implements OnPageChangeList
} }
setupPopoverWithFilterList((FilterListFragment) setupFragment(FilterListFragment.TAG_FILTERLIST_FRAGMENT, 0, setupPopoverWithFilterList((FilterListFragment) setupFragment(FilterListFragment.TAG_FILTERLIST_FRAGMENT, 0,
filterModeSpec.getFilterListClass(), true, false)); filterModeSpec.getFilterListClass()));
} }
private void setupLayoutTransitions() { private void setupLayoutTransitions() {

@ -696,8 +696,7 @@ public class TaskListFragment extends ListFragment implements OnSortSelectedList
if (AstridApiConstants.BROADCAST_SEND_DECORATIONS.equals(intent.getAction())) { if (AstridApiConstants.BROADCAST_SEND_DECORATIONS.equals(intent.getAction())) {
TaskDecoration deco = receivedExtras.getParcelable(AstridApiConstants.EXTRAS_RESPONSE); TaskDecoration deco = receivedExtras.getParcelable(AstridApiConstants.EXTRAS_RESPONSE);
taskAdapter.decorationManager.addNew(taskId, addOn, deco, taskAdapter.decorationManager.addNew(taskId, addOn, deco);
null);
} else if (AstridApiConstants.BROADCAST_SEND_DETAILS.equals(intent.getAction())) { } else if (AstridApiConstants.BROADCAST_SEND_DETAILS.equals(intent.getAction())) {
String detail = receivedExtras.getString(AstridApiConstants.EXTRAS_RESPONSE); String detail = receivedExtras.getString(AstridApiConstants.EXTRAS_RESPONSE);
taskAdapter.addDetails(taskId, detail); taskAdapter.addDetails(taskId, detail);
@ -781,7 +780,7 @@ public class TaskListFragment extends ListFragment implements OnSortSelectedList
protected TaskAdapter createTaskAdapter(TodorooCursor<Task> cursor) { protected TaskAdapter createTaskAdapter(TodorooCursor<Task> cursor) {
return new TaskAdapter(this, getTaskRowResource(), return new TaskAdapter(this, getTaskRowResource(),
cursor, sqlQueryTemplate, false, cursor, sqlQueryTemplate,
new OnCompletedTaskListener() { new OnCompletedTaskListener() {
@Override @Override
public void onCompletedTask(Task item, boolean newState) { public void onCompletedTask(Task item, boolean newState) {

@ -107,9 +107,8 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
// be added). // be added).
private final ThreadPoolExecutor filterExecutor = new ThreadPoolExecutor(0, 1, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); private final ThreadPoolExecutor filterExecutor = new ThreadPoolExecutor(0, 1, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
public FilterAdapter(Activity activity, ListView listView, public FilterAdapter(Activity activity, int rowLayout) {
int rowLayout, boolean skipIntentFilters) { this(activity, null, rowLayout, false, false);
this(activity, listView, rowLayout, skipIntentFilters, false);
} }
public FilterAdapter(Activity activity, ListView listView, public FilterAdapter(Activity activity, ListView listView,

@ -18,7 +18,6 @@ import android.graphics.Paint;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.text.Html; import android.text.Html;
import android.text.Html.ImageGetter; import android.text.Html.ImageGetter;
import android.text.Html.TagHandler;
import android.text.Spannable; import android.text.Spannable;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.Spanned; import android.text.Spanned;
@ -194,7 +193,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
protected OnCompletedTaskListener onCompletedTaskListener = null; protected OnCompletedTaskListener onCompletedTaskListener = null;
protected final int resource; protected final int resource;
protected final LayoutInflater inflater; protected final LayoutInflater inflater;
private DetailLoaderThread detailLoader;
private int fontSize; private int fontSize;
private long mostRecentlyMade = -1; private long mostRecentlyMade = -1;
private final ScaleAnimation scaleAnimation; private final ScaleAnimation scaleAnimation;
@ -223,15 +221,12 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
* layout resource to inflate * layout resource to inflate
* @param c * @param c
* database cursor * database cursor
* @param autoRequery
* whether cursor is automatically re-queried on changes
* @param onCompletedTaskListener * @param onCompletedTaskListener
* task listener. can be null * task listener. can be null
*/ */
public TaskAdapter(TaskListFragment fragment, int resource, public TaskAdapter(TaskListFragment fragment, int resource,
Cursor c, AtomicReference<String> query, boolean autoRequery, Cursor c, AtomicReference<String> query, OnCompletedTaskListener onCompletedTaskListener) {
OnCompletedTaskListener onCompletedTaskListener) { super(ContextManager.getContext(), c, false);
super(ContextManager.getContext(), c, autoRequery);
DependencyInjectionService.getInstance().inject(this); DependencyInjectionService.getInstance().inject(this);
this.context = ContextManager.getContext(); this.context = ContextManager.getContext();
@ -298,7 +293,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
private void startDetailThread() { private void startDetailThread() {
if (Preferences.getBoolean(R.string.p_showNotes, false) && !simpleLayout && !titleOnlyLayout) { if (Preferences.getBoolean(R.string.p_showNotes, false) && !simpleLayout && !titleOnlyLayout) {
detailLoader = new DetailLoaderThread(); DetailLoaderThread detailLoader = new DetailLoaderThread();
detailLoader.start(); detailLoader.start();
} }
} }
@ -539,7 +534,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
int i = 0; int i = 0;
for(; i < splitDetails.length; i++) { for(; i < splitDetails.length; i++) {
Spanned spanned = convertToHtml(splitDetails[i] + " ", detailImageGetter, null); Spanned spanned = convertToHtml(splitDetails[i] + " ", detailImageGetter);
prospective.insert(prospective.length(), spanned); prospective.insert(prospective.length(), spanned);
viewHolder.details1.setText(prospective); viewHolder.details1.setText(prospective);
viewHolder.details1.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); viewHolder.details1.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
@ -561,7 +556,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
} }
for(; i < splitDetails.length; i++) { for(; i < splitDetails.length; i++) {
actual.insert(actual.length(), convertToHtml(splitDetails[i] + " ", detailImageGetter, null)); actual.insert(actual.length(), convertToHtml(splitDetails[i] + " ", detailImageGetter));
} }
viewHolder.details2.setText(actual); viewHolder.details2.setText(actual);
} }
@ -662,11 +657,11 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
private final HashMap<String, Spanned> htmlCache = new HashMap<String, Spanned>(8); private final HashMap<String, Spanned> htmlCache = new HashMap<String, Spanned>(8);
private Spanned convertToHtml(String string, ImageGetter imageGetter, TagHandler tagHandler) { private Spanned convertToHtml(String string, ImageGetter imageGetter) {
if(!htmlCache.containsKey(string)) { if(!htmlCache.containsKey(string)) {
Spanned html; Spanned html;
try { try {
html = Html.fromHtml(string, imageGetter, tagHandler); html = Html.fromHtml(string, imageGetter, null);
} catch (RuntimeException e) { } catch (RuntimeException e) {
html = Spannable.Factory.getInstance().newSpannable(string); html = Spannable.Factory.getInstance().newSpannable(string);
} }

@ -77,12 +77,10 @@ public class UpdateAdapter extends CursorAdapter {
* layout resource to inflate * layout resource to inflate
* @param c * @param c
* database cursor * database cursor
* @param autoRequery
* whether cursor is automatically re-queried on changes
*/ */
public UpdateAdapter(Fragment fragment, int resource, public UpdateAdapter(Fragment fragment, int resource,
Cursor c, boolean autoRequery) { Cursor c) {
super(fragment.getActivity(), c, autoRequery); super(fragment.getActivity(), c, false);
DependencyInjectionService.getInstance().inject(this); DependencyInjectionService.getInstance().inject(this);
inflater = (LayoutInflater) fragment.getActivity().getSystemService( inflater = (LayoutInflater) fragment.getActivity().getSystemService(

@ -91,7 +91,7 @@ public class AlarmService {
PendingIntent pendingIntent = pendingIntentForAlarm(m, taskId); PendingIntent pendingIntent = pendingIntentForAlarm(m, taskId);
am.cancel(pendingIntent); am.cancel(pendingIntent);
} }
}, true); });
if(changed) { if(changed) {
scheduleAlarms(taskId); scheduleAlarms(taskId);

@ -75,7 +75,7 @@ public class BackupPreferences extends TodorooPreferenceActivity {
findPreference(getString(R.string.backup_BAc_export)).setOnPreferenceClickListener(new OnPreferenceClickListener() { findPreference(getString(R.string.backup_BAc_export)).setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override @Override
public boolean onPreferenceClick(Preference preference) { public boolean onPreferenceClick(Preference preference) {
TasksXmlExporter.exportTasks(BackupPreferences.this, TasksXmlExporter.ExportType.EXPORT_TYPE_MANUAL, null, null); TasksXmlExporter.exportTasks(BackupPreferences.this, TasksXmlExporter.ExportType.EXPORT_TYPE_MANUAL, null);
return true; return true;
} }
}); });

@ -83,7 +83,7 @@ public class BackupService extends Service {
} }
TasksXmlExporter.exportTasks(context, TasksXmlExporter.ExportType.EXPORT_TYPE_SERVICE, TasksXmlExporter.exportTasks(context, TasksXmlExporter.ExportType.EXPORT_TYPE_SERVICE,
backupDirectorySetting.getBackupDirectory(), null); backupDirectorySetting.getBackupDirectory());
} catch (Exception e) { } catch (Exception e) {
Log.e("error-backup", "Error starting backups", e); //$NON-NLS-1$ //$NON-NLS-2$ Log.e("error-backup", "Error starting backups", e); //$NON-NLS-1$ //$NON-NLS-2$

@ -52,8 +52,8 @@ public class TasksXmlExporter {
* @param backupDirectoryOverride new backupdirectory, or null to use default * @param backupDirectoryOverride new backupdirectory, or null to use default
*/ */
public static void exportTasks(Context context, ExportType exportType, public static void exportTasks(Context context, ExportType exportType,
File backupDirectoryOverride, String versionName) { File backupDirectoryOverride) {
new TasksXmlExporter(context, exportType, backupDirectoryOverride, versionName); new TasksXmlExporter(context, exportType, backupDirectoryOverride);
} }
public static enum ExportType { public static enum ExportType {
@ -91,12 +91,12 @@ public class TasksXmlExporter {
} }
private TasksXmlExporter(final Context context, final ExportType exportType, private TasksXmlExporter(final Context context, final ExportType exportType,
File backupDirectoryOverride, String versionName) { File backupDirectoryOverride) {
this.context = context; this.context = context;
this.exportCount = 0; this.exportCount = 0;
this.backupDirectory = backupDirectoryOverride == null ? this.backupDirectory = backupDirectoryOverride == null ?
BackupConstants.defaultExportDirectory() : backupDirectoryOverride; BackupConstants.defaultExportDirectory() : backupDirectoryOverride;
this.latestSetVersionName = versionName; this.latestSetVersionName = null;
handler = new Handler(); handler = new Handler();
progressDialog = new ProgressDialog(context); progressDialog = new ProgressDialog(context);

@ -436,7 +436,6 @@ public class TasksXmlImporter {
if(BackupConstants.TASK_TAG.equals(tag) && xpp.getEventType() == XmlPullParser.END_TAG) { if(BackupConstants.TASK_TAG.equals(tag) && xpp.getEventType() == XmlPullParser.END_TAG) {
saveTags(); saveTags();
} else if (tag == null || xpp.getEventType() == XmlPullParser.END_TAG) { } else if (tag == null || xpp.getEventType() == XmlPullParser.END_TAG) {
continue;
} else if (tag.equals(BackupConstants.TASK_TAG)) { } else if (tag.equals(BackupConstants.TASK_TAG)) {
// Parse <task ... > // Parse <task ... >
currentTask = parseTask(); currentTask = parseTask();

@ -96,7 +96,6 @@ public class MissedCallActivity extends Activity {
private String name; private String name;
private String number; private String number;
private String timeString;
private TextView returnCallButton; private TextView returnCallButton;
private TextView callLaterButton; private TextView callLaterButton;
@ -116,7 +115,7 @@ public class MissedCallActivity extends Activity {
name = intent.getStringExtra(EXTRA_NAME); name = intent.getStringExtra(EXTRA_NAME);
number = intent.getStringExtra(EXTRA_NUMBER); number = intent.getStringExtra(EXTRA_NUMBER);
timeString = intent.getStringExtra(EXTRA_TIME); String timeString = intent.getStringExtra(EXTRA_TIME);
long contactId = intent.getExtras().getLong(EXTRA_CONTACT_ID); long contactId = intent.getExtras().getLong(EXTRA_CONTACT_ID);
int color = ThemeService.getThemeColor(); int color = ThemeService.getThemeColor();

@ -136,7 +136,6 @@ public class CustomFilterActivity extends ActionBarActivity {
private ListView listView; private ListView listView;
private TextView filterName; private TextView filterName;
private boolean isDialog;
private CustomFilterAdapter adapter; private CustomFilterAdapter adapter;
private final Map<String,CustomFilterCriterion> criteria = Collections.synchronizedMap(new LinkedHashMap<String,CustomFilterCriterion>()); private final Map<String,CustomFilterCriterion> criteria = Collections.synchronizedMap(new LinkedHashMap<String,CustomFilterCriterion>());
@ -179,8 +178,7 @@ public class CustomFilterActivity extends ActionBarActivity {
} }
private void setupForDialogOrFullscreen() { private void setupForDialogOrFullscreen() {
isDialog = AstridPreferences.useTabletLayout(this); if (AstridPreferences.useTabletLayout(this)) {
if (isDialog) {
setTheme(ThemeService.getDialogTheme()); setTheme(ThemeService.getDialogTheme());
} else { } else {
ThemeService.applyTheme(this); ThemeService.applyTheme(this);
@ -261,7 +259,7 @@ public class CustomFilterActivity extends ActionBarActivity {
Query.select(Task.ID).from(Task.TABLE).where( Query.select(Task.ID).from(Task.TABLE).where(
Criterion.and(TaskCriteria.activeVisibleMine(), Criterion.and(TaskCriteria.activeVisibleMine(),
Task.TITLE.like("%?%"))).toString(), Task.TITLE.like("%?%"))).toString(),
null, getString(R.string.CFC_title_contains_name), "", getString(R.string.CFC_title_contains_name), "",
((BitmapDrawable)r.getDrawable(R.drawable.tango_alpha)).getBitmap(), ((BitmapDrawable)r.getDrawable(R.drawable.tango_alpha)).getBitmap(),
getString(R.string.CFC_title_contains_name)); getString(R.string.CFC_title_contains_name));
criteria.put(IDENTIFIER_TITLE, criterion); criteria.put(IDENTIFIER_TITLE, criterion);

@ -68,12 +68,12 @@ public class LinkActionExposer {
Resources r = context.getResources(); Resources r = context.getResources();
if (hasAttachments) { if (hasAttachments) {
BitmapDrawable icon = getBitmapDrawable(R.drawable.action_attachments, r); BitmapDrawable icon = getBitmapDrawable(R.drawable.action_attachments, r);
return new FilesAction(null, icon); return new FilesAction(icon);
} }
if (hasNotes && !Preferences.getBoolean(R.string.p_showNotes, false)) { if (hasNotes && !Preferences.getBoolean(R.string.p_showNotes, false)) {
BitmapDrawable icon = getBitmapDrawable(R.drawable.action_notes, r); BitmapDrawable icon = getBitmapDrawable(R.drawable.action_notes, r);
return new NotesAction(null, icon); return new NotesAction(icon);
} }
return null; return null;

@ -141,7 +141,7 @@ public class MetadataDao extends DatabaseDao<Metadata> {
public TodorooCursor<Metadata> fetchDangling(Property<?>... properties) { public TodorooCursor<Metadata> fetchDangling(Property<?>... properties) {
Query sql = Query.select(properties).from(Metadata.TABLE).join(Join.left(Task.TABLE, Query sql = Query.select(properties).from(Metadata.TABLE).join(Join.left(Task.TABLE,
Metadata.TASK.eq(Task.ID))).where(Task.TITLE.isNull()); Metadata.TASK.eq(Task.ID))).where(Task.TITLE.isNull());
Cursor cursor = database.rawQuery(sql.toString(), null); Cursor cursor = database.rawQuery(sql.toString());
return new TodorooCursor<Metadata>(cursor, properties); return new TodorooCursor<Metadata>(cursor, properties);
} }
} }

@ -16,7 +16,6 @@ import com.todoroo.andlib.sql.Query;
import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.astrid.core.PluginServices; import com.todoroo.astrid.core.PluginServices;
import com.todoroo.astrid.data.Metadata; import com.todoroo.astrid.data.Metadata;
import com.todoroo.astrid.data.SyncFlags;
import com.todoroo.astrid.data.TagData; import com.todoroo.astrid.data.TagData;
import com.todoroo.astrid.data.TagMetadata; import com.todoroo.astrid.data.TagMetadata;
import com.todoroo.astrid.tags.TagMemberMetadata; import com.todoroo.astrid.tags.TagMemberMetadata;
@ -63,36 +62,27 @@ public class TagMetadataDao extends DatabaseDao<TagMetadata> {
} }
} }
public void createMemberLink(long tagId, String tagUuid, String memberId, boolean suppressOutstanding) { public void createMemberLink(long tagId, String tagUuid, String memberId) {
createMemberLink(tagId, tagUuid, memberId, false, suppressOutstanding); createMemberLink(tagId, tagUuid, memberId, false);
} }
public void createMemberLink(long tagId, String tagUuid, String memberId, boolean removedMember, boolean suppressOutstanding) { public void createMemberLink(long tagId, String tagUuid, String memberId, boolean removedMember) {
TagMetadata newMetadata = TagMemberMetadata.newMemberMetadata(tagId, tagUuid, memberId); TagMetadata newMetadata = TagMemberMetadata.newMemberMetadata(tagId, tagUuid, memberId);
if (removedMember) { if (removedMember) {
newMetadata.setValue(TagMetadata.DELETION_DATE, DateUtilities.now()); newMetadata.setValue(TagMetadata.DELETION_DATE, DateUtilities.now());
} }
if (suppressOutstanding) {
newMetadata.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true);
}
if (update(Criterion.and(TagMetadataCriteria.byTagAndWithKey(tagUuid, TagMemberMetadata.KEY), if (update(Criterion.and(TagMetadataCriteria.byTagAndWithKey(tagUuid, TagMemberMetadata.KEY),
TagMemberMetadata.USER_UUID.eq(memberId)), newMetadata) <= 0) { TagMemberMetadata.USER_UUID.eq(memberId)), newMetadata) <= 0) {
if (suppressOutstanding) {
newMetadata.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true);
}
createNew(newMetadata); createNew(newMetadata);
} }
} }
public void removeMemberLink(long tagId, String tagUuid, String memberId, boolean suppressOutstanding) { public void removeMemberLink(long tagId, String tagUuid, String memberId) {
TagMetadata deleteTemplate = new TagMetadata(); TagMetadata deleteTemplate = new TagMetadata();
deleteTemplate.setValue(TagMetadata.TAG_ID, tagId); // Need this for recording changes in outstanding table deleteTemplate.setValue(TagMetadata.TAG_ID, tagId); // Need this for recording changes in outstanding table
deleteTemplate.setValue(TagMetadata.DELETION_DATE, DateUtilities.now()); deleteTemplate.setValue(TagMetadata.DELETION_DATE, DateUtilities.now());
deleteTemplate.setValue(TagMemberMetadata.USER_UUID, memberId); // Need this for recording changes in outstanding table deleteTemplate.setValue(TagMemberMetadata.USER_UUID, memberId); // Need this for recording changes in outstanding table
if (suppressOutstanding) {
deleteTemplate.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true);
}
update(Criterion.and(TagMetadataCriteria.withKey(TagMemberMetadata.KEY), TagMetadata.DELETION_DATE.eq(0), update(Criterion.and(TagMetadataCriteria.withKey(TagMemberMetadata.KEY), TagMetadata.DELETION_DATE.eq(0),
TagMetadata.TAG_UUID.eq(tagUuid), TagMemberMetadata.USER_UUID.eq(memberId)), deleteTemplate); TagMetadata.TAG_UUID.eq(tagUuid), TagMemberMetadata.USER_UUID.eq(memberId)), deleteTemplate);
} }
@ -133,9 +123,9 @@ public class TagMetadataDao extends DatabaseDao<TagMetadata> {
String email = user.optString("email"); //$NON-NLS-1$ String email = user.optString("email"); //$NON-NLS-1$
if (!TextUtils.isEmpty(id)) { if (!TextUtils.isEmpty(id)) {
createMemberLink(tagId, tagUuid, id, !ids.contains(id), false); createMemberLink(tagId, tagUuid, id, !ids.contains(id));
} else if (!TextUtils.isEmpty(email)) { } else if (!TextUtils.isEmpty(email)) {
createMemberLink(tagId, tagUuid, email, !emails.contains(email), false); createMemberLink(tagId, tagUuid, email, !emails.contains(email));
} }
} }
@ -162,7 +152,7 @@ public class TagMetadataDao extends DatabaseDao<TagMetadata> {
} }
if (!exists) { // Was in database, but not in new members list if (!exists) { // Was in database, but not in new members list
removeMemberLink(tagId, tagUuid, userId, false); removeMemberLink(tagId, tagUuid, userId);
} }
} }
} finally { } finally {
@ -170,11 +160,11 @@ public class TagMetadataDao extends DatabaseDao<TagMetadata> {
} }
for (String email : emails) { for (String email : emails) {
createMemberLink(tagId, tagUuid, email, false); createMemberLink(tagId, tagUuid, email);
} }
for (String id : ids) { for (String id : ids) {
createMemberLink(tagId, tagUuid, id, false); createMemberLink(tagId, tagUuid, id);
} }
} }
} }

@ -5,14 +5,13 @@
*/ */
package com.todoroo.astrid.files; package com.todoroo.astrid.files;
import android.app.PendingIntent;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import com.todoroo.astrid.api.TaskAction; import com.todoroo.astrid.api.TaskAction;
public class FilesAction extends TaskAction { public class FilesAction extends TaskAction {
public FilesAction(PendingIntent intent, BitmapDrawable icon) { public FilesAction(BitmapDrawable icon) {
super(intent, icon); super(null, icon);
} }
} }

@ -59,7 +59,6 @@ public class FilesControlSet extends PopupControlSet {
private final ArrayList<TaskAttachment> files = new ArrayList<TaskAttachment>(); private final ArrayList<TaskAttachment> files = new ArrayList<TaskAttachment>();
private final LinearLayout fileDisplayList; private final LinearLayout fileDisplayList;
private LinearLayout fileList;
private final LayoutInflater inflater; private final LayoutInflater inflater;
private final ImageView image; private final ImageView image;
@ -150,7 +149,7 @@ public class FilesControlSet extends PopupControlSet {
@Override @Override
protected void afterInflate() { protected void afterInflate() {
fileList = (LinearLayout) getView().findViewById(R.id.files_list); LinearLayout fileList = (LinearLayout) getView().findViewById(R.id.files_list);
final LinearLayout finalList = fileList; final LinearLayout finalList = fileList;
fileList.removeAllViews(); fileList.removeAllViews();
LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
@ -204,7 +203,7 @@ public class FilesControlSet extends PopupControlSet {
public void onClick(DialogInterface d, int which) { public void onClick(DialogInterface d, int which) {
downloadFile(m); downloadFile(m);
} }
}, null); });
} }
}); });
} else { } else {
@ -287,7 +286,7 @@ public class FilesControlSet extends PopupControlSet {
searchMarket("com.dataviz.docstogo", R.string.search_market_ms_title, R.string.search_market_ms); //$NON-NLS-1$ searchMarket("com.dataviz.docstogo", R.string.search_market_ms_title, R.string.search_market_ms); //$NON-NLS-1$
} else { } else {
DialogUtilities.okDialog(activity, activity.getString(R.string.file_type_unhandled_title), DialogUtilities.okDialog(activity, activity.getString(R.string.file_type_unhandled_title),
0, activity.getString(R.string.file_type_unhandled), null); 0, activity.getString(R.string.file_type_unhandled));
} }
} }
@ -308,7 +307,7 @@ public class FilesControlSet extends PopupControlSet {
null); null);
} }
} }
}, null); });
} }
private void downloadFile(final TaskAttachment m) { private void downloadFile(final TaskAttachment m) {

@ -34,7 +34,6 @@ public class GtasksInvoker {
private Tasks service; private Tasks service;
private GoogleAccessProtectedResource accessProtectedResource; private GoogleAccessProtectedResource accessProtectedResource;
private String token; private String token;
private JsonFactory jsonFactory;
@Autowired ExceptionService exceptionService; @Autowired ExceptionService exceptionService;
@ -49,7 +48,7 @@ public class GtasksInvoker {
this.token = authToken; this.token = authToken;
accessProtectedResource = new GoogleAccessProtectedResource(authToken); accessProtectedResource = new GoogleAccessProtectedResource(authToken);
jsonFactory = new GsonFactory(); JsonFactory jsonFactory = new GsonFactory();
Context context = ContextManager.getContext(); Context context = ContextManager.getContext();
String key = context.getString(R.string.gapi_key); String key = context.getString(R.string.gapi_key);
service = new Tasks(AndroidHttp.newCompatibleTransport(), accessProtectedResource, jsonFactory); service = new Tasks(AndroidHttp.newCompatibleTransport(), accessProtectedResource, jsonFactory);

@ -67,7 +67,7 @@ public final class GtasksSyncService {
if(DateUtilities.now() - creationDate < 1000) { if(DateUtilities.now() - creationDate < 1000) {
AndroidUtilities.sleepDeep(1000 - (DateUtilities.now() - creationDate)); AndroidUtilities.sleepDeep(1000 - (DateUtilities.now() - creationDate));
} }
pushTaskOnSave(model, model.getMergedValues(), invoker, false); pushTaskOnSave(model, model.getMergedValues(), invoker);
} }
} }
@ -204,11 +204,7 @@ public final class GtasksSyncService {
/** /**
* Synchronize with server when data changes * Synchronize with server when data changes
*/ */
public void pushTaskOnSave(Task task, ContentValues values, GtasksInvoker invoker, boolean sleep) throws IOException { public void pushTaskOnSave(Task task, ContentValues values, GtasksInvoker invoker) throws IOException {
if (sleep) {
AndroidUtilities.sleepDeep(1000L); //Wait for metadata to be saved
}
Metadata gtasksMetadata = gtasksMetadataService.getTaskMetadata(task.getId()); Metadata gtasksMetadata = gtasksMetadataService.getTaskMetadata(task.getId());
com.google.api.services.tasks.model.Task remoteModel; com.google.api.services.tasks.model.Task remoteModel;
boolean newlyCreated = false; boolean newlyCreated = false;

@ -163,7 +163,7 @@ public class GtasksSyncV2Provider extends SyncV2Provider {
for (queued.moveToFirst(); !queued.isAfterLast(); queued.moveToNext()) { for (queued.moveToFirst(); !queued.isAfterLast(); queued.moveToNext()) {
task.readFromCursor(queued); task.readFromCursor(queued);
try { try {
gtasksSyncService.pushTaskOnSave(task, task.getMergedValues(), invoker, false); gtasksSyncService.pushTaskOnSave(task, task.getMergedValues(), invoker);
} catch (GoogleTasksException e) { } catch (GoogleTasksException e) {
handler.handleException("gtasks-sync-io", e, e.getType()); //$NON-NLS-1$ handler.handleException("gtasks-sync-io", e, e.getType()); //$NON-NLS-1$
} catch (IOException e) { } catch (IOException e) {

@ -90,7 +90,7 @@ public class SyncActionHelper {
public void initiateAutomaticSync() { public void initiateAutomaticSync() {
long tasksPushedAt = Preferences.getLong(PREF_LAST_AUTO_SYNC, 0); long tasksPushedAt = Preferences.getLong(PREF_LAST_AUTO_SYNC, 0);
if (DateUtilities.now() - tasksPushedAt > TaskListFragment.AUTOSYNC_INTERVAL) { if (DateUtilities.now() - tasksPushedAt > TaskListFragment.AUTOSYNC_INTERVAL) {
performSyncServiceV2Sync(false); performSyncServiceV2Sync();
} }
} }
@ -140,8 +140,8 @@ public class SyncActionHelper {
// --- sync logic // --- sync logic
protected void performSyncServiceV2Sync(boolean manual) { protected void performSyncServiceV2Sync() {
boolean syncOccurred = syncService.synchronizeActiveTasks(manual, syncResultCallback); boolean syncOccurred = syncService.synchronizeActiveTasks(false, syncResultCallback);
if (syncOccurred) { if (syncOccurred) {
Preferences.setLong(PREF_LAST_AUTO_SYNC, DateUtilities.now()); Preferences.setLong(PREF_LAST_AUTO_SYNC, DateUtilities.now());
} }

@ -31,27 +31,23 @@ abstract public class TaskAdapterAddOnManager<TYPE> {
abstract protected void draw(ViewHolder viewHolder, long taskId, Collection<TYPE> list); abstract protected void draw(ViewHolder viewHolder, long taskId, Collection<TYPE> list);
/** on receive an intent */ /** on receive an intent */
public void addNew(long taskId, String addOn, TYPE item, ViewHolder thisViewHolder) { public void addNew(long taskId, String addOn, TYPE item) {
if(item == null) { if(item == null) {
return; return;
} }
Collection<TYPE> cacheList = addIfNotExists(taskId, addOn, item); Collection<TYPE> cacheList = addIfNotExists(taskId, addOn, item);
if(cacheList != null) { if(cacheList != null) {
if(thisViewHolder != null) { ListView listView = fragment.getListView();
draw(thisViewHolder, taskId, cacheList); // update view if it is visible
} else { int length = listView.getChildCount();
ListView listView = fragment.getListView(); for(int i = 0; i < length; i++) {
// update view if it is visible ViewHolder viewHolder = (ViewHolder) listView.getChildAt(i).getTag();
int length = listView.getChildCount(); if(viewHolder == null || viewHolder.task.getId() != taskId) {
for(int i = 0; i < length; i++) { continue;
ViewHolder viewHolder = (ViewHolder) listView.getChildAt(i).getTag();
if(viewHolder == null || viewHolder.task.getId() != taskId) {
continue;
}
draw(viewHolder, taskId, cacheList);
break;
} }
draw(viewHolder, taskId, cacheList);
break;
} }
} }
} }

@ -91,7 +91,6 @@ public abstract class TaskEditControlSet {
/** /**
* Write to model, if initialization logic has been called * Write to model, if initialization logic has been called
* @return toast text
*/ */
protected abstract void writeToModelAfterInitialized(Task task); protected abstract void writeToModelAfterInitialized(Task task);

@ -5,14 +5,13 @@
*/ */
package com.todoroo.astrid.notes; package com.todoroo.astrid.notes;
import android.app.PendingIntent;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import com.todoroo.astrid.api.TaskAction; import com.todoroo.astrid.api.TaskAction;
public class NotesAction extends TaskAction { public class NotesAction extends TaskAction {
public NotesAction(PendingIntent intent, BitmapDrawable icon) { public NotesAction(BitmapDrawable icon) {
super(intent, icon); super(null, icon);
} }
} }

@ -128,7 +128,7 @@ public class SqlContentProvider extends ContentProvider {
public Cursor query(Uri uri, String[] projection, String selection, public Cursor query(Uri uri, String[] projection, String selection,
String[] selectionArgs, String sortOrder) { String[] selectionArgs, String sortOrder) {
return database.rawQuery(selection, null); return database.rawQuery(selection);
} }
} }

@ -46,8 +46,6 @@ public class NotificationFragment extends TaskListFragment {
// --- implementation // --- implementation
private long taskId;
@Override @Override
protected void initializeData() { protected void initializeData() {
displayNotificationPopup(); displayNotificationPopup();
@ -62,7 +60,7 @@ public class NotificationFragment extends TaskListFragment {
getView().findViewById(R.id.taskListFooter).setVisibility(View.GONE); getView().findViewById(R.id.taskListFooter).setVisibility(View.GONE);
String title = extras.getString(Notifications.EXTRAS_TEXT); String title = extras.getString(Notifications.EXTRAS_TEXT);
taskId = extras.getLong(TOKEN_ID); long taskId = extras.getLong(TOKEN_ID);
new ReminderDialog((AstridActivity) getActivity(), taskId, title).show(); new ReminderDialog((AstridActivity) getActivity(), taskId, title).show();
} }

@ -508,8 +508,8 @@ public class Notifications extends BroadcastReceiver {
Notifications.notificationManager = notificationManager; Notifications.notificationManager = notificationManager;
} }
public static void forceNotificationManager(boolean status) { public static void forceNotificationManager() {
forceNotificationManager = status; forceNotificationManager = true;
} }
} }

@ -87,7 +87,7 @@ public class ReminderPreferences extends TodorooPreferenceActivity {
preference.setSummary(r.getString(R.string.rmd_EPr_vibrate_desc_false)); preference.setSummary(r.getString(R.string.rmd_EPr_vibrate_desc_false));
} }
} else if(r.getString(R.string.p_rmd_snooze_dialog).equals(preference.getKey())) { } else if(r.getString(R.string.p_rmd_snooze_dialog).equals(preference.getKey())) {
if(value == null || ((Boolean)value) == true) { if(value == null || ((Boolean) value)) {
preference.setSummary(r.getString(R.string.rmd_EPr_snooze_dialog_desc_true)); preference.setSummary(r.getString(R.string.rmd_EPr_snooze_dialog_desc_true));
} else { } else {
preference.setSummary(r.getString(R.string.rmd_EPr_snooze_dialog_desc_false)); preference.setSummary(r.getString(R.string.rmd_EPr_snooze_dialog_desc_false));

@ -21,14 +21,6 @@ public abstract class MarketStrategy {
return null; return null;
} }
/**
* Return true if the preference to use the phone layout should be
* turned on by default (only true for Nook)
*/
public boolean defaultPhoneLayout() {
return false;
}
public static class AndroidMarketStrategy extends MarketStrategy { public static class AndroidMarketStrategy extends MarketStrategy {
@Override @Override

@ -100,7 +100,7 @@ public class MetadataService {
* @return true if there were changes * @return true if there were changes
*/ */
public boolean synchronizeMetadata(long taskId, ArrayList<Metadata> metadata, public boolean synchronizeMetadata(long taskId, ArrayList<Metadata> metadata,
Criterion metadataCriterion, SynchronizeMetadataCallback callback, boolean hardDelete) { Criterion metadataCriterion, SynchronizeMetadataCallback callback) {
boolean dirty = false; boolean dirty = false;
HashSet<ContentValues> newMetadataValues = new HashSet<ContentValues>(); HashSet<ContentValues> newMetadataValues = new HashSet<ContentValues>();
for(Metadata metadatum : metadata) { for(Metadata metadatum : metadata) {
@ -142,12 +142,7 @@ public class MetadataService {
if (callback != null) { if (callback != null) {
callback.beforeDeleteMetadata(item); callback.beforeDeleteMetadata(item);
} }
if (hardDelete) { metadataDao.delete(id);
metadataDao.delete(id);
} else {
item.setValue(Metadata.DELETION_DATE, DateUtilities.now());
metadataDao.persist(item);
}
dirty = true; dirty = true;
} }
} finally { } finally {

@ -208,10 +208,7 @@ public class StartupService {
AstridPreferences.setPreferenceDefaults(); AstridPreferences.setPreferenceDefaults();
CalendarStartupReceiver.scheduleCalendarAlarms(context, false); // This needs to be after set preference defaults for the purposes of ab testing CalendarStartupReceiver.scheduleCalendarAlarms(context, false); // This needs to be after set preference defaults for the purposes of ab testing
// check for task killers showTaskKillerHelp(context);
if(!Constants.OEM) {
showTaskKillerHelp(context);
}
hasStartedUp = true; hasStartedUp = true;
} }
@ -239,7 +236,7 @@ public class StartupService {
if (context instanceof Activity) { if (context instanceof Activity) {
Activity activity = (Activity) context; Activity activity = (Activity) context;
DialogUtilities.okDialog(activity, activity.getString(R.string.DB_corrupted_title), DialogUtilities.okDialog(activity, activity.getString(R.string.DB_corrupted_title),
0, activity.getString(R.string.DB_corrupted_body), null); 0, activity.getString(R.string.DB_corrupted_body));
} }
e.printStackTrace(); e.printStackTrace();
} }

@ -79,7 +79,7 @@ public class TagDataService {
} }
} }
private static Query queryForTagData(TagData tagData, Criterion extraCriterion, Property<?>[] activityProperties) { private static Query queryForTagData(TagData tagData, Property<?>[] activityProperties) {
Criterion criteria; Criterion criteria;
if (tagData == null) { if (tagData == null) {
criteria = UserActivity.DELETED_AT.eq(0); criteria = UserActivity.DELETED_AT.eq(0);
@ -91,15 +91,11 @@ public class TagDataService {
.from(Metadata.TABLE).where(Criterion.and(MetadataCriteria.withKey(TaskToTagMetadata.KEY), TaskToTagMetadata.TAG_UUID.eq(tagData.getUuid()))))))); .from(Metadata.TABLE).where(Criterion.and(MetadataCriteria.withKey(TaskToTagMetadata.KEY), TaskToTagMetadata.TAG_UUID.eq(tagData.getUuid())))))));
} }
if (extraCriterion != null) {
criteria = Criterion.and(criteria, extraCriterion);
}
return Query.select(AndroidUtilities.addToArray(Property.class, activityProperties)).where(criteria); return Query.select(AndroidUtilities.addToArray(Property.class, activityProperties)).where(criteria);
} }
public Cursor getActivityForTagData(TagData tagData, Criterion extraCriterion) { public Cursor getActivityForTagData(TagData tagData) {
Query activityQuery = queryForTagData(tagData, extraCriterion, UpdateAdapter.USER_ACTIVITY_PROPERTIES) Query activityQuery = queryForTagData(tagData, UpdateAdapter.USER_ACTIVITY_PROPERTIES)
.from(UserActivity.TABLE); .from(UserActivity.TABLE);
Query resultQuery = activityQuery.orderBy(Order.desc("1")); //$NON-NLS-1$ Query resultQuery = activityQuery.orderBy(Order.desc("1")); //$NON-NLS-1$

@ -404,12 +404,12 @@ public class TaskService {
for (Property<?> property : Metadata.PROPERTIES) { for (Property<?> property : Metadata.PROPERTIES) {
if (property.name.equals(key)) { if (property.name.equals(key)) {
AndroidUtilities.putInto(forMetadata, key, value, true); AndroidUtilities.putInto(forMetadata, key, value);
continue outer; continue outer;
} }
} }
AndroidUtilities.putInto(forTask, key, value, true); AndroidUtilities.putInto(forTask, key, value);
} }
task.mergeWithoutReplacement(forTask); task.mergeWithoutReplacement(forTask);
} }

@ -1,77 +0,0 @@
package com.todoroo.astrid.service;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceActivity;
import com.todoroo.andlib.utility.Preferences;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.tasks.R;
public class UpdateMessagePreference extends PreferenceActivity {
public static final String TOKEN_PREFS_ARRAY = "prefs_array"; //$NON-NLS-1$
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences_blank);
String prefsArray = getIntent().getStringExtra(TOKEN_PREFS_ARRAY);
try {
JSONArray array = new JSONArray(prefsArray);
if (array.length() == 0) {
finish();
}
for (int i = 0; i < array.length(); i++) {
try {
JSONObject pref = array.getJSONObject(i);
addPreferenceFromJSON(pref);
} catch (JSONException e) {
continue;
}
}
} catch (JSONException e) {
finish();
}
}
private void addPreferenceFromJSON(JSONObject obj) {
String type = obj.optString("type", null);
String key = obj.optString("key", null);
String title = obj.optString("title", null);
if (type == null || key == null || title == null) {
return;
}
Preference pref = null;
if ("bool".equals(type)) { // We can add other types we want to support and handle the preference construction here
pref = new CheckBoxPreference(this);
pref.setKey(key);
pref.setTitle(title);
pref.setDefaultValue(Preferences.getBoolean(key, false));
}
if (pref == null) {
return;
}
if (obj.optBoolean("restart")) {
pref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
setResult(RESULT_OK);
return true;
}
});
}
getPreferenceScreen().addPreference(pref);
}
}

@ -192,7 +192,7 @@ public class AstridOrderedListFragmentHelper<LIST> implements OrderedListFragmen
AtomicReference<String> sqlQueryTemplate) { AtomicReference<String> sqlQueryTemplate) {
taskAdapter = new DraggableTaskAdapter(fragment, TaskListFragment.getTaskRowResource(), taskAdapter = new DraggableTaskAdapter(fragment, TaskListFragment.getTaskRowResource(),
cursor, sqlQueryTemplate, false, null); cursor, sqlQueryTemplate);
getTouchListView().setItemHightNormal(taskAdapter.computeFullRowHeight()); getTouchListView().setItemHightNormal(taskAdapter.computeFullRowHeight());
@ -209,10 +209,8 @@ public class AstridOrderedListFragmentHelper<LIST> implements OrderedListFragmen
private final class DraggableTaskAdapter extends TaskAdapter { private final class DraggableTaskAdapter extends TaskAdapter {
private DraggableTaskAdapter(TaskListFragment activity, int resource, private DraggableTaskAdapter(TaskListFragment activity, int resource,
Cursor c, AtomicReference<String> query, boolean autoRequery, Cursor c, AtomicReference<String> query) {
OnCompletedTaskListener onCompletedTaskListener) { super(activity, resource, c, query, null);
super(activity, resource, c, query, autoRequery,
onCompletedTaskListener);
} }
@Override @Override
@ -248,7 +246,7 @@ public class AstridOrderedListFragmentHelper<LIST> implements OrderedListFragmen
final Task model = new Task(); final Task model = new Task();
final long completionDate = completedState ? DateUtilities.now() : 0; final long completionDate = completedState ? DateUtilities.now() : 0;
if(completedState == false) { if(!completedState) {
ArrayList<String> chained = chainedCompletions.get(itemId); ArrayList<String> chained = chainedCompletions.get(itemId);
if(chained != null) { if(chained != null) {
for(String taskId : chained) { for(String taskId : chained) {

@ -204,7 +204,7 @@ public class OrderedMetadataListFragmentHelper<LIST> implements OrderedListFragm
AtomicReference<String> sqlQueryTemplate) { AtomicReference<String> sqlQueryTemplate) {
taskAdapter = new DraggableTaskAdapter(fragment, TaskListFragment.getTaskRowResource(), taskAdapter = new DraggableTaskAdapter(fragment, TaskListFragment.getTaskRowResource(),
cursor, sqlQueryTemplate, false, null); cursor, sqlQueryTemplate);
taskAdapter.addOnCompletedTaskListener(new OnCompletedTaskListener() { taskAdapter.addOnCompletedTaskListener(new OnCompletedTaskListener() {
@Override @Override
@ -219,10 +219,8 @@ public class OrderedMetadataListFragmentHelper<LIST> implements OrderedListFragm
private final class DraggableTaskAdapter extends TaskAdapter { private final class DraggableTaskAdapter extends TaskAdapter {
private DraggableTaskAdapter(TaskListFragment activity, int resource, private DraggableTaskAdapter(TaskListFragment activity, int resource,
Cursor c, AtomicReference<String> query, boolean autoRequery, Cursor c, AtomicReference<String> query) {
OnCompletedTaskListener onCompletedTaskListener) { super(activity, resource, c, query, null);
super(activity, resource, c, query, autoRequery,
onCompletedTaskListener);
} }
@Override @Override
@ -258,7 +256,7 @@ public class OrderedMetadataListFragmentHelper<LIST> implements OrderedListFragm
final Task model = new Task(); final Task model = new Task();
final long completionDate = completedState ? DateUtilities.now() : 0; final long completionDate = completedState ? DateUtilities.now() : 0;
if(completedState == false) { if(!completedState) {
ArrayList<Long> chained = chainedCompletions.get(itemId); ArrayList<Long> chained = chainedCompletions.get(itemId);
if(chained != null) { if(chained != null) {
for(Long taskId : chained) { for(Long taskId : chained) {

@ -73,7 +73,7 @@ public class TagCustomFilterCriteriaExposer extends BroadcastReceiver {
TaskDao.TaskCriteria.activeAndVisible(), TaskDao.TaskCriteria.activeAndVisible(),
MetadataDao.MetadataCriteria.withKey(TaskToTagMetadata.KEY), MetadataDao.MetadataCriteria.withKey(TaskToTagMetadata.KEY),
TaskToTagMetadata.TAG_NAME.like("%?%"), Metadata.DELETION_DATE.eq(0))).toString(), TaskToTagMetadata.TAG_NAME.like("%?%"), Metadata.DELETION_DATE.eq(0))).toString(),
null, context.getString(R.string.CFC_tag_contains_name), "", context.getString(R.string.CFC_tag_contains_name), "",
((BitmapDrawable)r.getDrawable(TagService.getDefaultImageIDForTag(RemoteModel.NO_UUID))).getBitmap(), ((BitmapDrawable)r.getDrawable(TagService.getDefaultImageIDForTag(RemoteModel.NO_UUID))).getBitmap(),
context.getString(R.string.CFC_tag_contains_name)); context.getString(R.string.CFC_tag_contains_name));
ret[j] = criterion; ret[j] = criterion;

@ -32,7 +32,6 @@ import com.todoroo.astrid.dao.TagDataDao;
import com.todoroo.astrid.dao.TaskDao.TaskCriteria; import com.todoroo.astrid.dao.TaskDao.TaskCriteria;
import com.todoroo.astrid.data.Metadata; import com.todoroo.astrid.data.Metadata;
import com.todoroo.astrid.data.RemoteModel; import com.todoroo.astrid.data.RemoteModel;
import com.todoroo.astrid.data.SyncFlags;
import com.todoroo.astrid.data.TagData; import com.todoroo.astrid.data.TagData;
import com.todoroo.astrid.data.Task; import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.service.MetadataService; import com.todoroo.astrid.service.MetadataService;
@ -216,7 +215,7 @@ public final class TagService {
/** /**
* Delete all links between the specified task and the list of tags * Delete all links between the specified task and the list of tags
*/ */
public void deleteLinks(long taskId, String taskUuid, String[] tagUuids, boolean suppressOutstanding) { public void deleteLinks(long taskId, String taskUuid, String[] tagUuids) {
Metadata deleteTemplate = new Metadata(); Metadata deleteTemplate = new Metadata();
deleteTemplate.setValue(Metadata.TASK, taskId); // Need this for recording changes in outstanding table deleteTemplate.setValue(Metadata.TASK, taskId); // Need this for recording changes in outstanding table
deleteTemplate.setValue(Metadata.DELETION_DATE, DateUtilities.now()); deleteTemplate.setValue(Metadata.DELETION_DATE, DateUtilities.now());
@ -225,9 +224,6 @@ public final class TagService {
// TODO: Right now this is in a loop because each deleteTemplate needs the individual tagUuid in order to record // TODO: Right now this is in a loop because each deleteTemplate needs the individual tagUuid in order to record
// the outstanding entry correctly. If possible, this should be improved to a single query // the outstanding entry correctly. If possible, this should be improved to a single query
deleteTemplate.setValue(TaskToTagMetadata.TAG_UUID, uuid); // Need this for recording changes in outstanding table deleteTemplate.setValue(TaskToTagMetadata.TAG_UUID, uuid); // Need this for recording changes in outstanding table
if (suppressOutstanding) {
deleteTemplate.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true);
}
metadataDao.update(Criterion.and(MetadataCriteria.withKey(TaskToTagMetadata.KEY), Metadata.DELETION_DATE.eq(0), metadataDao.update(Criterion.and(MetadataCriteria.withKey(TaskToTagMetadata.KEY), Metadata.DELETION_DATE.eq(0),
TaskToTagMetadata.TASK_UUID.eq(taskUuid), TaskToTagMetadata.TAG_UUID.eq(uuid)), deleteTemplate); TaskToTagMetadata.TASK_UUID.eq(taskUuid), TaskToTagMetadata.TAG_UUID.eq(uuid)), deleteTemplate);
} }
@ -348,7 +344,7 @@ public final class TagService {
} }
// Mark as deleted links that don't exist anymore // Mark as deleted links that don't exist anymore
deleteLinks(taskId, taskUuid, existingLinks.toArray(new String[existingLinks.size()]), false); deleteLinks(taskId, taskUuid, existingLinks.toArray(new String[existingLinks.size()]));
} }
/** /**
@ -402,22 +398,14 @@ public final class TagService {
} }
public int rename(String uuid, String newName) { public int rename(String uuid, String newName) {
return rename(uuid, newName, false);
}
public int rename(String uuid, String newName, boolean suppressSync) {
TagData template = new TagData(); TagData template = new TagData();
template.setValue(TagData.NAME, newName); template.setValue(TagData.NAME, newName);
if (suppressSync) { tagDataDao.update(TagData.UUID.eq(uuid), template);
template.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true);
}
int result = tagDataDao.update(TagData.UUID.eq(uuid), template);
Metadata metadataTemplate = new Metadata(); Metadata metadataTemplate = new Metadata();
metadataTemplate.setValue(TaskToTagMetadata.TAG_NAME, newName); metadataTemplate.setValue(TaskToTagMetadata.TAG_NAME, newName);
result = metadataDao.update(Criterion.and(MetadataCriteria.withKey(TaskToTagMetadata.KEY), TaskToTagMetadata.TAG_UUID.eq(uuid)), metadataTemplate);
return result; return metadataDao.update(Criterion.and(MetadataCriteria.withKey(TaskToTagMetadata.KEY), TaskToTagMetadata.TAG_UUID.eq(uuid)), metadataTemplate);
} }
public static int getDefaultImageIDForTag(String nameOrUUID) { public static int getDefaultImageIDForTag(String nameOrUUID) {

@ -144,11 +144,11 @@ public final class TagsControlSet extends PopupControlSet {
} }
/** Adds a tag to the tag field */ /** Adds a tag to the tag field */
void addTag(String tagName, boolean reuse) { void addTag(String tagName) {
LayoutInflater inflater = activity.getLayoutInflater(); LayoutInflater inflater = activity.getLayoutInflater();
// check if already exists // check if already exists
TextView lastText = null; TextView lastText;
for(int i = 0; i < newTags.getChildCount(); i++) { for(int i = 0; i < newTags.getChildCount(); i++) {
View view = newTags.getChildAt(i); View view = newTags.getChildAt(i);
lastText = (TextView) view.findViewById(R.id.text1); lastText = (TextView) view.findViewById(R.id.text1);
@ -158,12 +158,8 @@ public final class TagsControlSet extends PopupControlSet {
} }
final View tagItem; final View tagItem;
if(reuse && lastText != null && lastText.getText().length() == 0) { tagItem = inflater.inflate(R.layout.tag_edit_row, null);
tagItem = (View) lastText.getParent(); newTags.addView(tagItem);
} else {
tagItem = inflater.inflate(R.layout.tag_edit_row, null);
newTags.addView(tagItem);
}
if(tagName == null) { if(tagName == null) {
tagName = ""; //$NON-NLS-1$ tagName = ""; //$NON-NLS-1$
} }
@ -187,7 +183,7 @@ public final class TagsControlSet extends PopupControlSet {
int count) { int count) {
if(count > 0 && newTags.getChildAt(newTags.getChildCount()-1) == if(count > 0 && newTags.getChildAt(newTags.getChildCount()-1) ==
tagItem) { tagItem) {
addTag("", false); //$NON-NLS-1$ addTag(""); //$NON-NLS-1$
} }
} }
}); });
@ -199,7 +195,7 @@ public final class TagsControlSet extends PopupControlSet {
return false; return false;
} }
if(getLastTextView().getText().length() != 0) { if(getLastTextView().getText().length() != 0) {
addTag("", false); //$NON-NLS-1$ addTag(""); //$NON-NLS-1$
} }
return true; return true;
} }
@ -264,7 +260,7 @@ public final class TagsControlSet extends PopupControlSet {
if(model.getId() != AbstractModel.NO_ID) { if(model.getId() != AbstractModel.NO_ID) {
selectTagsFromModel(); selectTagsFromModel();
} }
addTag("", false); //$NON-NLS-1$ addTag(""); //$NON-NLS-1$
refreshDisplayView(); refreshDisplayView();
populated = true; populated = true;
} }

@ -28,14 +28,34 @@ public class TimerActionControlSet extends TaskEditControlSet {
private final ImageView timerButton; private final ImageView timerButton;
private final Chronometer chronometer; private final Chronometer chronometer;
private final LinearLayout timerContainer;
private boolean timerActive; private boolean timerActive;
private final List<TimerActionListener> listeners = new LinkedList<TimerActionListener>(); private final List<TimerActionListener> listeners = new LinkedList<TimerActionListener>();
public TimerActionControlSet(Activity activity, View parent) { public TimerActionControlSet(final Activity activity, View parent) {
super(activity, -1); super(activity, -1);
timerContainer = (LinearLayout) parent.findViewById(R.id.timer_container); LinearLayout timerContainer = (LinearLayout) parent.findViewById(R.id.timer_container);
timerButton = (ImageView) parent.findViewById(R.id.timer_button); timerButton = (ImageView) parent.findViewById(R.id.timer_button);
OnClickListener timerListener = new OnClickListener() {
@Override
public void onClick(View v) {
if (timerActive) {
TimerPlugin.updateTimer(activity, model, false);
for (TimerActionListener listener : listeners) {
listener.timerStopped(model);
}
chronometer.stop();
} else {
TimerPlugin.updateTimer(activity, model, true);
for (TimerActionListener listener : listeners) {
listener.timerStarted(model);
}
chronometer.start();
}
timerActive = !timerActive;
updateDisplay();
}
};
timerContainer.setOnClickListener(timerListener); timerContainer.setOnClickListener(timerListener);
chronometer = (Chronometer) parent.findViewById(R.id.timer); chronometer = (Chronometer) parent.findViewById(R.id.timer);
} }
@ -61,28 +81,6 @@ public class TimerActionControlSet extends TaskEditControlSet {
// Nothing to do here // Nothing to do here
} }
private final OnClickListener timerListener = new OnClickListener() {
@Override
public void onClick(View v) {
if (timerActive) {
TimerPlugin.updateTimer(activity, model, false);
for(TimerActionListener listener : listeners) {
listener.timerStopped(model);
}
chronometer.stop();
} else {
TimerPlugin.updateTimer(activity, model, true);
for(TimerActionListener listener : listeners) {
listener.timerStarted(model);
}
chronometer.start();
}
timerActive = !timerActive;
updateDisplay();
}
};
private void updateDisplay() { private void updateDisplay() {
final int drawable; final int drawable;
if(timerActive) { if(timerActive) {

@ -43,17 +43,14 @@ public class CalendarView extends View {
private float deltaX; private float deltaX;
private boolean ignoreNextTouch; private boolean ignoreNextTouch;
private Paint borderPaint; private Paint calendarNumberRightAlignPaint;
private Paint calendarNumberRightAlignPaint;
private Paint calendarSelectedNumberRightAlignPaint; private Paint calendarSelectedNumberRightAlignPaint;
private Paint backgroundColorPaint; private Paint backgroundColorPaint;
private Paint monthCenterAlignLargePaint; private Paint monthCenterAlignLargePaint;
private Paint centerAlignPaint; private Paint rightAlignPaint;
private Paint rightAlignPaint;
private Paint todayCalendarPaint; private Paint todayCalendarPaint;
private Paint selectedCalendarPaint; private Paint selectedCalendarPaint;
private Paint dayPaint; private float density;
private float density;
private int leftArrowHeight; private int leftArrowHeight;
private int leftArrowWidth; private int leftArrowWidth;
@ -107,7 +104,7 @@ public class CalendarView extends View {
Resources r = context.getResources(); Resources r = context.getResources();
borderPaint = new Paint(); Paint borderPaint = new Paint();
borderPaint.setAntiAlias(true); borderPaint.setAntiAlias(true);
borderPaint.setColor(r.getColor(R.color.task_edit_deadline_gray)); borderPaint.setColor(r.getColor(R.color.task_edit_deadline_gray));
borderPaint.setStyle(Style.STROKE); borderPaint.setStyle(Style.STROKE);
@ -124,7 +121,7 @@ public class CalendarView extends View {
calendarSelectedNumberRightAlignPaint.setTextSize(TEXT_SIZE * density); calendarSelectedNumberRightAlignPaint.setTextSize(TEXT_SIZE * density);
calendarSelectedNumberRightAlignPaint.setTextAlign(Paint.Align.RIGHT); calendarSelectedNumberRightAlignPaint.setTextAlign(Paint.Align.RIGHT);
dayPaint = new Paint(); Paint dayPaint = new Paint();
dayPaint.setAntiAlias(true); dayPaint.setAntiAlias(true);
dayPaint.setColor(Color.rgb(137, 135, 132)); dayPaint.setColor(Color.rgb(137, 135, 132));
@ -134,7 +131,7 @@ public class CalendarView extends View {
monthCenterAlignLargePaint.setTextAlign(Paint.Align.CENTER); monthCenterAlignLargePaint.setTextAlign(Paint.Align.CENTER);
monthCenterAlignLargePaint.setTextSize(MONTH_TEXT_SIZE * density); monthCenterAlignLargePaint.setTextSize(MONTH_TEXT_SIZE * density);
centerAlignPaint = new Paint(); Paint centerAlignPaint = new Paint();
centerAlignPaint.setAntiAlias(true); centerAlignPaint.setAntiAlias(true);
centerAlignPaint.setColor(r.getColor(R.color.task_edit_deadline_gray)); centerAlignPaint.setColor(r.getColor(R.color.task_edit_deadline_gray));
centerAlignPaint.setTextAlign(Paint.Align.CENTER); centerAlignPaint.setTextAlign(Paint.Align.CENTER);

@ -25,8 +25,6 @@ public class DateAndTimeDialog extends Dialog {
} }
private final DateAndTimePicker dateAndTimePicker; private final DateAndTimePicker dateAndTimePicker;
private final Button okButton;
private final Button cancelButton;
private boolean cancelled = false; private boolean cancelled = false;
private DateAndTimeDialogListener listener; private DateAndTimeDialogListener listener;
@ -54,8 +52,8 @@ public class DateAndTimeDialog extends Dialog {
dateAndTimePicker = (DateAndTimePicker) findViewById(R.id.date_and_time); dateAndTimePicker = (DateAndTimePicker) findViewById(R.id.date_and_time);
dateAndTimePicker.initializeWithDate(startDate); dateAndTimePicker.initializeWithDate(startDate);
okButton = (Button) findViewById(R.id.ok); Button okButton = (Button) findViewById(R.id.ok);
cancelButton = (Button) findViewById(R.id.cancel); Button cancelButton = (Button) findViewById(R.id.cancel);
okButton.setOnClickListener(new View.OnClickListener() { okButton.setOnClickListener(new View.OnClickListener() {
@Override @Override

@ -32,8 +32,6 @@ public class DateAndTimePicker extends LinearLayout {
private static final int SHORTCUT_PADDING = 8; private static final int SHORTCUT_PADDING = 8;
private ArrayList<UrgencyValue> urgencyValues;
private class UrgencyValue { private class UrgencyValue {
public String label; public String label;
public int setting; public int setting;
@ -152,7 +150,7 @@ public class DateAndTimePicker extends LinearLayout {
} }
String[] labels = context.getResources().getStringArray(arrayResource); String[] labels = context.getResources().getStringArray(arrayResource);
urgencyValues = new ArrayList<UrgencyValue>(); ArrayList<UrgencyValue> urgencyValues = new ArrayList<UrgencyValue>();
todayUrgency = new UrgencyValue(labels[2], todayUrgency = new UrgencyValue(labels[2],
Task.URGENCY_TODAY); Task.URGENCY_TODAY);
if (useShortcuts) { if (useShortcuts) {

@ -138,7 +138,7 @@ public class DeadlineControlSet extends PopupControlSet {
* Set whether date and time should be separated by a newline or a comma * Set whether date and time should be separated by a newline or a comma
* in the display view * in the display view
*/ */
public void setIsQuickadd(boolean isQuickadd) { public void setIsQuickadd() {
this.isQuickadd = isQuickadd; this.isQuickadd = true;
} }
} }

@ -150,18 +150,10 @@ public class DraggableListView extends ListView {
/* /*
* Restore size and visibility for all list items * Restore size and visibility for all list items
*/ */
private void unExpandViews(boolean deletion) { private void unExpandViews() {
for (int i = 0;; i++) { for (int i = 0;; i++) {
View v = getChildAt(i); View v = getChildAt(i);
if (v == null) { if (v == null) {
if (deletion) {
// HACK force update of mItemCount
int position = getFirstVisiblePosition();
int y = getChildAt(0).getTop();
setAdapter(getAdapter());
setSelectionFromTop(position, y);
// end hack
}
layoutChildren(); // force children to be recreated where needed layoutChildren(); // force children to be recreated where needed
v = getChildAt(i); v = getChildAt(i);
if (v == null) { if (v == null) {
@ -471,7 +463,7 @@ public class DraggableListView extends ListView {
mDragBitmap = null; mDragBitmap = null;
} }
unExpandViews(false); unExpandViews();
if (mDragView != null) { if (mDragView != null) {
WindowManager wm = (WindowManager) getContext().getSystemService( WindowManager wm = (WindowManager) getContext().getSystemService(

@ -68,32 +68,25 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
private final Runnable mRunnable = new Runnable() { private final Runnable mRunnable = new Runnable() {
@Override @Override
public void run() { public void run() {
long speed = 60;
if (mIncrement) { if (mIncrement) {
changeCurrent(mCurrent + incrementBy); changeCurrent(mCurrent + incrementBy);
mHandler.postDelayed(this, mSpeed); mHandler.postDelayed(this, speed);
} else if (mDecrement) { } else if (mDecrement) {
changeCurrent(mCurrent - incrementBy); changeCurrent(mCurrent - incrementBy);
mHandler.postDelayed(this, mSpeed); mHandler.postDelayed(this, speed);
} }
} }
}; };
private final LayoutInflater mInflater;
private final EditText mText; private final EditText mText;
private final InputFilter mInputFilter;
private final InputFilter mNumberInputFilter; private final InputFilter mNumberInputFilter;
private final Animation mSlideUpOutAnimation;
private final Animation mSlideUpInAnimation;
private final Animation mSlideDownOutAnimation;
private final Animation mSlideDownInAnimation;
private int mStart; private int mStart;
private int mEnd; private int mEnd;
private int mCurrent; private int mCurrent;
private OnChangedListener mListener; private OnChangedListener mListener;
private Formatter mFormatter; private Formatter mFormatter;
private long mSpeed = 60;
private boolean mIncrement; private boolean mIncrement;
private boolean mDecrement; private boolean mDecrement;
@ -117,10 +110,10 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
public NumberPicker(Context context, AttributeSet attrs) { public NumberPicker(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
setOrientation(VERTICAL); setOrientation(VERTICAL);
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mInflater.inflate(getLayout(), this, true); inflater.inflate(getLayout(), this, true);
mHandler = new Handler(); mHandler = new Handler();
mInputFilter = new NumberPickerInputFilter(); InputFilter inputFilter = new NumberPickerInputFilter();
mNumberInputFilter = new NumberRangeKeyListener(); mNumberInputFilter = new NumberRangeKeyListener();
mIncrementButton = (NumberPickerButton) findViewById(R.id.increment); mIncrementButton = (NumberPickerButton) findViewById(R.id.increment);
mIncrementButton.setOnClickListener(this); mIncrementButton.setOnClickListener(this);
@ -133,27 +126,27 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
mText = (EditText) findViewById(R.id.timepicker_input); mText = (EditText) findViewById(R.id.timepicker_input);
mText.setOnFocusChangeListener(this); mText.setOnFocusChangeListener(this);
mText.setFilters(new InputFilter[] { mInputFilter }); mText.setFilters(new InputFilter[] {inputFilter});
// disable keyboard until user requests it // disable keyboard until user requests it
AndroidUtilities.suppressVirtualKeyboard(mText); AndroidUtilities.suppressVirtualKeyboard(mText);
mSlideUpOutAnimation = new TranslateAnimation( Animation slideUpOutAnimation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, -100); Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, -100);
mSlideUpOutAnimation.setDuration(200); slideUpOutAnimation.setDuration(200);
mSlideUpInAnimation = new TranslateAnimation( Animation slideUpInAnimation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, 100, Animation.RELATIVE_TO_SELF, 0); Animation.RELATIVE_TO_SELF, 100, Animation.RELATIVE_TO_SELF, 0);
mSlideUpInAnimation.setDuration(200); slideUpInAnimation.setDuration(200);
mSlideDownOutAnimation = new TranslateAnimation( Animation slideDownOutAnimation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 100); Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 100);
mSlideDownOutAnimation.setDuration(200); slideDownOutAnimation.setDuration(200);
mSlideDownInAnimation = new TranslateAnimation( Animation slideDownInAnimation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, -100, Animation.RELATIVE_TO_SELF, 0); Animation.RELATIVE_TO_SELF, -100, Animation.RELATIVE_TO_SELF, 0);
mSlideDownInAnimation.setDuration(200); slideDownInAnimation.setDuration(200);
if (!isEnabled()) { if (!isEnabled()) {
setEnabled(false); setEnabled(false);

@ -217,7 +217,7 @@ public class QuickAddBar extends LinearLayout {
R.layout.control_set_deadline, R.layout.control_set_deadline,
R.layout.control_set_default_display, null, R.layout.control_set_default_display, null,
repeatControl.getDisplayView(), gcalControl.getDisplayView()); repeatControl.getDisplayView(), gcalControl.getDisplayView());
deadlineControl.setIsQuickadd(true); deadlineControl.setIsQuickadd();
resetControlSets(); resetControlSets();

@ -26,8 +26,6 @@ import org.tasks.R;
* *
*/ */
public class RandomReminderControlSet extends TaskEditControlSet { public class RandomReminderControlSet extends TaskEditControlSet {
/** default interval for spinner if date is unselected */
private final long DEFAULT_INTERVAL = DateUtilities.ONE_WEEK * 2;
private final CheckBox settingCheckbox; private final CheckBox settingCheckbox;
private final Spinner periodSpinner; private final Spinner periodSpinner;
@ -81,7 +79,8 @@ public class RandomReminderControlSet extends TaskEditControlSet {
boolean enabled = time > 0; boolean enabled = time > 0;
if(time <= 0) { if(time <= 0) {
time = DEFAULT_INTERVAL; /* default interval for spinner if date is unselected */
time = DateUtilities.ONE_WEEK * 2;
} }
int i; int i;

@ -16,14 +16,14 @@ import org.tasks.R;
public class AstridDefaultPreferenceSpec extends AstridPreferenceSpec { public class AstridDefaultPreferenceSpec extends AstridPreferenceSpec {
public static interface PreferenceExtras { public static interface PreferenceExtras {
public void setExtras(Context context, SharedPreferences prefs, Editor editor, Resources r, boolean ifUnset); public void setExtras(Context context);
} }
@Override @Override
public void setIfUnset() { public void setIfUnset() {
PreferenceExtras extras = new PreferenceExtras() { PreferenceExtras extras = new PreferenceExtras() {
@Override @Override
public void setExtras(Context context, SharedPreferences prefs, Editor editor, Resources r, boolean ifUnset) { public void setExtras(Context context) {
String dragDropTestInitialized = "android_drag_drop_initialized"; //$NON-NLS-1$ String dragDropTestInitialized = "android_drag_drop_initialized"; //$NON-NLS-1$
if (!Preferences.getBoolean(dragDropTestInitialized, false)) { if (!Preferences.getBoolean(dragDropTestInitialized, false)) {
SharedPreferences publicPrefs = AstridPreferences.getPublicPrefs(context); SharedPreferences publicPrefs = AstridPreferences.getPublicPrefs(context);
@ -38,66 +38,62 @@ public class AstridDefaultPreferenceSpec extends AstridPreferenceSpec {
} }
Preferences.setBoolean(dragDropTestInitialized, true); Preferences.setBoolean(dragDropTestInitialized, true);
} }
BeastModePreferences.setDefaultOrder(context, false); BeastModePreferences.setDefaultOrder(context);
if (Constants.MARKET_STRATEGY.defaultPhoneLayout()) {
setPreference(prefs, editor, r, R.string.p_force_phone_layout, true, ifUnset);
}
} }
}; };
setPrefs(extras, true); setPrefs(extras);
} }
private static void setPrefs(PreferenceExtras extras, boolean ifUnset) { private static void setPrefs(PreferenceExtras extras) {
Context context = ContextManager.getContext(); Context context = ContextManager.getContext();
SharedPreferences prefs = Preferences.getPrefs(context); SharedPreferences prefs = Preferences.getPrefs(context);
Editor editor = prefs.edit(); Editor editor = prefs.edit();
Resources r = context.getResources(); Resources r = context.getResources();
setPreference(prefs, editor, r, R.string.p_default_urgency_key, 0, ifUnset); setPreference(prefs, editor, r, R.string.p_default_urgency_key, 0);
setPreference(prefs, editor, r, R.string.p_default_importance_key, 2, ifUnset); setPreference(prefs, editor, r, R.string.p_default_importance_key, 2);
setPreference(prefs, editor, r, R.string.p_default_hideUntil_key, 0, ifUnset); setPreference(prefs, editor, r, R.string.p_default_hideUntil_key, 0);
setPreference(prefs, editor, r, R.string.p_default_reminders_key, Task.NOTIFY_AT_DEADLINE | Task.NOTIFY_AFTER_DEADLINE, ifUnset); setPreference(prefs, editor, r, R.string.p_default_reminders_key, Task.NOTIFY_AT_DEADLINE | Task.NOTIFY_AFTER_DEADLINE);
setPreference(prefs, editor, r, R.string.p_rmd_default_random_hours, 0, ifUnset); setPreference(prefs, editor, r, R.string.p_rmd_default_random_hours, 0);
setPreference(prefs, editor, r, R.string.p_fontSize, 16, ifUnset); setPreference(prefs, editor, r, R.string.p_fontSize, 16);
setPreference(prefs, editor, r, R.string.p_showNotes, false, ifUnset); setPreference(prefs, editor, r, R.string.p_showNotes, false);
setPreference(prefs, editor, r, R.string.p_field_missed_calls, true, ifUnset); setPreference(prefs, editor, r, R.string.p_field_missed_calls, true);
setPreference(prefs, editor, r, R.string.p_end_at_deadline, true, ifUnset); setPreference(prefs, editor, r, R.string.p_end_at_deadline, true);
setPreference(prefs, editor, r, R.string.p_rmd_persistent, true, ifUnset); setPreference(prefs, editor, r, R.string.p_rmd_persistent, true);
setPreference(prefs, editor, r, R.string.p_show_today_filter, true, ifUnset); setPreference(prefs, editor, r, R.string.p_show_today_filter, true);
setPreference(prefs, editor, r, R.string.p_show_recently_modified_filter, true, ifUnset); setPreference(prefs, editor, r, R.string.p_show_recently_modified_filter, true);
setPreference(prefs, editor, r, R.string.p_show_not_in_list_filter, true, ifUnset); setPreference(prefs, editor, r, R.string.p_show_not_in_list_filter, true);
setPreference(prefs, editor, r, R.string.p_show_menu_search, true, ifUnset); setPreference(prefs, editor, r, R.string.p_show_menu_search, true);
setPreference(prefs, editor, r, R.string.p_show_menu_sync, true, ifUnset); setPreference(prefs, editor, r, R.string.p_show_menu_sync, true);
setPreference(prefs, editor, r, R.string.p_show_menu_sort, true, ifUnset); setPreference(prefs, editor, r, R.string.p_show_menu_sort, true);
setPreference(prefs, editor, r, R.string.p_calendar_reminders, true, ifUnset); setPreference(prefs, editor, r, R.string.p_calendar_reminders, true);
setPreference(prefs, editor, r, R.string.p_use_filters, false, ifUnset); setPreference(prefs, editor, r, R.string.p_use_filters, false);
setPreference(prefs, editor, r, R.string.p_use_dark_theme, false, ifUnset); setPreference(prefs, editor, r, R.string.p_use_dark_theme, false);
setPreference(prefs, editor, r, R.string.p_force_phone_layout, false, ifUnset); setPreference(prefs, editor, r, R.string.p_force_phone_layout, false);
setPreference(prefs, editor, r, R.string.p_show_quickadd_controls, true, ifUnset); setPreference(prefs, editor, r, R.string.p_show_quickadd_controls, true);
setPreference(prefs, editor, r, R.string.p_show_task_edit_comments, true, ifUnset); setPreference(prefs, editor, r, R.string.p_show_task_edit_comments, true);
setPreference(prefs, editor, r, R.string.p_taskRowStyle_v2, "1", ifUnset); //$NON-NLS-1$ setPreference(prefs, editor, r, R.string.p_taskRowStyle_v2, "1"); //$NON-NLS-1$
setPreference(prefs, editor, r, R.string.p_use_date_shortcuts, false, ifUnset); setPreference(prefs, editor, r, R.string.p_use_date_shortcuts, false);
setPreference(prefs, editor, r, R.string.p_save_and_cancel, false, ifUnset); setPreference(prefs, editor, r, R.string.p_save_and_cancel, false);
setPreference(prefs, editor, r, R.string.p_hide_plus_button, true, ifUnset); setPreference(prefs, editor, r, R.string.p_hide_plus_button, true);
extras.setExtras(context, prefs, editor, r, ifUnset); extras.setExtras(context);
editor.commit(); editor.commit();
} }

@ -9,27 +9,15 @@ import com.todoroo.andlib.utility.Preferences;
public abstract class AstridPreferenceSpec { public abstract class AstridPreferenceSpec {
public abstract void setIfUnset(); public abstract void setIfUnset();
protected static void setPreference(SharedPreferences prefs, Editor editor, Resources r, int key, int value, boolean ifUnset) { protected static void setPreference(SharedPreferences prefs, Editor editor, Resources r, int key, int value) {
if (ifUnset) { Preferences.setIfUnset(prefs, editor, r, key, value);
Preferences.setIfUnset(prefs, editor, r, key, value);
} else {
Preferences.setString(r.getString(key), Integer.toString(value));
}
} }
protected static void setPreference(SharedPreferences prefs, Editor editor, Resources r, int key, boolean value, boolean ifUnset) { protected static void setPreference(SharedPreferences prefs, Editor editor, Resources r, int key, boolean value) {
if (ifUnset) { Preferences.setIfUnset(prefs, editor, r, key, value);
Preferences.setIfUnset(prefs, editor, r, key, value);
} else {
Preferences.setBoolean(r.getString(key), value);
}
} }
protected static void setPreference(SharedPreferences prefs, Editor editor, Resources r, int key, String value, boolean ifUnset) { protected static void setPreference(SharedPreferences prefs, Editor editor, Resources r, int key, String value) {
if (ifUnset) { Preferences.setIfUnset(prefs, editor, r, key, value);
Preferences.setIfUnset(prefs, editor, r, key, value);
} else {
Preferences.setString(r.getString(key), value);
}
} }
} }

@ -16,11 +16,6 @@ public final class Constants {
*/ */
public static final String PACKAGE = "org.tasks"; public static final String PACKAGE = "org.tasks";
/**
* Whether this is an OEM installation
*/
public static final boolean OEM = false;
/** /**
* Market selection strategy * Market selection strategy
*/ */

@ -14,7 +14,7 @@ public class Flags {
* writing a background service, send a BROADCAST_EVENT_REFRESH * writing a background service, send a BROADCAST_EVENT_REFRESH
* instead, as this is only checked periodically and when loading task list. * instead, as this is only checked periodically and when loading task list.
*/ */
public static final int REFRESH = 1 << 0; public static final int REFRESH = 1;
/** /**
* If set, indicates tags changed during task save * If set, indicates tags changed during task save

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save