diff --git a/api/src/main/java/com/todoroo/andlib/data/AbstractDatabase.java b/api/src/main/java/com/todoroo/andlib/data/AbstractDatabase.java index a14cd6cb7..e118644fa 100644 --- a/api/src/main/java/com/todoroo/andlib/data/AbstractDatabase.java +++ b/api/src/main/java/com/todoroo/andlib/data/AbstractDatabase.java @@ -66,8 +66,6 @@ abstract public class AbstractDatabase { /** * Upgrades an open database from one version to the next - * @param oldVersion - * @param newVersion * @return true if upgrade was handled, false otherwise */ protected abstract boolean onUpgrade(int oldVersion, int newVersion); @@ -120,8 +118,6 @@ abstract public class AbstractDatabase { /** * Return the name of the table containing these models - * @param modelType - * @return */ public final Table getTable(Class modelType) { for(Table table : getTables()) { diff --git a/api/src/main/java/com/todoroo/andlib/data/AbstractModel.java b/api/src/main/java/com/todoroo/andlib/data/AbstractModel.java index 2458a115d..9863ca0bb 100644 --- a/api/src/main/java/com/todoroo/andlib/data/AbstractModel.java +++ b/api/src/main/java/com/todoroo/andlib/data/AbstractModel.java @@ -270,7 +270,6 @@ public abstract class AbstractModel implements Parcelable, Cloneable { } /** - * @param property * @return true if setValues or values contains this property */ public boolean containsValue(Property property) { @@ -284,7 +283,6 @@ public abstract class AbstractModel implements Parcelable, Cloneable { } /** - * @param property * @return true if setValues or values contains this property, and the value * stored is not null */ @@ -371,7 +369,6 @@ public abstract class AbstractModel implements Parcelable, Cloneable { /** * Clear the key for the given property - * @param property */ public synchronized void clearValue(Property property) { if(setValues != null && setValues.containsKey(property.getColumnName())) { @@ -384,9 +381,6 @@ public abstract class AbstractModel implements Parcelable, Cloneable { /** * Sets the state of the given flag on the given property - * @param property - * @param flag - * @param value */ public void setFlag(IntegerProperty property, int flag, boolean value) { if(value) { diff --git a/api/src/main/java/com/todoroo/andlib/data/ContentResolverDao.java b/api/src/main/java/com/todoroo/andlib/data/ContentResolverDao.java index 39b2a53c8..c969092c0 100644 --- a/api/src/main/java/com/todoroo/andlib/data/ContentResolverDao.java +++ b/api/src/main/java/com/todoroo/andlib/data/ContentResolverDao.java @@ -5,10 +5,6 @@ */ package com.todoroo.andlib.data; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.Set; - import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; @@ -22,6 +18,10 @@ import com.todoroo.andlib.sql.Criterion; import com.todoroo.andlib.sql.Query; import com.todoroo.andlib.utility.AndroidUtilities; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.Set; + /** * DAO for reading and writing values from an Android ContentResolver @@ -57,8 +57,6 @@ public class ContentResolverDao { /** * Returns a URI for a single id - * @param id - * @return */ private Uri uriWithId(long id) { return Uri.withAppendedPath(baseUri, Long.toString(id)); @@ -66,7 +64,6 @@ public class ContentResolverDao { /** * Delete specific item from the given table - * @param id * @return number of rows affected */ public int delete(long id) { @@ -75,7 +72,6 @@ public class ContentResolverDao { /** * Delete by criteria - * @param where * @return number of rows affected */ public int deleteWhere(Criterion where) { @@ -84,8 +80,6 @@ public class ContentResolverDao { /** * Query content provider - * @param query - * @return */ public TodorooCursor query(Query query) { if(debug) { @@ -97,7 +91,6 @@ public class ContentResolverDao { /** * Create new or save existing model - * @param model * @return true if data was written to the db, false otherwise */ public boolean save(TYPE model) { @@ -133,9 +126,6 @@ public class ContentResolverDao { /** * Returns object corresponding to the given identifier * - * @param database - * @param table - * name of table * @param properties * properties to read * @param id diff --git a/api/src/main/java/com/todoroo/andlib/data/DatabaseDao.java b/api/src/main/java/com/todoroo/andlib/data/DatabaseDao.java index 95c283a07..bb7fdbe60 100644 --- a/api/src/main/java/com/todoroo/andlib/data/DatabaseDao.java +++ b/api/src/main/java/com/todoroo/andlib/data/DatabaseDao.java @@ -76,8 +76,6 @@ public class DatabaseDao { /** * Sets database accessed by this DAO. Used for dependency-injected * initialization by child classes and unit tests - * - * @param database */ public void setDatabase(AbstractDatabase database) { if(database == this.database) { @@ -112,9 +110,6 @@ public class DatabaseDao { /** * Construct a query with SQL DSL objects - * - * @param query - * @return */ public TodorooCursor query(Query query) { query.from(table); @@ -127,11 +122,6 @@ public class DatabaseDao { /** * Construct a query with raw SQL - * - * @param properties - * @param selection - * @param selectionArgs - * @return */ public TodorooCursor rawQuery(String selection, String[] selectionArgs, Property... properties) { String[] fields = new String[properties.length]; @@ -145,10 +135,6 @@ public class DatabaseDao { /** * Returns object corresponding to the given identifier - * - * @param database - * @param table - * name of table * @param properties * properties to read * @param id @@ -186,9 +172,6 @@ public class DatabaseDao { /** * Delete the given id - * - * @param database - * @param id * @return true if delete was successful */ public boolean delete(long id) { @@ -346,10 +329,6 @@ public class DatabaseDao { /** * Creates the given item. - * - * @param database - * @param table - * table name * @param item * item model * @return returns true on success. @@ -374,10 +353,6 @@ public class DatabaseDao { /** * Saves the given item. Will not create a new item! - * - * @param database - * @param table - * table name * @param item * item model * @return returns true on success. @@ -427,8 +402,6 @@ public class DatabaseDao { * Returns true if an entry in the outstanding table should be recorded for this * column. Subclasses can override to return false for insignificant columns * (e.g. Task.DETAILS, last modified, etc.) - * @param columnName - * @return */ protected boolean shouldRecordOutstandingEntry(String columnName, Object value) { return true; @@ -439,15 +412,10 @@ public class DatabaseDao { /** * Returns cursor to object corresponding to the given identifier - * - * @param database - * @param table - * name of table * @param properties * properties to read * @param id * id of item - * @return */ protected TodorooCursor fetchItem(long id, Property... properties) { TodorooCursor cursor = query( diff --git a/api/src/main/java/com/todoroo/andlib/data/Table.java b/api/src/main/java/com/todoroo/andlib/data/Table.java index 46ac7cb2d..09eb07dc1 100644 --- a/api/src/main/java/com/todoroo/andlib/data/Table.java +++ b/api/src/main/java/com/todoroo/andlib/data/Table.java @@ -60,8 +60,6 @@ public final class Table extends SqlTable { /** * Create a field object based on the given property - * @param property - * @return */ public Field field(Property property) { if(alias != null) { diff --git a/api/src/main/java/com/todoroo/andlib/data/TodorooCursor.java b/api/src/main/java/com/todoroo/andlib/data/TodorooCursor.java index aadb7e707..fdc16cfb3 100644 --- a/api/src/main/java/com/todoroo/andlib/data/TodorooCursor.java +++ b/api/src/main/java/com/todoroo/andlib/data/TodorooCursor.java @@ -40,7 +40,6 @@ public class TodorooCursor extends CursorWrapper { * Create an AstridCursor from the supplied {@link Cursor} * object. * - * @param cursor * @param properties properties read from this cursor */ public TodorooCursor(Cursor cursor, Property[] properties) { @@ -56,7 +55,6 @@ public class TodorooCursor extends CursorWrapper { * * @param type to return * @param property to retrieve - * @return */ public PROPERTY_TYPE get(Property property) { return (PROPERTY_TYPE)property.accept(reader, this); @@ -71,7 +69,6 @@ public class TodorooCursor extends CursorWrapper { /** * Gets entire property list - * @return */ public Property[] getProperties() { return properties; diff --git a/api/src/main/java/com/todoroo/andlib/service/ContextManager.java b/api/src/main/java/com/todoroo/andlib/service/ContextManager.java index 5f9c88466..202377dc9 100644 --- a/api/src/main/java/com/todoroo/andlib/service/ContextManager.java +++ b/api/src/main/java/com/todoroo/andlib/service/ContextManager.java @@ -24,8 +24,6 @@ public final class ContextManager { /** * Sets the global context - * - * @param context */ public static void setContext(Context context) { if(context == null || context.getApplicationContext() == null) { @@ -48,7 +46,6 @@ public final class ContextManager { * Convenience method to read a string from the resources * * @param resId resource - * @param parameters % arguments * @return resource string */ public static String getString(int resId, Object... formatArgs) { diff --git a/api/src/main/java/com/todoroo/andlib/service/DependencyInjectionService.java b/api/src/main/java/com/todoroo/andlib/service/DependencyInjectionService.java index 875563c86..2147722e6 100644 --- a/api/src/main/java/com/todoroo/andlib/service/DependencyInjectionService.java +++ b/api/src/main/java/com/todoroo/andlib/service/DependencyInjectionService.java @@ -145,7 +145,6 @@ public class DependencyInjectionService { /** * Gets the singleton instance of the dependency injection service. - * @return */ public synchronized static DependencyInjectionService getInstance() { if(instance == null) { @@ -156,7 +155,6 @@ public class DependencyInjectionService { /** * Removes the supplied injector - * @return */ public synchronized void removeInjector(AbstractDependencyInjector injector) { injectors.remove(injector); @@ -164,7 +162,6 @@ public class DependencyInjectionService { /** * Adds a Dependency Injector to the front of the list - * @param injectors */ public synchronized void addInjector(AbstractDependencyInjector injector) { removeInjector(injector); diff --git a/api/src/main/java/com/todoroo/andlib/service/ExceptionService.java b/api/src/main/java/com/todoroo/andlib/service/ExceptionService.java index 1986105c0..f64cbe2ce 100644 --- a/api/src/main/java/com/todoroo/andlib/service/ExceptionService.java +++ b/api/src/main/java/com/todoroo/andlib/service/ExceptionService.java @@ -114,9 +114,6 @@ public class ExceptionService { /** * Report the error to the logs - * - * @param name - * @param error */ @Override public void handleError(String name, Throwable error) { diff --git a/api/src/main/java/com/todoroo/andlib/service/HttpRestClient.java b/api/src/main/java/com/todoroo/andlib/service/HttpRestClient.java index 8e26de7bf..23b2bcce0 100644 --- a/api/src/main/java/com/todoroo/andlib/service/HttpRestClient.java +++ b/api/src/main/java/com/todoroo/andlib/service/HttpRestClient.java @@ -215,7 +215,6 @@ public class HttpRestClient implements RestClient { /** * Issue an HTTP POST for the given URL, return the response * - * @param url * @param data * url-encoded data * @throws IOException diff --git a/api/src/main/java/com/todoroo/andlib/sql/Query.java b/api/src/main/java/com/todoroo/andlib/sql/Query.java index 0bdead45f..eab4c7f61 100644 --- a/api/src/main/java/com/todoroo/andlib/sql/Query.java +++ b/api/src/main/java/com/todoroo/andlib/sql/Query.java @@ -228,7 +228,6 @@ public final class Query { /** * Gets a list of fields returned by this query - * @return */ public Property[] getFields() { return fields.toArray(new Property[fields.size()]); @@ -236,7 +235,6 @@ public final class Query { /** * Add the SQL query template (comes after the "from") - * @param template * @return query */ public Query withQueryTemplate(String template) { @@ -246,9 +244,6 @@ public final class Query { /** * Parse out properties and run query - * @param cr - * @param baseUri - * @return */ public Cursor queryContentResolver(ContentResolver cr, Uri baseUri) { Uri uri = baseUri; diff --git a/api/src/main/java/com/todoroo/andlib/sql/UnaryCriterion.java b/api/src/main/java/com/todoroo/andlib/sql/UnaryCriterion.java index 374b941d8..a28fd0e10 100644 --- a/api/src/main/java/com/todoroo/andlib/sql/UnaryCriterion.java +++ b/api/src/main/java/com/todoroo/andlib/sql/UnaryCriterion.java @@ -48,8 +48,6 @@ public class UnaryCriterion extends Criterion { /** * Sanitize the given input for SQL - * @param input - * @return */ public static String sanitize(String input) { return input.replace("'", "''"); diff --git a/api/src/main/java/com/todoroo/andlib/utility/AndroidUtilities.java b/api/src/main/java/com/todoroo/andlib/utility/AndroidUtilities.java index f78b10e79..6368fdb1d 100644 --- a/api/src/main/java/com/todoroo/andlib/utility/AndroidUtilities.java +++ b/api/src/main/java/com/todoroo/andlib/utility/AndroidUtilities.java @@ -5,34 +5,6 @@ */ package com.todoroo.andlib.utility; -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.lang.reflect.Array; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.math.BigInteger; -import java.net.URL; -import java.net.URLConnection; -import java.security.MessageDigest; -import java.util.Arrays; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - import android.app.Activity; import android.content.BroadcastReceiver; import android.content.ContentValues; @@ -60,6 +32,34 @@ import android.widget.TextView; import com.todoroo.andlib.service.ExceptionService; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.lang.reflect.Array; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.math.BigInteger; +import java.net.URL; +import java.net.URLConnection; +import java.security.MessageDigest; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + /** * Android Utility Classes * @@ -148,9 +148,6 @@ public class AndroidUtilities { /** * Start the given intent, handling security exceptions if they arise - * - * @param context - * @param intent * @param request request code. if negative, no request. */ public static void startExternalIntent(Context context, Intent intent, int request) { @@ -169,10 +166,6 @@ public class AndroidUtilities { /** * Start the given intent, handling security exceptions if they arise - * - * @param activity - * @param intent - * @param requestCode */ public static void startExternalIntentForResult( Activity activity, Intent intent, int requestCode) { @@ -187,9 +180,6 @@ public class AndroidUtilities { /** * Put an arbitrary object into a {@link ContentValues} - * @param target - * @param key - * @param value */ public static void putInto(ContentValues target, String key, Object value, boolean errorOnFail) { if (value instanceof Boolean) { @@ -216,9 +206,6 @@ public class AndroidUtilities { /** * Put an arbitrary object into a {@link ContentValues} - * @param target - * @param key - * @param value */ public static void putInto(Bundle target, String key, Object value, boolean errorOnFail) { if (value instanceof Boolean) { @@ -262,7 +249,6 @@ public class AndroidUtilities { * Return index of value in array * @param array array to search * @param value value to look for - * @return */ public static int indexOf(TYPE[] array, TYPE value) { for(int i = 0; i < array.length; i++) { @@ -277,7 +263,6 @@ public class AndroidUtilities { * Return index of value in integer array * @param array array to search * @param value value to look for - * @return */ public static int indexOf(int[] array, int value) { for (int i = 0; i < array.length; i++) { @@ -337,8 +322,6 @@ public class AndroidUtilities { /** * Turn ContentValues into a string - * @param string - * @return */ public static ContentValues contentValuesFromSerializedString(String string) { if(string == null) { @@ -373,8 +356,6 @@ public class AndroidUtilities { /** * Turn {@link android.os.Bundle} into a string - * @param string - * @return */ public static Bundle bundleFromSerializedString(String string) { if(string == null) { @@ -434,8 +415,6 @@ public class AndroidUtilities { /** * Turn ContentValues into a string - * @param string - * @return */ public static ContentValues contentValuesFromString(String string) { if(string == null) { @@ -464,9 +443,6 @@ public class AndroidUtilities { /** * Returns true if a and b or null or a.equals(b) - * @param a - * @param b - * @return */ public static boolean equals(Object a, Object b) { if(a == null && b == null) { @@ -480,9 +456,6 @@ public class AndroidUtilities { /** * Copy a file from one place to another - * - * @param in - * @param out * @throws Exception */ public static void copyFile(File in, File out) throws Exception { @@ -500,8 +473,6 @@ public class AndroidUtilities { /** * Copy stream from source to destination - * @param source - * @param dest * @throws IOException */ public static void copyStream(InputStream source, OutputStream dest) throws IOException { @@ -527,8 +498,6 @@ public class AndroidUtilities { /** * Find a child view of a certain type - * @param view - * @param type * @return first view (by DFS) if found, or null if none */ public static TYPE findViewByType(View view, Class type) { @@ -559,7 +528,6 @@ public class AndroidUtilities { /** * Copy databases to a given folder. Useful for debugging - * @param folder */ public static void copyDatabases(Context context, String folder) { File folderFile = new File(folder); @@ -579,7 +547,6 @@ public class AndroidUtilities { /** * Sort files by date so the newest file is on top - * @param files */ public static void sortFilesByDateDesc(File[] files) { Arrays.sort(files, new Comparator() { @@ -592,8 +559,6 @@ public class AndroidUtilities { /** * Search for the given value in the map, returning key if found - * @param map - * @param value * @return null if not found, otherwise key */ public static KEY findKeyInMap(Map map, VALUE value){ @@ -608,8 +573,6 @@ public class AndroidUtilities { /** * Sleep, ignoring interruption. Before using this method, think carefully * about why you are ignoring interruptions. - * - * @param l */ public static void sleepDeep(long l) { try { @@ -680,7 +643,6 @@ public class AndroidUtilities { /** * Call a method via reflection - * @param class class to call method on * @param receiver object to call method on (can be null) * @param methodName method name to call * @param params method parameter types @@ -711,9 +673,6 @@ public class AndroidUtilities { /** * From Android MyTracks project (http://mytracks.googlecode.com/). * Licensed under the Apache Public License v2 - * @param activity - * @param id - * @return */ public static CharSequence readFile(Context activity, int id) { BufferedReader in = null; @@ -764,8 +723,6 @@ public class AndroidUtilities { /** * Performs an md5 hash on the input string - * @param input - * @return */ public static String md5(String input) { try { @@ -785,9 +742,6 @@ public class AndroidUtilities { /** * Create an intent to a remote activity - * @param appPackage - * @param activityClass - * @return */ public static Intent remoteIntent(String appPackage, String activityClass) { Intent intent = new Intent(); @@ -811,11 +765,6 @@ public class AndroidUtilities { /** * Join items to a list - * @param - * @param list - * @param newList - * @param newItems - * @return */ public static T[] addToArray(Class type, T[] list, T... newItems) { int originalListLength = 0; @@ -859,9 +808,6 @@ public class AndroidUtilities { /** * Concatenate additional stuff to the end of the array - * @param params - * @param additional - * @return */ public static TYPE[] concat(TYPE[] dest, TYPE[] source, TYPE... additional) { int i = 0; @@ -879,8 +825,6 @@ public class AndroidUtilities { * Returns a map where the keys are the values of the map argument * and the values are the corresponding keys. Use at your own * risk if your map is not 1-to-1! - * @param map - * @return */ public static Map reverseMap(Map map) { HashMap reversed = new HashMap(); @@ -894,8 +838,6 @@ public class AndroidUtilities { /** * Capitalize the first character - * @param string - * @return */ public static String capitalize(String string) { return string.substring(0, 1).toUpperCase() + string.substring(1); @@ -903,7 +845,6 @@ public class AndroidUtilities { /** * Dismiss the keyboard if it is displayed by any of the listed views - * @param context * @param views - a list of views that might potentially be displaying the keyboard */ public static void hideSoftInputForViews(Context context, View...views) { @@ -915,8 +856,6 @@ public class AndroidUtilities { /** * Returns true if the screen is large or xtra large - * @param context - * @return */ public static boolean isTabletSized(Context context) { if (context.getPackageManager().hasSystemFeature("com.google.android.tv")) //$NON-NLS-1$ @@ -948,8 +887,6 @@ public class AndroidUtilities { /** * Wraps a call to Activity.unregisterReceiver in a try/catch block to prevent * exceptions being thrown if receiver was never registered with that activity - * @param activity - * @param receiver */ public static void tryUnregisterReceiver(Activity activity, BroadcastReceiver receiver) { try { @@ -961,9 +898,6 @@ public class AndroidUtilities { /** * Dismiss a popup window (should call from main thread) - * - * @param activity - * @param popup */ public static void tryDismissPopup(Activity activity, final PopupWindow popup) { if (popup == null) { @@ -1000,8 +934,6 @@ public class AndroidUtilities { /** * Returns the final word characters after the last '.' - * @param file - * @return */ public static String getFileExtension(String file) { int index = file.lastIndexOf('.'); diff --git a/api/src/main/java/com/todoroo/andlib/utility/DialogUtilities.java b/api/src/main/java/com/todoroo/andlib/utility/DialogUtilities.java index fd5775a5d..e53d8c17c 100644 --- a/api/src/main/java/com/todoroo/andlib/utility/DialogUtilities.java +++ b/api/src/main/java/com/todoroo/andlib/utility/DialogUtilities.java @@ -21,10 +21,6 @@ public class DialogUtilities { /** * Displays a dialog box with a EditText and an ok / cancel - * - * @param activity - * @param text - * @param okListener */ public static void viewDialog(final Activity activity, final String text, final View view, final DialogInterface.OnClickListener okListener, @@ -50,10 +46,6 @@ public class DialogUtilities { /** * Display an OK dialog with HTML content - * - * @param context - * @param html - * @param title */ public static void htmlDialog(Context context, String html, int title) { WebView webView = new WebView(context); @@ -70,10 +62,6 @@ public class DialogUtilities { /** * Displays a dialog box with an OK button - * - * @param activity - * @param text - * @param okListener */ public static void okDialog(final Activity activity, final String text, final DialogInterface.OnClickListener okListener) { @@ -96,10 +84,6 @@ public class DialogUtilities { /** * Displays a dialog box with an OK button - * - * @param activity - * @param text - * @param okListener */ public static void okDialog(final Activity activity, final String title, final int icon, final CharSequence text, @@ -123,12 +107,6 @@ public class DialogUtilities { /** * Displays a dialog box with OK and Cancel buttons and custom title - * - * @param activity - * @param title - * @param text - * @param okListener - * @param cancelListener */ public static void okCancelDialog(final Activity activity, final String title, final String text, final DialogInterface.OnClickListener okListener, @@ -139,11 +117,6 @@ public class DialogUtilities { /** * Displays a dialog box with OK and Cancel buttons - * - * @param activity - * @param text - * @param okListener - * @param cancelListener */ public static void okCancelDialog(final Activity activity, final String text, final DialogInterface.OnClickListener okListener, @@ -203,9 +176,6 @@ public class DialogUtilities { /** * Displays a progress dialog. Must be run on the UI thread - * @param context - * @param text - * @return */ public static ProgressDialog progressDialog(Activity context, String text) { ProgressDialog dialog = new ProgressDialog(context); @@ -219,9 +189,6 @@ public class DialogUtilities { /** * Dismiss a dialog off the UI thread - * - * @param activity - * @param dialog */ public static void dismissDialog(Activity activity, final Dialog dialog) { if(dialog == null) { diff --git a/api/src/main/java/com/todoroo/andlib/utility/Preferences.java b/api/src/main/java/com/todoroo/andlib/utility/Preferences.java index 45a2ca3d9..7101fc10e 100644 --- a/api/src/main/java/com/todoroo/andlib/utility/Preferences.java +++ b/api/src/main/java/com/todoroo/andlib/utility/Preferences.java @@ -24,12 +24,6 @@ public class Preferences { /** * Helper to write to editor if key specified is null. Writes a String * property with the given integer - * - * @param prefs - * @param editor - * @param r - * @param keyResource - * @param value */ public static void setIfUnset(SharedPreferences prefs, Editor editor, Resources r, int keyResource, int value) { String key = r.getString(keyResource); @@ -40,11 +34,6 @@ public class Preferences { /** * Helper to write to editor if key specified is null - * @param prefs - * @param editor - * @param r - * @param keyResource - * @param value */ public static void setIfUnset(SharedPreferences prefs, Editor editor, Resources r, int keyResource, boolean value) { String key = r.getString(keyResource); @@ -55,11 +44,6 @@ public class Preferences { /** * Helper to write to editor if key specified is null - * @param prefs - * @param editor - * @param r - * @param keyResource - * @param value */ public static void setIfUnset(SharedPreferences prefs, Editor editor, Resources r, int keyResource, String value) { String key = r.getString(keyResource); @@ -105,9 +89,6 @@ public class Preferences { /** Gets an string value from a string preference. Returns null * if the value is not set - * - * @param context - * @param key * @return integer value, or null on error */ public static String getStringValue(String key) { @@ -117,9 +98,6 @@ public class Preferences { /** Gets an string value from a string preference. Returns null * if the value is not set - * - * @param context - * @param key * @return integer value, or null on error */ public static String getStringValue(int keyResource) { @@ -152,7 +130,6 @@ public class Preferences { * if the value is not set or not an flat. * * @param keyResource resource from string.xml - * @return */ public static Float getFloatFromString(int keyResource) { Context context = ContextManager.getContext(); @@ -197,9 +174,6 @@ public class Preferences { // --- preference fetching (boolean) /** Gets a boolean preference (e.g. a CheckBoxPreference setting) - * - * @param key - * @param defValue * @return default if value is unset otherwise the value */ public static boolean getBoolean(String key, boolean defValue) { @@ -212,9 +186,6 @@ public class Preferences { } /** Gets a boolean preference (e.g. a CheckBoxPreference setting) - * - * @param keyResource - * @param defValue * @return default if value is unset otherwise the value */ public static boolean getBoolean(int keyResources, boolean defValue) { @@ -223,8 +194,6 @@ public class Preferences { /** * Sets boolean preference - * @param key - * @param value */ public static void setBoolean(int keyResource, boolean value) { setBoolean(ContextManager.getString(keyResource), value); @@ -232,8 +201,6 @@ public class Preferences { /** * Sets boolean preference - * @param key - * @param value */ public static void setBoolean(String key, boolean value) { Context context = ContextManager.getContext(); @@ -245,9 +212,6 @@ public class Preferences { // --- preference fetching (int) /** Gets a int preference - * - * @param key - * @param defValue * @return default if value is unset otherwise the value */ public static int getInt(String key, int defValue) { @@ -257,8 +221,6 @@ public class Preferences { /** * Sets int preference - * @param key - * @param value */ public static void setInt(String key, int value) { Context context = ContextManager.getContext(); @@ -270,9 +232,6 @@ public class Preferences { // --- preference fetching (long) /** Gets a long preference - * - * @param key - * @param defValue * @return default if value is unset otherwise the value */ public static long getLong(String key, long defValue) { @@ -282,8 +241,6 @@ public class Preferences { /** * Sets long preference - * @param key - * @param value */ public static void setLong(String key, long value) { Context context = ContextManager.getContext(); @@ -294,7 +251,6 @@ public class Preferences { /** * Clears a preference - * @param key */ public static void clear(String key) { Context context = ContextManager.getContext(); diff --git a/api/src/main/java/com/todoroo/andlib/utility/TodorooPreferenceActivity.java b/api/src/main/java/com/todoroo/andlib/utility/TodorooPreferenceActivity.java index 06e44c239..a171c17b1 100644 --- a/api/src/main/java/com/todoroo/andlib/utility/TodorooPreferenceActivity.java +++ b/api/src/main/java/com/todoroo/andlib/utility/TodorooPreferenceActivity.java @@ -39,7 +39,6 @@ abstract public class TodorooPreferenceActivity extends PreferenceActivity { /** * Update preferences for the given preference - * @param preference * @param value setting. may be null. */ public abstract void updatePreferences(Preference preference, Object value); diff --git a/api/src/main/java/com/todoroo/astrid/api/Addon.java b/api/src/main/java/com/todoroo/astrid/api/Addon.java index 4923cd85f..89ce9da5e 100644 --- a/api/src/main/java/com/todoroo/astrid/api/Addon.java +++ b/api/src/main/java/com/todoroo/astrid/api/Addon.java @@ -39,11 +39,6 @@ public class Addon implements Parcelable { /** * Convenience constructor to generate a plug-in object - * - * @param addon - * @param title - * @param author - * @param description */ public Addon(String addon, String title, String author, String description) { this.addon = addon; diff --git a/api/src/main/java/com/todoroo/astrid/api/AstridFilterExposer.java b/api/src/main/java/com/todoroo/astrid/api/AstridFilterExposer.java index 92ad3f4d5..84e99d626 100644 --- a/api/src/main/java/com/todoroo/astrid/api/AstridFilterExposer.java +++ b/api/src/main/java/com/todoroo/astrid/api/AstridFilterExposer.java @@ -6,7 +6,7 @@ package com.todoroo.astrid.api; /** - * Common interface for Astrids filter-exposers to provide their {@link FilterListitem}-instances. + * Common interface for Astrids filter-exposers to provide their FilterListitem instances. * * @author Arne Jans */ diff --git a/api/src/main/java/com/todoroo/astrid/api/Filter.java b/api/src/main/java/com/todoroo/astrid/api/Filter.java index ce5d5814e..7e00dc65f 100644 --- a/api/src/main/java/com/todoroo/astrid/api/Filter.java +++ b/api/src/main/java/com/todoroo/astrid/api/Filter.java @@ -81,8 +81,6 @@ public class Filter extends FilterListItem { * filter, e.g. Inbox (20 tasks) * @param sqlQuery * SQL query for this list (see {@link #sqlQuery} for examples). - * @param valuesForNewTasks - * see {@link #sqlForNewTasks} */ public Filter(String listingTitle, String title, QueryTemplate sqlQuery, ContentValues valuesForNewTasks) { @@ -99,8 +97,6 @@ public class Filter extends FilterListItem { * filter, e.g. Inbox (20 tasks) * @param sqlQuery * SQL query for this list (see {@link #sqlQuery} for examples). - * @param valuesForNewTasks - * see {@link #sqlForNewTasks} */ public Filter(String listingTitle, String title, String sqlQuery, ContentValues valuesForNewTasks) { @@ -128,9 +124,6 @@ public class Filter extends FilterListItem { /** * Utility constructor - * - * @param plugin - * {@link Addon} identifier that encompasses object */ protected Filter() { // do nothing @@ -230,7 +223,6 @@ public class Filter extends FilterListItem { }; /** - * @param title * @return a filter that matches nothing */ public static Filter emptyFilter(String title) { diff --git a/api/src/main/java/com/todoroo/astrid/api/FilterCategory.java b/api/src/main/java/com/todoroo/astrid/api/FilterCategory.java index cdbde7259..47b520ed2 100644 --- a/api/src/main/java/com/todoroo/astrid/api/FilterCategory.java +++ b/api/src/main/java/com/todoroo/astrid/api/FilterCategory.java @@ -36,9 +36,6 @@ public class FilterCategory extends FilterListItem { /** * Constructor for creating a new FilterCategory - * - * @param plugin - * {@link Addon} identifier that encompasses object */ protected FilterCategory() { // diff --git a/api/src/main/java/com/todoroo/astrid/api/FilterCategoryWithNewButton.java b/api/src/main/java/com/todoroo/astrid/api/FilterCategoryWithNewButton.java index 4a483c20b..db2b79f0c 100644 --- a/api/src/main/java/com/todoroo/astrid/api/FilterCategoryWithNewButton.java +++ b/api/src/main/java/com/todoroo/astrid/api/FilterCategoryWithNewButton.java @@ -41,9 +41,6 @@ public class FilterCategoryWithNewButton extends FilterCategory { /** * Constructor for creating a new FilterCategory - * - * @param plugin - * {@link Addon} identifier that encompasses object */ protected FilterCategoryWithNewButton() { // diff --git a/api/src/main/java/com/todoroo/astrid/api/FilterListHeader.java b/api/src/main/java/com/todoroo/astrid/api/FilterListHeader.java index cf5601bcf..d501bc70f 100644 --- a/api/src/main/java/com/todoroo/astrid/api/FilterListHeader.java +++ b/api/src/main/java/com/todoroo/astrid/api/FilterListHeader.java @@ -18,9 +18,6 @@ public class FilterListHeader extends FilterListItem { /** * Constructor for creating a new FilterListHeader - * @param listingTitle - * @param listingIconResource - * @param priority */ public FilterListHeader(String listingTitle) { this.listingTitle = listingTitle; @@ -28,9 +25,6 @@ public class FilterListHeader extends FilterListItem { /** * Constructor for creating a new FilterListHeader - * - * @param plugin - * {@link Addon} identifier that encompasses object */ protected FilterListHeader() { // @@ -43,11 +37,6 @@ public class FilterListHeader extends FilterListItem { return 0; } - @Override - public void writeToParcel(Parcel dest, int flags) { - super.writeToParcel(dest, flags); - } - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { @Override diff --git a/api/src/main/java/com/todoroo/astrid/api/FilterListItem.java b/api/src/main/java/com/todoroo/astrid/api/FilterListItem.java index e47031cd3..aa454d897 100644 --- a/api/src/main/java/com/todoroo/astrid/api/FilterListItem.java +++ b/api/src/main/java/com/todoroo/astrid/api/FilterListItem.java @@ -64,8 +64,6 @@ abstract public class FilterListItem implements Parcelable { /** * Utility method to read FilterListItem properties from a parcel. - * - * @param source */ public void readFromParcel(Parcel source) { listingTitle = source.readString(); diff --git a/api/src/main/java/com/todoroo/astrid/api/MultipleSelectCriterion.java b/api/src/main/java/com/todoroo/astrid/api/MultipleSelectCriterion.java index 9a84f4dad..2c1e6ce8d 100644 --- a/api/src/main/java/com/todoroo/astrid/api/MultipleSelectCriterion.java +++ b/api/src/main/java/com/todoroo/astrid/api/MultipleSelectCriterion.java @@ -32,14 +32,6 @@ public class MultipleSelectCriterion extends CustomFilterCriterion implements Pa /** * Create a new CustomFilterCriteria object - * - * @param title - * @param sql - * @param valuesForNewTasks - * @param entryTitles - * @param entryValues - * @param icon - * @param name */ public MultipleSelectCriterion(String identifier, String title, String sql, ContentValues valuesForNewTasks, String[] entryTitles, diff --git a/api/src/main/java/com/todoroo/astrid/api/TaskAction.java b/api/src/main/java/com/todoroo/astrid/api/TaskAction.java index a28774b16..ba66ddae7 100644 --- a/api/src/main/java/com/todoroo/astrid/api/TaskAction.java +++ b/api/src/main/java/com/todoroo/astrid/api/TaskAction.java @@ -41,8 +41,6 @@ public class TaskAction { * * @param text * label to display - * @param intent - * intent to invoke. {@link #EXTRAS_TASK_ID} will be passed */ public TaskAction(String text, PendingIntent intent, BitmapDrawable icon) { super(); diff --git a/api/src/main/java/com/todoroo/astrid/api/TaskDecoration.java b/api/src/main/java/com/todoroo/astrid/api/TaskDecoration.java index b9dc1a8d4..f7fea1b49 100644 --- a/api/src/main/java/com/todoroo/astrid/api/TaskDecoration.java +++ b/api/src/main/java/com/todoroo/astrid/api/TaskDecoration.java @@ -45,8 +45,6 @@ public final class TaskDecoration implements Parcelable { /** * Creates a TaskDetail object - * @param text - * text to display * @param color * color to use for text. Use 0 for default color */ diff --git a/api/src/main/java/com/todoroo/astrid/api/TextInputCriterion.java b/api/src/main/java/com/todoroo/astrid/api/TextInputCriterion.java index 8b9adef25..22e23df3d 100644 --- a/api/src/main/java/com/todoroo/astrid/api/TextInputCriterion.java +++ b/api/src/main/java/com/todoroo/astrid/api/TextInputCriterion.java @@ -32,15 +32,6 @@ public class TextInputCriterion extends CustomFilterCriterion implements Parcela /** * Create a new CustomFilterCriteria object - * - * @param identifier - * @param title - * @param sql - * @param valuesForNewTasks - * @param prompt - * @param hint - * @param icon - * @param name */ public TextInputCriterion(String identifier, String title, String sql, ContentValues valuesForNewTasks, String prompt, String hint, diff --git a/api/src/main/java/com/todoroo/astrid/core/SearchFilter.java b/api/src/main/java/com/todoroo/astrid/core/SearchFilter.java index 339128e7d..e33bf7033 100644 --- a/api/src/main/java/com/todoroo/astrid/core/SearchFilter.java +++ b/api/src/main/java/com/todoroo/astrid/core/SearchFilter.java @@ -45,14 +45,6 @@ public class SearchFilter extends FilterListItem { return 0; } - /** - * {@inheritDoc} - */ - @Override - public void writeToParcel(Parcel dest, int flags) { - super.writeToParcel(dest, flags); - } - /** * Parcelable creator */ diff --git a/api/src/main/java/com/todoroo/astrid/core/SortHelper.java b/api/src/main/java/com/todoroo/astrid/core/SortHelper.java index 9a4a64feb..69c7ad62f 100644 --- a/api/src/main/java/com/todoroo/astrid/core/SortHelper.java +++ b/api/src/main/java/com/todoroo/astrid/core/SortHelper.java @@ -40,10 +40,6 @@ public class SortHelper { /** * Takes a SQL query, and if there isn't already an order, creates an order. - * @param originalSql - * @param flags - * @param sort - * @return */ public static String adjustQueryForFlagsAndSort(String originalSql, int flags, int sort) { // sort @@ -120,7 +116,6 @@ public class SortHelper { /** * Returns SQL task ordering that is astrid's default algorithm - * @return */ public static Order defaultTaskOrder() { return Order.asc(Functions.caseStatement(Task.DUE_DATE.eq(0), diff --git a/api/src/main/java/com/todoroo/astrid/data/Task.java b/api/src/main/java/com/todoroo/astrid/data/Task.java index 48479bfbc..3e7df92db 100644 --- a/api/src/main/java/com/todoroo/astrid/data/Task.java +++ b/api/src/main/java/com/todoroo/astrid/data/Task.java @@ -482,7 +482,6 @@ public final class Task extends RemoteModel { * one of the HIDE_UNTIL_* constants * @param customDate * if specific day is set, this value - * @return */ public long createHideUntil(int setting, long customDate) { long date; diff --git a/api/src/main/java/com/todoroo/astrid/data/TaskApiDao.java b/api/src/main/java/com/todoroo/astrid/data/TaskApiDao.java index ab76fd539..694fd593e 100644 --- a/api/src/main/java/com/todoroo/astrid/data/TaskApiDao.java +++ b/api/src/main/java/com/todoroo/astrid/data/TaskApiDao.java @@ -112,7 +112,6 @@ public class TaskApiDao extends ContentResolverDao { /** * Count tasks matching criterion - * @param criterion * @return # of tasks matching */ public int countTasks(Criterion criterion) { @@ -126,7 +125,6 @@ public class TaskApiDao extends ContentResolverDao { /** * Count tasks matching query tepmlate - * @param queryTemplate * @return # of tasks matching */ public int countTasks(String queryTemplate) { diff --git a/api/src/main/java/com/todoroo/astrid/sync/SyncContainer.java b/api/src/main/java/com/todoroo/astrid/sync/SyncContainer.java index 3069c107c..1a506e1fd 100644 --- a/api/src/main/java/com/todoroo/astrid/sync/SyncContainer.java +++ b/api/src/main/java/com/todoroo/astrid/sync/SyncContainer.java @@ -25,7 +25,6 @@ public class SyncContainer { /** * Check if the metadata contains anything with the given key - * @param key * @return first match. or null */ public Metadata findMetadata(String key) { diff --git a/api/src/main/java/com/todoroo/astrid/sync/SyncProvider.java b/api/src/main/java/com/todoroo/astrid/sync/SyncProvider.java index dc4507561..4058258bc 100644 --- a/api/src/main/java/com/todoroo/astrid/sync/SyncProvider.java +++ b/api/src/main/java/com/todoroo/astrid/sync/SyncProvider.java @@ -5,12 +5,6 @@ */ package com.todoroo.astrid.sync; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; - import android.app.Activity; import android.app.Notification; import android.content.Context; @@ -24,9 +18,16 @@ import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.service.ExceptionService; import com.todoroo.andlib.service.NotificationManager; import com.todoroo.andlib.utility.DialogUtilities; -import org.tasks.api.R; import com.todoroo.astrid.data.Task; +import org.tasks.api.R; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; + /** * A helper class for writing synchronization services for Astrid. This class * contains logic for merging incoming changes and writing outgoing changes. @@ -69,8 +70,6 @@ public abstract class SyncProvider { /** * Updates the text of a notification and the intent to open when tapped - * @param context - * @param notification * @return notification id (in Android, there is at most one notification * in the tray for a given id) */ @@ -90,7 +89,7 @@ public abstract class SyncProvider { * * @param task * task proxy to push - * @param remoteTask + * @param remote * remote task that we merged with. may be null * @return task pulled on remote server */ @@ -107,16 +106,12 @@ public abstract class SyncProvider { /** * Reads a task container from a task in the database - * - * @param task */ abstract protected TYPE read(TodorooCursor task) throws IOException; /** * Save task. Used to save local tasks that have been updated and remote * tasks that need to be created locally - * - * @param task */ abstract protected void write(TYPE task) throws IOException; @@ -152,7 +147,6 @@ public abstract class SyncProvider { /** * Synchronize this provider with sync toast - * @param context */ public void synchronize(final Context context) { synchronize(context, true); @@ -160,7 +154,6 @@ public abstract class SyncProvider { /** * Synchronize this provider - * @param context * @param showSyncToast should we toast to indicate synchronizing? */ public void synchronize(final Context context, final boolean showSyncToast) { @@ -379,13 +372,10 @@ public abstract class SyncProvider { * Deal with a synchronization exception. If requested, will show an error * to the user (unless synchronization is happening in background) * - * @param context * @param tag * error tag * @param e * exception - * @param showError - * whether to display a dialog */ protected void handleException(String tag, Exception e, boolean displayError) { final Context context = ContextManager.getContext(); diff --git a/api/src/main/java/com/todoroo/astrid/sync/SyncProviderPreferences.java b/api/src/main/java/com/todoroo/astrid/sync/SyncProviderPreferences.java index 036e6e869..cc8a3dddc 100644 --- a/api/src/main/java/com/todoroo/astrid/sync/SyncProviderPreferences.java +++ b/api/src/main/java/com/todoroo/astrid/sync/SyncProviderPreferences.java @@ -94,11 +94,6 @@ abstract public class SyncProviderPreferences extends TodorooPreferenceActivity }); } - /** - * - * @param resource - * if null, updates all resources - */ @Override public void updatePreferences(Preference preference, Object value) { final Resources r = getResources(); diff --git a/api/src/main/java/com/todoroo/astrid/sync/SyncProviderUtilities.java b/api/src/main/java/com/todoroo/astrid/sync/SyncProviderUtilities.java index a4f49fef2..b806df417 100644 --- a/api/src/main/java/com/todoroo/astrid/sync/SyncProviderUtilities.java +++ b/api/src/main/java/com/todoroo/astrid/sync/SyncProviderUtilities.java @@ -136,14 +136,9 @@ abstract public class SyncProviderUtilities { String lastError = getLastError(); if (!TextUtils.isEmpty(lastError)) { String type = getLastErrorType(); - reportLastErrorImpl(lastError, type); } } - protected void reportLastErrorImpl(String lastError, String type) { - // Subclasses can override if necessary - } - /** Set Last Attempted Sync Date */ public void recordSyncStart() { Editor editor = getPrefs().edit(); diff --git a/api/src/main/java/com/todoroo/astrid/sync/SyncResultCallback.java b/api/src/main/java/com/todoroo/astrid/sync/SyncResultCallback.java index 09eb239dd..c2476321a 100644 --- a/api/src/main/java/com/todoroo/astrid/sync/SyncResultCallback.java +++ b/api/src/main/java/com/todoroo/astrid/sync/SyncResultCallback.java @@ -8,13 +8,11 @@ package com.todoroo.astrid.sync; public interface SyncResultCallback { /** * Increment max sync progress - * @param incrementBy */ public void incrementMax(int incrementBy); /** * Increment current sync progress - * @param incrementBy */ public void incrementProgress(int incrementBy); diff --git a/astrid/src/instrumentTest/java/com/todoroo/andlib/service/TestDependencyInjector.java b/astrid/src/instrumentTest/java/com/todoroo/andlib/service/TestDependencyInjector.java index 89ec19ef8..96f7fc715 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/andlib/service/TestDependencyInjector.java +++ b/astrid/src/instrumentTest/java/com/todoroo/andlib/service/TestDependencyInjector.java @@ -41,7 +41,6 @@ public class TestDependencyInjector extends AbstractDependencyInjector { /** * Remove an installed TestDependencyInjector - * @param string */ public static void deinitialize(TestDependencyInjector instance) { DependencyInjectionService.getInstance().removeInjector(instance); diff --git a/astrid/src/instrumentTest/java/com/todoroo/andlib/test/TestUtilities.java b/astrid/src/instrumentTest/java/com/todoroo/andlib/test/TestUtilities.java deleted file mode 100644 index a7dca44ae..000000000 --- a/astrid/src/instrumentTest/java/com/todoroo/andlib/test/TestUtilities.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2012 Todoroo Inc - * - * See the file "LICENSE" for the full license governing this code. - */ -package com.todoroo.andlib.test; - - -/** - * Utility methods used in unit tests - * - * @author Tim Su - * - */ -public class TestUtilities { - - /** - * Sleep, suppressing exceptions - * - * @param millis - */ - public static void sleepDeep(long millis) { - try { - Thread.sleep(millis); - } catch (InterruptedException e) { - // do nothing - } - } - -} diff --git a/astrid/src/instrumentTest/java/com/todoroo/andlib/test/TodorooTestCase.java b/astrid/src/instrumentTest/java/com/todoroo/andlib/test/TodorooTestCase.java index 5321ecd36..8f49d09c2 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/andlib/test/TodorooTestCase.java +++ b/astrid/src/instrumentTest/java/com/todoroo/andlib/test/TodorooTestCase.java @@ -45,7 +45,6 @@ public class TodorooTestCase extends AndroidTestCase { /** * Loop through each locale and call runnable - * @param r */ public void forEachLocale(Runnable r) { Locale[] locales = Locale.getAvailableLocales(); @@ -58,7 +57,6 @@ public class TodorooTestCase extends AndroidTestCase { /** * Sets locale - * @param locale */ private void setLocale(Locale locale) { Locale.setDefault(locale); diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/AllTests.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/AllTests.java index 0c715e0da..4a445583c 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/AllTests.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/AllTests.java @@ -16,9 +16,10 @@ package com.todoroo.astrid; +import android.test.suitebuilder.TestSuiteBuilder; + import junit.framework.Test; import junit.framework.TestSuite; -import android.test.suitebuilder.TestSuiteBuilder; /** * A test suite containing all tests for ApiDemos. @@ -32,12 +33,12 @@ import android.test.suitebuilder.TestSuiteBuilder; * -e class com.example.android.apis.AllTests \ * com.example.android.apis.tests/android.test.InstrumentationTestRunner * - * To run an individual test case, e.g. {@link com.example.android.apis.os.MorseCodeConverterTest}: + * To run an individual test case, e.g. com.example.android.apis.os.MorseCodeConverterTest: * $ adb shell am instrument -w \ * -e class com.example.android.apis.os.MorseCodeConverterTest \ * com.example.android.apis.tests/android.test.InstrumentationTestRunner * - * To run an individual test, e.g. {@link com.example.android.apis.os.MorseCodeConverterTest#testCharacterS()}: + * To run an individual test, e.g. com.example.android.apis.os.MorseCodeConverterTest#testCharacterS(): * $ adb shell am instrument -w \ * -e class com.example.android.apis.os.MorseCodeConverterTest#testCharacterS \ * com.example.android.apis.tests/android.test.InstrumentationTestRunner diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/repeats/NewRepeatTests.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/repeats/NewRepeatTests.java index cb108f462..cb01b0465 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/repeats/NewRepeatTests.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/repeats/NewRepeatTests.java @@ -62,26 +62,11 @@ public class NewRepeatTests extends DatabaseTestCase { AndroidUtilities.sleepDeep(200L); // Delay to make sure changes persist } - /** - * @param t - * @param expectedDueDate - */ protected REMOTE_MODEL assertTaskExistsRemotely(Task t, long expectedDueDate) { // Subclasses can override this to check the existence of remote objects return null; } - /** - * @param t task - */ - protected void assertTaskCompletedRemotely(Task t) { - // Subclasses can override this to check the status of the corresponding remote task - } - - - /** - * @param remoteModel - */ protected long setCompletionDate(boolean completeBefore, Task t, REMOTE_MODEL remoteModel, long dueDate) { long completionDate; diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/test/AstridTranslationTests.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/test/AstridTranslationTests.java index 06bd7f5ae..df96c54f5 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/test/AstridTranslationTests.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/test/AstridTranslationTests.java @@ -7,13 +7,14 @@ package com.todoroo.astrid.test; -import java.util.Locale; - import android.content.res.Resources; -import org.tasks.R; import com.todoroo.andlib.test.TranslationTests; +import org.tasks.R; + +import java.util.Locale; + public class AstridTranslationTests extends TranslationTests { @Override @@ -35,9 +36,6 @@ public class AstridTranslationTests extends TranslationTests { /** * check if string contains contains substrings - * @param string - * @param contains - * @return */ public void contains(Resources r, int resource, StringBuilder failures, String... contains) { String string = r.getString(resource); diff --git a/astrid/src/instrumentTest/java/com/todoroo/astrid/test/DatabaseTestCase.java b/astrid/src/instrumentTest/java/com/todoroo/astrid/test/DatabaseTestCase.java index f8b0def93..978ea0c73 100644 --- a/astrid/src/instrumentTest/java/com/todoroo/astrid/test/DatabaseTestCase.java +++ b/astrid/src/instrumentTest/java/com/todoroo/astrid/test/DatabaseTestCase.java @@ -48,7 +48,6 @@ public class DatabaseTestCase extends TodorooTestCaseWithInjector { /** * Helper to delete a database by name - * @param toDelete */ protected void deleteDatabase(String toDelete) { File db = getContext().getDatabasePath(toDelete); diff --git a/astrid/src/main/java/com/todoroo/astrid/actfm/ActFmGoogleAuthActivity.java b/astrid/src/main/java/com/todoroo/astrid/actfm/ActFmGoogleAuthActivity.java index 327ccec00..7fd264488 100644 --- a/astrid/src/main/java/com/todoroo/astrid/actfm/ActFmGoogleAuthActivity.java +++ b/astrid/src/main/java/com/todoroo/astrid/actfm/ActFmGoogleAuthActivity.java @@ -158,22 +158,6 @@ public class ActFmGoogleAuthActivity extends ListActivity { finish(); } - - @Override - protected void onResume() { - super.onResume(); - } - - @Override - protected void onPause() { - super.onPause(); - } - - @Override - protected void onStop() { - super.onStop(); - } - private static final int REQUEST_AUTHENTICATE = 0; @Override diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/AstridActivity.java b/astrid/src/main/java/com/todoroo/astrid/activity/AstridActivity.java index ca7905b28..bf3327bc1 100644 --- a/astrid/src/main/java/com/todoroo/astrid/activity/AstridActivity.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/AstridActivity.java @@ -20,7 +20,6 @@ import android.widget.EditText; import android.widget.Toast; import com.actionbarsherlock.app.SherlockFragmentActivity; -import org.tasks.R; import com.todoroo.aacenc.RecognizerApi.RecognizerApiListener; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; @@ -43,12 +42,13 @@ import com.todoroo.astrid.dao.TaskDao; import com.todoroo.astrid.data.TagData; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.service.StartupService; -import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.subtasks.SubtasksHelper; import com.todoroo.astrid.ui.DateChangedAlerts; import com.todoroo.astrid.ui.QuickAddBar; import com.todoroo.astrid.voice.VoiceRecognizer; +import org.tasks.R; + /** * This wrapper activity contains all the glue-code to handle the callbacks between the different * fragments that could be visible on the screen in landscape-mode. @@ -133,11 +133,6 @@ public class AstridActivity extends SherlockFragmentActivity AndroidUtilities.tryUnregisterReceiver(this, repeatConfirmationReceiver); } - @Override - protected void onStop() { - super.onStop(); - } - /** * Handles items being clicked from the filterlist-fragment. Return true if item is handled. */ diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/BeastModePreferences.java b/astrid/src/main/java/com/todoroo/astrid/activity/BeastModePreferences.java index b53a37364..9a51ee38d 100644 --- a/astrid/src/main/java/com/todoroo/astrid/activity/BeastModePreferences.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/BeastModePreferences.java @@ -45,7 +45,6 @@ public class BeastModePreferences extends ListActivity { /** * Migration for existing users to assert that the "hide always" section divider exists in the preferences. * Knowing that this section will always be in the constructed list of controls simplifies the logic a bit. - * @param c */ public static void assertHideUntilSectionExists(Context c, long latestSetVersion) { if (latestSetVersion == 0) { diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/DefaultFilterMode.java b/astrid/src/main/java/com/todoroo/astrid/activity/DefaultFilterMode.java index aca6cf577..34688dff8 100644 --- a/astrid/src/main/java/com/todoroo/astrid/activity/DefaultFilterMode.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/DefaultFilterMode.java @@ -30,11 +30,6 @@ public class DefaultFilterMode implements FilterModeSpec { return R.attr.asMainMenu; } - @Override - public void onFilterItemClickedCallback(FilterListItem item) { - // - } - @Override public boolean showComments() { return true; diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/FilterListFragment.java b/astrid/src/main/java/com/todoroo/astrid/activity/FilterListFragment.java index 7f3b8541a..aa12cf2fd 100644 --- a/astrid/src/main/java/com/todoroo/astrid/activity/FilterListFragment.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/FilterListFragment.java @@ -178,16 +178,6 @@ public class FilterListFragment extends SherlockListFragment { * ============================================================ lifecycle * ====================================================================== */ - @Override - public void onStart() { - super.onStart(); - } - - @Override - public void onStop() { - super.onStop(); - } - @Override public void onResume() { super.onResume(); @@ -314,9 +304,6 @@ public class FilterListFragment extends SherlockListFragment { /** * Creates a shortcut on the user's home screen - * - * @param shortcutIntent - * @param label */ private static void createShortcut(Activity activity, Filter filter, Intent shortcutIntent, String label) { if(label.length() == 0) { diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/FilterModeSpec.java b/astrid/src/main/java/com/todoroo/astrid/activity/FilterModeSpec.java index 1b90dbd7b..328f6e9bb 100644 --- a/astrid/src/main/java/com/todoroo/astrid/activity/FilterModeSpec.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/FilterModeSpec.java @@ -12,7 +12,6 @@ public interface FilterModeSpec { public Class getFilterListClass(); public Filter getDefaultFilter(Context context); public int getMainMenuIconAttr(); - public void onFilterItemClickedCallback(FilterListItem item); public boolean showComments(); } diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/FilterShortcutActivity.java b/astrid/src/main/java/com/todoroo/astrid/activity/FilterShortcutActivity.java index 14ad89d8b..ba8a25c1c 100644 --- a/astrid/src/main/java/com/todoroo/astrid/activity/FilterShortcutActivity.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/FilterShortcutActivity.java @@ -85,15 +85,4 @@ public class FilterShortcutActivity extends ListActivity { super.onPause(); adapter.unregisterRecevier(); } - - @Override - protected void onStart() { - super.onStart(); - } - - @Override - protected void onStop() { - super.onStop(); - } - } diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/SortSelectionActivity.java b/astrid/src/main/java/com/todoroo/astrid/activity/SortSelectionActivity.java index 88f569579..53b3615c8 100644 --- a/astrid/src/main/java/com/todoroo/astrid/activity/SortSelectionActivity.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/SortSelectionActivity.java @@ -30,8 +30,6 @@ public class SortSelectionActivity { /** * Create the dialog - * @param activity - * @return */ public static AlertDialog createDialog(Activity activity, boolean showDragDrop, OnSortSelectedListener listener, int flags, int sort) { diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/TaskEditFragment.java b/astrid/src/main/java/com/todoroo/astrid/activity/TaskEditFragment.java index 63a9f4ece..9897e4f98 100755 --- a/astrid/src/main/java/com/todoroo/astrid/activity/TaskEditFragment.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/TaskEditFragment.java @@ -256,11 +256,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { public void onTaskEditDetailsClicked(int category, int position); } - @Override - public void onAttach(Activity activity) { - super.onAttach(activity); - } - public TaskEditFragment() { DependencyInjectionService.getInstance().inject(this); } @@ -636,8 +631,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { /** * Loads action item from the given intent - * - * @param intent */ protected void loadItem(Intent intent) { if (model != null) { @@ -852,7 +845,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { /** * Helper to remove task edit specific info from activity intent - * @param intent */ public static void removeExtrasFromIntent(Intent intent) { if (intent != null) { @@ -875,8 +867,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { * Displays a Toast reporting that the selected task has been saved and, if * it has a due date, that is due in 'x' amount of time, to 1 time-unit of * precision - * - * @param additionalMessage */ private String addDueTimeToToast(String additionalMessage) { int stringResource; @@ -1171,16 +1161,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { outState.putString(TASK_UUID, uuid.toString()); } - @Override - public void onStart() { - super.onStart(); - } - - @Override - public void onStop() { - super.onStop(); - } - /* * ====================================================================== * ========================================== UI component helper classes @@ -1263,7 +1243,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { - return; } @Override @@ -1273,7 +1252,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { @Override public void onPageScrollStateChanged(int state) { - return; } // EditNoteActivity Listener when there are new updates/comments diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/TaskListActivity.java b/astrid/src/main/java/com/todoroo/astrid/activity/TaskListActivity.java index 87748a749..4f54e5b0a 100644 --- a/astrid/src/main/java/com/todoroo/astrid/activity/TaskListActivity.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/TaskListActivity.java @@ -268,10 +268,6 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener return extras; } - /** - * - * @param actionBar - */ protected void initializeFragments(ActionBar actionBar) { View filterFragment = findViewById(R.id.filterlist_fragment_container); View editFragment = findViewById(R.id.taskedit_fragment_container); @@ -388,7 +384,6 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener } boolean result = super.onFilterItemClicked(item); - filterModeSpec.onFilterItemClickedCallback(item); return result; } @@ -486,11 +481,6 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener lists.setText(title); } - @Override - protected void onResume() { - super.onResume(); - } - @Override protected void onPause() { super.onPause(); diff --git a/astrid/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java b/astrid/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java index a1946834e..e2862f542 100644 --- a/astrid/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java +++ b/astrid/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java @@ -5,11 +5,6 @@ */ package com.todoroo.astrid.activity; -import java.util.List; -import java.util.Timer; -import java.util.TimerTask; -import java.util.concurrent.atomic.AtomicReference; - import android.app.Activity; import android.app.AlertDialog; import android.content.BroadcastReceiver; @@ -47,11 +42,9 @@ import android.widget.LinearLayout; import android.widget.ListView; import android.widget.TextView; -import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockListFragment; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; -import org.tasks.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; @@ -110,6 +103,13 @@ import com.todoroo.astrid.utility.AstridPreferences; import com.todoroo.astrid.utility.Flags; import com.todoroo.astrid.widget.TasksWidget; +import org.tasks.R; + +import java.util.List; +import java.util.Timer; +import java.util.TimerTask; +import java.util.concurrent.atomic.AtomicReference; + /** * Primary activity for the Bente application. Shows a list of upcoming tasks * and a user's coaches. @@ -227,10 +227,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele * * See also: instantiateWithFilterAndExtras(Filter, Bundle) which uses TaskListFragment as the default * custom component. - * @param filter - * @param extras - * @param customComponent - * @return */ public static TaskListFragment instantiateWithFilterAndExtras(Filter filter, Bundle extras, Class customComponent) { Class component = customComponent; @@ -264,9 +260,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele /** * Convenience method for calling instantiateWithFilterAndExtras(Filter, Bundle, Class) with * TaskListFragment as the default component - * @param filter - * @param extras - * @return */ public static TaskListFragment instantiateWithFilterAndExtras(Filter filter, Bundle extras) { return instantiateWithFilterAndExtras(filter, extras, null); @@ -483,8 +476,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele /** * Create options menu (displayed when user presses menu key) - * - * @return true if menu should be displayed */ @Override public void onCreateOptionsMenu(Menu menu, com.actionbarsherlock.view.MenuInflater inflater) { @@ -879,11 +870,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele super.onActivityResult(requestCode, resultCode, data); } - public void onScroll(AbsListView view, int firstVisibleItem, - int visibleItemCount, int totalItemCount) { - // do nothing - } - /* * ====================================================================== * =================================================== managing list view @@ -892,8 +878,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele /** * Load or re-load action items and update views - * - * @param requery */ public void loadTaskListContent(boolean requery) { if (taskAdapter == null) { @@ -957,9 +941,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele /** * Fill in the Task List with current items - * - * @param withCustomId - * force task with given custom id to be part of list */ public void setUpTaskList() { if (filter == null) { @@ -1053,8 +1034,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele /** * Select a custom task id in the list. If it doesn't exist, create a new * custom filter - * - * @param withCustomId */ public void selectCustomId(long withCustomId) { // if already in the list, select it diff --git a/astrid/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java b/astrid/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java index 20b41dcd7..61837e7f7 100644 --- a/astrid/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java +++ b/astrid/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java @@ -277,9 +277,6 @@ public class FilterAdapter extends ArrayAdapter { /** * Create or reuse a view - * @param convertView - * @param parent - * @return */ protected View newView(View convertView, ViewGroup parent) { if(convertView == null) { @@ -347,7 +344,6 @@ public class FilterAdapter extends ArrayAdapter { /** * Sets the selected item to this one - * @param picked */ public void setSelection(FilterListItem picked) { selection = picked; @@ -431,7 +427,6 @@ public class FilterAdapter extends ArrayAdapter { filter instanceof FilterCategory)) { continue; } - onReceiveFilter((FilterListItem)item); if (filter instanceof FilterCategory) { Filter[] children = ((FilterCategory) filter).children; @@ -481,14 +476,6 @@ public class FilterAdapter extends ArrayAdapter { activity.unregisterReceiver(filterReceiver); } - /** - * Called when an item comes through. Override if you like - * @param item - */ - public void onReceiveFilter(FilterListItem item) { - // do nothing - } - /* ====================================================================== * ================================================================ views * ====================================================================== */ diff --git a/astrid/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java b/astrid/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java index 81653b45b..713040a44 100644 --- a/astrid/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java +++ b/astrid/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java @@ -239,7 +239,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable { /** * Constructor * - * @param fragment * @param resource * layout resource to inflate * @param c @@ -827,9 +826,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable { /** * Add detail to a task - * - * @param id - * @param detail */ public void addDetails(long id, String detail) { final StringBuilder details = taskDetailLoader.get(id); @@ -1089,10 +1085,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable { /** Helper method to adjust a tasks' appearance if the task is completed or * uncompleted. - * - * @param actionItem - * @param name - * @param progress */ protected void setTaskAppearance(ViewHolder viewHolder, Task task) { Activity activity = fragment.getActivity(); @@ -1277,12 +1269,8 @@ public class TaskAdapter extends CursorAdapter implements Filterable { * This method is called when user completes a task via check box or other * means * - * @param container - * container for the action item * @param newState * state that this task should be set to - * @param completeBox - * the box that was clicked. can be null */ protected void completeTask(final Task task, final boolean newState) { if(task == null) { @@ -1301,7 +1289,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable { /** * Add a new listener - * @param newListener */ public void addOnCompletedTaskListener(final OnCompletedTaskListener newListener) { if(this.onCompletedTaskListener == null) { diff --git a/astrid/src/main/java/com/todoroo/astrid/adapter/TaskListFragmentPagerAdapter.java b/astrid/src/main/java/com/todoroo/astrid/adapter/TaskListFragmentPagerAdapter.java index 2705e99ec..c80dfc914 100644 --- a/astrid/src/main/java/com/todoroo/astrid/adapter/TaskListFragmentPagerAdapter.java +++ b/astrid/src/main/java/com/todoroo/astrid/adapter/TaskListFragmentPagerAdapter.java @@ -51,8 +51,6 @@ public class TaskListFragmentPagerAdapter extends FragmentStatePagerAdapter impl /** * Lookup the fragment for the specified position - * @param position - * @return */ public Fragment lookupFragmentForPosition(int position) { return positionToFragment.get(position); @@ -66,8 +64,6 @@ public class TaskListFragmentPagerAdapter extends FragmentStatePagerAdapter impl /** * Adds the specified filter to the data source if it doesn't exist, * returning the position of that filter regardless - * @param filter - * @return */ public int addOrLookup(Filter filter) { return filterAdapter.addOrLookup(filter); @@ -83,8 +79,6 @@ public class TaskListFragmentPagerAdapter extends FragmentStatePagerAdapter impl /** * Get the filter at the specified position - * @param position - * @return */ public Filter getFilter(int position) { return filterAdapter.getItem(position); diff --git a/astrid/src/main/java/com/todoroo/astrid/adapter/UpdateAdapter.java b/astrid/src/main/java/com/todoroo/astrid/adapter/UpdateAdapter.java index 44df4b1f5..e8f5afe78 100644 --- a/astrid/src/main/java/com/todoroo/astrid/adapter/UpdateAdapter.java +++ b/astrid/src/main/java/com/todoroo/astrid/adapter/UpdateAdapter.java @@ -142,15 +142,12 @@ public class UpdateAdapter extends CursorAdapter { /** * Constructor * - * @param activity * @param resource * layout resource to inflate * @param c * database cursor * @param autoRequery * whether cursor is automatically re-queried on changes - * @param onCompletedTaskListener - * goal listener. can be null */ public UpdateAdapter(Fragment fragment, int resource, Cursor c, boolean autoRequery, @@ -405,7 +402,6 @@ public class UpdateAdapter extends CursorAdapter { image.setButton(fragment.getString(R.string.DLG_close), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - return; } }); image.show(); diff --git a/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmService.java b/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmService.java index 87e00d4f5..6ef0715cb 100644 --- a/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmService.java +++ b/astrid/src/main/java/com/todoroo/astrid/alarms/AlarmService.java @@ -58,8 +58,6 @@ public class AlarmService { /** * Return alarms for the given task. PLEASE CLOSE THE CURSOR! - * - * @param taskId */ public TodorooCursor getAlarms(long taskId) { return PluginServices.getMetadataService().query(Query.select( @@ -69,8 +67,6 @@ public class AlarmService { /** * Save the given array of alarms into the database - * @param taskId - * @param tags * @return true if data was changed */ public boolean synchronizeAlarms(final long taskId, LinkedHashSet alarms) { @@ -107,7 +103,6 @@ public class AlarmService { /** * Gets a listing of all alarms that are active - * @param properties * @return todoroo cursor. PLEASE CLOSE THIS CURSOR! */ private TodorooCursor getActiveAlarms() { @@ -118,7 +113,6 @@ public class AlarmService { /** * Gets a listing of alarms by task - * @param properties * @return todoroo cursor. PLEASE CLOSE THIS CURSOR! */ private TodorooCursor getActiveAlarmsForTask(long taskId) { @@ -150,7 +144,6 @@ public class AlarmService { /** * Schedules alarms for a single task - * @param task */ public void scheduleAlarms(long taskId) { TodorooCursor cursor = getActiveAlarmsForTask(taskId); @@ -180,9 +173,6 @@ public class AlarmService { /** * Schedules alarms for a single task - * - * @param shouldPerformPropertyCheck - * whether to check if task has requisite properties */ private void scheduleAlarm(Metadata alarm) { if(alarm == null) { diff --git a/astrid/src/main/java/com/todoroo/astrid/api/TaskContextActionExposer.java b/astrid/src/main/java/com/todoroo/astrid/api/TaskContextActionExposer.java index 4f3b20371..92c4c5e91 100644 --- a/astrid/src/main/java/com/todoroo/astrid/api/TaskContextActionExposer.java +++ b/astrid/src/main/java/com/todoroo/astrid/api/TaskContextActionExposer.java @@ -33,7 +33,6 @@ public interface TaskContextActionExposer { /** * Expose context menu item label, or null if item should not be shown - * @param task * * @return null if no item should be displayed, or string or id */ @@ -41,7 +40,6 @@ public interface TaskContextActionExposer { /** * Call context menu action - * @param task */ public void invoke(Task task); diff --git a/astrid/src/main/java/com/todoroo/astrid/api/TaskDecorationExposer.java b/astrid/src/main/java/com/todoroo/astrid/api/TaskDecorationExposer.java index a97a32c9c..6687aecd8 100644 --- a/astrid/src/main/java/com/todoroo/astrid/api/TaskDecorationExposer.java +++ b/astrid/src/main/java/com/todoroo/astrid/api/TaskDecorationExposer.java @@ -21,7 +21,6 @@ public interface TaskDecorationExposer { /** * Expose task decorations for the given task - * @param task * * @return null if no decorations, or decoration */ diff --git a/astrid/src/main/java/com/todoroo/astrid/backup/BackupService.java b/astrid/src/main/java/com/todoroo/astrid/backup/BackupService.java index f3fffd925..6198b7a38 100644 --- a/astrid/src/main/java/com/todoroo/astrid/backup/BackupService.java +++ b/astrid/src/main/java/com/todoroo/astrid/backup/BackupService.java @@ -62,7 +62,6 @@ public class BackupService extends Service { /** * Test hook for backup - * @param context */ public void testBackup(Context context) { startBackup(context); diff --git a/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlExporter.java b/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlExporter.java index d8b7cbef2..19e70cada 100644 --- a/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlExporter.java +++ b/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlExporter.java @@ -226,7 +226,6 @@ public class TasksXmlExporter { /** * Turn a model into xml attributes - * @param model */ private void serializeModel(AbstractModel model, Property[] properties, Property... excludes) { outer: for(Property property : properties) { @@ -344,7 +343,6 @@ public class TasksXmlExporter { /** * Creates directories if necessary and returns fully qualified file - * @param directory * @return output file name * @throws IOException */ diff --git a/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlImporter.java b/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlImporter.java index 5580c461e..6f040d75f 100644 --- a/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlImporter.java +++ b/astrid/src/main/java/com/todoroo/astrid/backup/TasksXmlImporter.java @@ -57,9 +57,6 @@ public class TasksXmlImporter { /** * Import tasks from the given file - * - * @param input - * @param runAfterImport */ public static void importTasks(Context context, String input, Runnable runAfterImport) { new TasksXmlImporter(context, input, runAfterImport); @@ -306,7 +303,6 @@ public class TasksXmlImporter { /** * Turn a model into xml attributes - * @param model */ private void deserializeModel(AbstractModel model, Property[] properties) { for(Property property : properties) { diff --git a/astrid/src/main/java/com/todoroo/astrid/core/CoreFilterExposer.java b/astrid/src/main/java/com/todoroo/astrid/core/CoreFilterExposer.java index d58edbcd7..12332574d 100644 --- a/astrid/src/main/java/com/todoroo/astrid/core/CoreFilterExposer.java +++ b/astrid/src/main/java/com/todoroo/astrid/core/CoreFilterExposer.java @@ -9,7 +9,6 @@ import java.util.ArrayList; import java.util.List; import android.content.BroadcastReceiver; -import android.content.ComponentName; import android.content.ContentValues; import android.content.Context; import android.content.Intent; @@ -19,7 +18,6 @@ import android.graphics.drawable.BitmapDrawable; import org.tasks.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.sql.Criterion; -import com.todoroo.andlib.sql.Join; import com.todoroo.andlib.sql.Query; import com.todoroo.andlib.sql.QueryTemplate; import com.todoroo.andlib.utility.AndroidUtilities; @@ -29,7 +27,6 @@ import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.api.AstridFilterExposer; import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.api.FilterListItem; -import com.todoroo.astrid.api.FilterWithCustomIntent; import com.todoroo.astrid.api.PermaSql; import com.todoroo.astrid.dao.MetadataDao.MetadataCriteria; import com.todoroo.astrid.dao.TaskDao.TaskCriteria; @@ -72,7 +69,6 @@ public final class CoreFilterExposer extends BroadcastReceiver implements Astrid /** * Build inbox filter - * @return */ public static Filter buildInboxFilter(Resources r) { Filter inbox = new Filter(r.getString(R.string.BFE_Active), r.getString(R.string.BFE_Active), @@ -107,8 +103,6 @@ public final class CoreFilterExposer extends BroadcastReceiver implements Astrid /** * Is this the inbox? - * @param filter - * @return */ public static boolean isInbox(Filter filter) { return (filter != null && filter.equals(buildInboxFilter(ContextManager.getContext().getResources()))); diff --git a/astrid/src/main/java/com/todoroo/astrid/core/CustomFilterActivity.java b/astrid/src/main/java/com/todoroo/astrid/core/CustomFilterActivity.java index 76b39a61c..db7e83465 100644 --- a/astrid/src/main/java/com/todoroo/astrid/core/CustomFilterActivity.java +++ b/astrid/src/main/java/com/todoroo/astrid/core/CustomFilterActivity.java @@ -267,16 +267,6 @@ public class CustomFilterActivity extends SherlockFragmentActivity { } } - @Override - protected void onStart() { - super.onStart(); - } - - @Override - protected void onStop() { - super.onStop(); - } - @Override protected void onResume() { super.onResume(); diff --git a/astrid/src/main/java/com/todoroo/astrid/core/CustomFilterAdapter.java b/astrid/src/main/java/com/todoroo/astrid/core/CustomFilterAdapter.java index 0c8e8ba68..6aca3cae3 100644 --- a/astrid/src/main/java/com/todoroo/astrid/core/CustomFilterAdapter.java +++ b/astrid/src/main/java/com/todoroo/astrid/core/CustomFilterAdapter.java @@ -105,7 +105,6 @@ public class CustomFilterAdapter extends ArrayAdapter { /** * Show options menu for the given criterioninstance - * @param item */ public void showOptionsFor(final CriterionInstance item, final Runnable onComplete) { AlertDialog.Builder dialog = new AlertDialog.Builder(activity). diff --git a/astrid/src/main/java/com/todoroo/astrid/core/DefaultsPreferences.java b/astrid/src/main/java/com/todoroo/astrid/core/DefaultsPreferences.java index 062d4d577..c1be0c5ee 100644 --- a/astrid/src/main/java/com/todoroo/astrid/core/DefaultsPreferences.java +++ b/astrid/src/main/java/com/todoroo/astrid/core/DefaultsPreferences.java @@ -38,10 +38,6 @@ public class DefaultsPreferences extends TodorooPreferenceActivity { Calendars.initCalendarsPreference(this, defaultCalendarPreference); } - /** - * - * @param resource if null, updates all resources - */ @Override public void updatePreferences(Preference preference, Object value) { Resources r = getResources(); diff --git a/astrid/src/main/java/com/todoroo/astrid/core/SavedFilter.java b/astrid/src/main/java/com/todoroo/astrid/core/SavedFilter.java index ea86e917e..a464df75f 100644 --- a/astrid/src/main/java/com/todoroo/astrid/core/SavedFilter.java +++ b/astrid/src/main/java/com/todoroo/astrid/core/SavedFilter.java @@ -48,11 +48,6 @@ public class SavedFilter { /** * Save a filter - * - * @param adapter - * @param title - * @param sql2 - * @param values2 */ public static void persist(CustomFilterAdapter adapter, String title, String sql, ContentValues values) { @@ -93,8 +88,6 @@ public class SavedFilter { /** * Turn a series of CriterionInstance objects into a string - * @param adapter - * @return */ private static String serializeFilters(CustomFilterAdapter adapter) { StringBuilder values = new StringBuilder(); @@ -125,8 +118,6 @@ public class SavedFilter { /** * Read filter from store - * @param savedFilter - * @return */ public static Filter load(StoreObject savedFilter) { String title = savedFilter.getValue(NAME); diff --git a/astrid/src/main/java/com/todoroo/astrid/dao/Database.java b/astrid/src/main/java/com/todoroo/astrid/dao/Database.java index 1d0cde53c..22898bfe5 100644 --- a/astrid/src/main/java/com/todoroo/astrid/dao/Database.java +++ b/astrid/src/main/java/com/todoroo/astrid/dao/Database.java @@ -429,10 +429,6 @@ public class Database extends AbstractDatabase { /** * Create table generation SQL - * @param sql - * @param tableName - * @param properties - * @return */ public String createTableSql(SqlConstructorVisitor visitor, String tableName, Property[] properties) { diff --git a/astrid/src/main/java/com/todoroo/astrid/dao/RemoteModelDao.java b/astrid/src/main/java/com/todoroo/astrid/dao/RemoteModelDao.java index 91a65b9ba..279c285c8 100644 --- a/astrid/src/main/java/com/todoroo/astrid/dao/RemoteModelDao.java +++ b/astrid/src/main/java/com/todoroo/astrid/dao/RemoteModelDao.java @@ -5,7 +5,6 @@ import com.todoroo.andlib.data.DatabaseDao; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.sql.Query; -import com.todoroo.astrid.core.PluginServices; import com.todoroo.astrid.data.RemoteModel; import com.todoroo.astrid.helper.UUIDHelper; @@ -62,9 +61,6 @@ public class RemoteModelDao extends DatabaseDao... properties) { TodorooCursor cursor = fetchItem(uuid, properties); @@ -74,14 +70,8 @@ public class RemoteModelDao extends DatabaseDao fetchItem(String uuid, Property... properties) { TodorooCursor cursor = query( @@ -92,8 +82,6 @@ public class RemoteModelDao extends DatabaseDao cursor = query(Query.select(AbstractModel.ID_PROPERTY).where(RemoteModel.UUID_PROPERTY.eq(uuid))); diff --git a/astrid/src/main/java/com/todoroo/astrid/dao/TagDataDao.java b/astrid/src/main/java/com/todoroo/astrid/dao/TagDataDao.java index 2d87df923..057b77267 100644 --- a/astrid/src/main/java/com/todoroo/astrid/dao/TagDataDao.java +++ b/astrid/src/main/java/com/todoroo/astrid/dao/TagDataDao.java @@ -39,7 +39,7 @@ public class TagDataDao extends RemoteModelDao { */ public static class TagDataCriteria { - /** @returns tasks by id */ + /** @return tasks by id */ public static Criterion byId(long id) { return TagData.ID.eq(id); } diff --git a/astrid/src/main/java/com/todoroo/astrid/dao/TaskDao.java b/astrid/src/main/java/com/todoroo/astrid/dao/TaskDao.java index f11832f82..1292763a2 100644 --- a/astrid/src/main/java/com/todoroo/astrid/dao/TaskDao.java +++ b/astrid/src/main/java/com/todoroo/astrid/dao/TaskDao.java @@ -56,7 +56,7 @@ public class TaskDao extends RemoteModelDao { */ public static class TaskCriteria { - /** @returns tasks by id */ + /** @return tasks by id */ public static Criterion byId(long id) { return Task.ID.eq(id); } @@ -154,8 +154,6 @@ public class TaskDao extends RemoteModelDao { /** * Delete the given item * - * @param database - * @param id * @return true if delete was successful */ @Override @@ -179,7 +177,6 @@ public class TaskDao extends RemoteModelDao { * Saves the given task to the database.getDatabase(). Task must already * exist. Returns true on success. * - * @param task * @return true if save occurred, false otherwise (i.e. nothing changed) */ public boolean save(Task task) { @@ -248,7 +245,6 @@ public class TaskDao extends RemoteModelDao { /** * Sets default reminders for the given task if reminders are not set - * @param item */ public static void setDefaultReminders(Task item) { if(!item.containsValue(Task.REMINDER_PERIOD)) { @@ -422,9 +418,6 @@ public class TaskDao extends RemoteModelDao { /** * Called after the task was just completed - * - * @param task - * @param values */ private static void afterComplete(Task task, ContentValues values) { Notifications.cancelNotifications(task.getId()); diff --git a/astrid/src/main/java/com/todoroo/astrid/files/FileMetadata.java b/astrid/src/main/java/com/todoroo/astrid/files/FileMetadata.java deleted file mode 100644 index b51bc6c1c..000000000 --- a/astrid/src/main/java/com/todoroo/astrid/files/FileMetadata.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2012 Todoroo Inc - * - * See the file "LICENSE" for the full license governing this code. - */ -package com.todoroo.astrid.files; - -import com.todoroo.andlib.data.Property.LongProperty; -import com.todoroo.andlib.data.Property.StringProperty; -import com.todoroo.astrid.data.Metadata; - -/** - * This class was deprecated with SyncV2. Use TaskAttachment instead. - * @author Sam - * - */ -@Deprecated -public class FileMetadata { - - /** metadata key */ - public static final String METADATA_KEY = "file"; //$NON-NLS-1$ - - public static final StringProperty FILE_PATH = new StringProperty(Metadata.TABLE, - Metadata.VALUE1.name); - - public static final StringProperty FILE_TYPE = new StringProperty(Metadata.TABLE, - Metadata.VALUE2.name); - - public static final LongProperty DELETION_DATE = new LongProperty(Metadata.TABLE, - Metadata.VALUE3.name); - - public static final LongProperty REMOTE_ID = new LongProperty(Metadata.TABLE, - Metadata.VALUE4.name); - - public static final StringProperty URL = new StringProperty(Metadata.TABLE, - Metadata.VALUE5.name); - - public static final StringProperty NAME = new StringProperty(Metadata.TABLE, - Metadata.VALUE6.name); - -} diff --git a/astrid/src/main/java/com/todoroo/astrid/files/FilesControlSet.java b/astrid/src/main/java/com/todoroo/astrid/files/FilesControlSet.java index b9a4d9f6e..1d5e51e3e 100644 --- a/astrid/src/main/java/com/todoroo/astrid/files/FilesControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/files/FilesControlSet.java @@ -246,7 +246,6 @@ public class FilesControlSet extends PopupControlSet { image.setButton(activity.getString(R.string.DLG_close), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface d, int which) { - return; } }); image.show(); diff --git a/astrid/src/main/java/com/todoroo/astrid/gcal/Calendars.java b/astrid/src/main/java/com/todoroo/astrid/gcal/Calendars.java index 54be251df..208f78882 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gcal/Calendars.java +++ b/astrid/src/main/java/com/todoroo/astrid/gcal/Calendars.java @@ -107,11 +107,6 @@ public class Calendars { /** * Appends all user-modifiable calendars to listPreference. - * - * @param context - * context - * @param listPreference - * preference to init */ public static CalendarResult getCalendars() { Context context = ContextManager.getContext(); diff --git a/astrid/src/main/java/com/todoroo/astrid/gcal/GCalControlSet.java b/astrid/src/main/java/com/todoroo/astrid/gcal/GCalControlSet.java index 7b1787477..692e00b89 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gcal/GCalControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/gcal/GCalControlSet.java @@ -34,7 +34,6 @@ import com.todoroo.andlib.service.ExceptionService; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.gcal.Calendars.CalendarResult; -import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.service.ThemeService; import com.todoroo.astrid.ui.PopupControlSet; diff --git a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksBackgroundService.java b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksBackgroundService.java index 3aed193cf..a41610183 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksBackgroundService.java +++ b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksBackgroundService.java @@ -28,15 +28,4 @@ public class GtasksBackgroundService extends SyncV2BackgroundService { } return gtasksPreferenceService; } - - @Override - public void onCreate() { - super.onCreate(); - } - - @Override - public void onDestroy() { - super.onDestroy(); - } - } diff --git a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksListService.java b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksListService.java index 2d02aecc0..8bd326bc2 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksListService.java +++ b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksListService.java @@ -58,7 +58,6 @@ public class GtasksListService { /** * Get list name - * @param listId * @return NOT_FOUND if no list by this id exists, otherwise list name */ public String getListName(String listId) { diff --git a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadata.java b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadata.java index 5ee4ec591..4168d33e5 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadata.java +++ b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadata.java @@ -51,7 +51,6 @@ public class GtasksMetadata { /** * Creates default GTasks metadata item * @param taskId if > 0, will set metadata task field - * @return */ public static Metadata createEmptyMetadata(long taskId) { Metadata metadata = new Metadata(); diff --git a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadataService.java b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadataService.java index 8e6a21a6a..a6f51bfc8 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadataService.java +++ b/astrid/src/main/java/com/todoroo/astrid/gtasks/GtasksMetadataService.java @@ -170,8 +170,6 @@ public final class GtasksMetadataService extends SyncMetadataService[] properties) { diff --git a/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java b/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java index 130ac24f1..76d6c4366 100644 --- a/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java +++ b/astrid/src/main/java/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java @@ -47,7 +47,6 @@ import com.todoroo.astrid.sync.SyncResultCallback; import com.todoroo.astrid.sync.SyncV2Provider; import com.todoroo.astrid.tags.TagService; -import org.json.JSONException; import org.tasks.R; import java.io.IOException; @@ -317,8 +316,7 @@ public class GtasksSyncV2Provider extends SyncV2Provider { } } - /** Create a task container for the given remote task - * @throws JSONException */ + /** Create a task container for the given remote task */ private GtasksTaskContainer parseRemoteTask(com.google.api.services.tasks.model.Task remoteTask, String listId) { Task task = new Task(); diff --git a/astrid/src/main/java/com/todoroo/astrid/helper/SyncActionHelper.java b/astrid/src/main/java/com/todoroo/astrid/helper/SyncActionHelper.java index f0e920e3b..d79f99ca7 100644 --- a/astrid/src/main/java/com/todoroo/astrid/helper/SyncActionHelper.java +++ b/astrid/src/main/java/com/todoroo/astrid/helper/SyncActionHelper.java @@ -232,10 +232,6 @@ public class SyncActionHelper { /** * Show menu of sync options. This is shown when you're not logged into any * services, or logged into more than one. - * - * @param - * @param items - * @param listener */ private void showSyncOptionMenu(TYPE[] items, DialogInterface.OnClickListener listener) { diff --git a/astrid/src/main/java/com/todoroo/astrid/helper/TaskAdapterAddOnManager.java b/astrid/src/main/java/com/todoroo/astrid/helper/TaskAdapterAddOnManager.java index 17e16ddcb..97aa9c5f2 100644 --- a/astrid/src/main/java/com/todoroo/astrid/helper/TaskAdapterAddOnManager.java +++ b/astrid/src/main/java/com/todoroo/astrid/helper/TaskAdapterAddOnManager.java @@ -21,9 +21,6 @@ abstract public class TaskAdapterAddOnManager { private final ListFragment fragment; - /** - * @param taskAdapter - */ protected TaskAdapterAddOnManager(ListFragment fragment) { this.fragment = fragment; } @@ -109,7 +106,6 @@ abstract public class TaskAdapterAddOnManager { /** * Retrieves a list. If it doesn't exist, list is created, but * the method will return null - * @param taskId * @return list if there was already one */ protected synchronized Collection initialize(long taskId) { @@ -122,8 +118,6 @@ abstract public class TaskAdapterAddOnManager { /** * Adds an item to the cache if it doesn't exist - * @param taskId - * @param item * @return iterator if item was added, null if it already existed */ protected synchronized Collection addIfNotExists(long taskId, String addOn, @@ -141,8 +135,6 @@ abstract public class TaskAdapterAddOnManager { /** * Gets an item at the given index - * @param taskId - * @return */ protected Collection get(long taskId) { if(cache.get(taskId) == null) { diff --git a/astrid/src/main/java/com/todoroo/astrid/notes/NotesPlugin.java b/astrid/src/main/java/com/todoroo/astrid/notes/NotesPlugin.java index 4e1ee54b1..407069ed5 100644 --- a/astrid/src/main/java/com/todoroo/astrid/notes/NotesPlugin.java +++ b/astrid/src/main/java/com/todoroo/astrid/notes/NotesPlugin.java @@ -31,9 +31,6 @@ public class NotesPlugin extends BroadcastReceiver { /** * Does this task have notes to display? - * - * @param task - * @return */ public static boolean hasNotes(Task task) { if(task.containsNonNullValue(Task.NOTES) && !TextUtils.isEmpty(task.getValue(Task.NOTES))) { diff --git a/astrid/src/main/java/com/todoroo/astrid/reminders/NotificationFragment.java b/astrid/src/main/java/com/todoroo/astrid/reminders/NotificationFragment.java index 6b81d5f0a..a2a3b58a5 100644 --- a/astrid/src/main/java/com/todoroo/astrid/reminders/NotificationFragment.java +++ b/astrid/src/main/java/com/todoroo/astrid/reminders/NotificationFragment.java @@ -5,15 +5,12 @@ */ package com.todoroo.astrid.reminders; -import java.util.Date; - import android.app.Activity; import android.app.AlertDialog; import android.app.TimePickerDialog; import android.app.TimePickerDialog.OnTimeSetListener; import android.content.Context; import android.content.DialogInterface; -import android.os.Bundle; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -21,7 +18,6 @@ import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.Spinner; -import org.tasks.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.Preferences; @@ -29,9 +25,12 @@ import com.todoroo.astrid.activity.AstridActivity; import com.todoroo.astrid.activity.TaskListFragment; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.repeats.RepeatControlSet; -import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.ui.NumberPicker; +import org.tasks.R; + +import java.util.Date; + /** * This activity is launched when a user opens up a notification from the * tray. It launches the appropriate activity based on the passed in parameters. @@ -50,15 +49,6 @@ public class NotificationFragment extends TaskListFragment { private long taskId; - /* (non-Javadoc) - * @see com.todoroo.astrid.activity.TaskListActivity#onActivityCreated(android.os.Bundle) - */ - @Override - public void onActivityCreated(Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - - } - @Override protected void onTaskCompleted(Task item) { } diff --git a/astrid/src/main/java/com/todoroo/astrid/reminders/Notifications.java b/astrid/src/main/java/com/todoroo/astrid/reminders/Notifications.java index 671d9488b..75a8437f7 100644 --- a/astrid/src/main/java/com/todoroo/astrid/reminders/Notifications.java +++ b/astrid/src/main/java/com/todoroo/astrid/reminders/Notifications.java @@ -5,11 +5,6 @@ */ package com.todoroo.astrid.reminders; -import java.util.Date; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - import android.app.Notification; import android.app.PendingIntent; import android.content.BroadcastReceiver; @@ -25,7 +20,6 @@ import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; -import org.tasks.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; @@ -48,6 +42,13 @@ import com.todoroo.astrid.utility.Constants; import com.todoroo.astrid.utility.Flags; import com.todoroo.astrid.voice.VoiceOutputService; +import org.tasks.R; + +import java.util.Date; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + public class Notifications extends BroadcastReceiver { // --- constants @@ -259,7 +260,7 @@ public class Notifications extends BroadcastReceiver { private static long lastNotificationSound = 0L; /** - * @returns true if notification should sound + * @return true if notification should sound */ private static boolean checkLastNotificationSound() { long now = DateUtilities.now(); diff --git a/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderPreferences.java b/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderPreferences.java index 40ed22da1..e57549c97 100644 --- a/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderPreferences.java +++ b/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderPreferences.java @@ -26,10 +26,6 @@ public class ReminderPreferences extends TodorooPreferenceActivity { return R.xml.preferences_reminders; } - /** - * - * @param resource if null, updates all resources - */ @Override public void updatePreferences(Preference preference, Object value) { Resources r = getResources(); diff --git a/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderService.java b/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderService.java index a5096c75d..0ac49450e 100644 --- a/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderService.java +++ b/astrid/src/main/java/com/todoroo/astrid/reminders/ReminderService.java @@ -5,9 +5,6 @@ */ package com.todoroo.astrid.reminders; -import java.util.Date; -import java.util.Random; - import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; @@ -17,7 +14,6 @@ import android.content.SharedPreferences.Editor; import android.content.res.Resources; import android.util.Log; -import org.tasks.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; @@ -32,6 +28,11 @@ import com.todoroo.astrid.dao.TaskDao.TaskCriteria; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.utility.Constants; +import org.tasks.R; + +import java.util.Date; +import java.util.Random; + /** * Data service for reminders @@ -150,7 +151,6 @@ public final class ReminderService { /** * Schedules alarms for a single task - * @param task */ public void scheduleAlarm(Task task) { scheduleAlarm(task, true); @@ -246,9 +246,6 @@ public final class ReminderService { *

* Pretty simple - if a snooze time is in the future, we use that. If it * has already passed, we do nothing. - * - * @param task - * @return */ private long calculateNextSnoozeReminder(Task task) { if(task.getValue(Task.REMINDER_SNOOZE) > DateUtilities.now()) { @@ -263,9 +260,6 @@ public final class ReminderService { * We schedule an alarm for after the due date (which could be in the past), * with the exception that if a reminder was recently issued, we move * the alarm time to the near future. - * - * @param task - * @return */ private long calculateNextOverdueReminder(Task task) { // Uses getNowValue() instead of DateUtilities.now() @@ -307,9 +301,6 @@ public final class ReminderService { *

* If the date was indicated to not have a due time, we read from * preferences and assign a time. - * - * @param task - * @return */ private long calculateNextDueDateReminder(Task task) { // Uses getNowValue() instead of DateUtilities.now() @@ -415,9 +406,6 @@ public final class ReminderService { * We take the last reminder time and add approximately the reminder * period. If it's still in the past, we set it to some time in the near * future. - * - * @param task - * @return */ private long calculateNextRandomReminder(Task task) { long reminderPeriod = task.getValue(Task.REMINDER_PERIOD); @@ -460,11 +448,6 @@ public final class ReminderService { private static class ReminderAlarmScheduler implements AlarmScheduler { /** * Create an alarm for the given task at the given type - * - * @param task - * @param time - * @param type - * @param flags */ @Override public void createAlarm(Task task, long time, int type) { @@ -510,7 +493,6 @@ public final class ReminderService { /** * Gets a listing of all tasks that are active & - * @param properties * @return todoroo cursor. PLEASE CLOSE THIS CURSOR! */ private TodorooCursor getTasksWithReminders(Property... properties) { diff --git a/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.java b/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.java index d69d90d32..842dda62e 100644 --- a/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.java @@ -38,7 +38,6 @@ import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.service.ExceptionService; import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.astrid.data.Task; -import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.service.TaskService; import com.todoroo.astrid.service.ThemeService; import com.todoroo.astrid.ui.DateAndTimeDialog; diff --git a/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListener.java b/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListener.java index c66856d79..445cf4878 100644 --- a/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListener.java +++ b/astrid/src/main/java/com/todoroo/astrid/repeats/RepeatTaskCompleteListener.java @@ -252,8 +252,7 @@ public class RepeatTaskCompleteListener extends BroadcastReceiver { return rrule; } - /** Set up repeat start date - * @param frequency */ + /** Set up repeat start date */ private static Date setUpStartDate(Task task, boolean repeatAfterCompletion, Frequency frequency) { Date startDate = new Date(); if(task.hasDueDate()) { diff --git a/astrid/src/main/java/com/todoroo/astrid/service/AddOnService.java b/astrid/src/main/java/com/todoroo/astrid/service/AddOnService.java index 43d20211f..34d5a2b13 100644 --- a/astrid/src/main/java/com/todoroo/astrid/service/AddOnService.java +++ b/astrid/src/main/java/com/todoroo/astrid/service/AddOnService.java @@ -9,7 +9,6 @@ import android.content.Context; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.AndroidUtilities; -import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.data.AddOn; import com.todoroo.astrid.utility.Constants; @@ -31,8 +30,6 @@ public class AddOnService { /** * Check whether a given add-on is installed - * @param addOn - * @return */ public boolean isInstalled(AddOn addOn) { // it isnt installed if it is null... @@ -44,8 +41,6 @@ public class AddOnService { /** * Check whether an external add-on is installed - * @param packageName - * @return */ public boolean isInstalled(String packageName) { return isInstalled(packageName, false); @@ -53,9 +48,7 @@ public class AddOnService { /** * Check whether a given add-on is installed - * @param addOn * @param internal whether to do api sig check - * @return */ private boolean isInstalled(String packageName, boolean internal) { if(Constants.PACKAGE.equals(packageName)) { diff --git a/astrid/src/main/java/com/todoroo/astrid/service/MarketStrategy.java b/astrid/src/main/java/com/todoroo/astrid/service/MarketStrategy.java index 1d5f3104e..7969445df 100644 --- a/astrid/src/main/java/com/todoroo/astrid/service/MarketStrategy.java +++ b/astrid/src/main/java/com/todoroo/astrid/service/MarketStrategy.java @@ -13,7 +13,6 @@ import org.tasks.R; public abstract class MarketStrategy { /** - * @param packageName * @return an intent to launch market with this package */ abstract public Intent generateMarketLink(String packageName); @@ -34,7 +33,6 @@ public abstract class MarketStrategy { /** * Most market strategies don't support billing at this time, * so we'll make the default false - * @return */ public boolean billingSupported() { return false; @@ -43,7 +41,6 @@ public abstract class MarketStrategy { /** * Return true if the preference to use the phone layout should be * turned on by default (only true for Nook) - * @return */ public boolean defaultPhoneLayout() { return false; diff --git a/astrid/src/main/java/com/todoroo/astrid/service/MetadataService.java b/astrid/src/main/java/com/todoroo/astrid/service/MetadataService.java index 9497d13ca..86eb37135 100644 --- a/astrid/src/main/java/com/todoroo/astrid/service/MetadataService.java +++ b/astrid/src/main/java/com/todoroo/astrid/service/MetadataService.java @@ -64,8 +64,6 @@ public class MetadataService { /** * Query underlying database - * @param query - * @return */ public TodorooCursor query(Query query) { return metadataDao.query(query); @@ -73,7 +71,6 @@ public class MetadataService { /** * Delete from metadata table where rows match a certain condition - * @param where */ public int deleteWhere(Criterion where) { return metadataDao.deleteWhere(where); @@ -90,7 +87,6 @@ public class MetadataService { /** * Save a single piece of metadata - * @param metadata */ public boolean save(Metadata metadata) { if(!metadata.containsNonNullValue(Metadata.TASK)) { @@ -102,9 +98,6 @@ public class MetadataService { /** * Synchronize metadata for given task id - * @param id - * @param metadata - * @param metadataKeys * @return true if there were changes */ public boolean synchronizeMetadata(long taskId, ArrayList metadata, @@ -196,7 +189,6 @@ public class MetadataService { /** * Deletes the given metadata - * @param metadata */ public void delete(Metadata metadata) { metadataDao.delete(metadata.getId()); diff --git a/astrid/src/main/java/com/todoroo/astrid/service/StartupService.java b/astrid/src/main/java/com/todoroo/astrid/service/StartupService.java index fc2e63494..ec6d25662 100644 --- a/astrid/src/main/java/com/todoroo/astrid/service/StartupService.java +++ b/astrid/src/main/java/com/todoroo/astrid/service/StartupService.java @@ -263,10 +263,6 @@ public class StartupService { }); } - /** - * @param context - * @param e error that was raised - */ public static void handleSQLiteError(Context context, final SQLiteException e) { if (context instanceof Activity) { Activity activity = (Activity) context; @@ -368,7 +364,6 @@ public class StartupService { /** * Show task killer helper - * @param context */ private static void showTaskKillerHelp(final Context context) { if(!Preferences.getBoolean(P_TASK_KILLER_HELP, false)) { diff --git a/astrid/src/main/java/com/todoroo/astrid/service/SyncV2Service.java b/astrid/src/main/java/com/todoroo/astrid/service/SyncV2Service.java index fcda1b88b..484c28828 100644 --- a/astrid/src/main/java/com/todoroo/astrid/service/SyncV2Service.java +++ b/astrid/src/main/java/com/todoroo/astrid/service/SyncV2Service.java @@ -34,8 +34,6 @@ public class SyncV2Service { /** * Returns active sync providers - * - * @param callback */ public List activeProviders() { ArrayList actives = new ArrayList(); diff --git a/astrid/src/main/java/com/todoroo/astrid/service/TagDataService.java b/astrid/src/main/java/com/todoroo/astrid/service/TagDataService.java index 3ad5bfd6e..c818ef602 100644 --- a/astrid/src/main/java/com/todoroo/astrid/service/TagDataService.java +++ b/astrid/src/main/java/com/todoroo/astrid/service/TagDataService.java @@ -5,9 +5,6 @@ */ package com.todoroo.astrid.service; -import org.json.JSONException; -import org.json.JSONObject; - import android.database.Cursor; import android.text.TextUtils; @@ -56,8 +53,6 @@ public class TagDataService { /** * Query underlying database - * @param query - * @return */ public TodorooCursor query(Query query) { return tagDataDao.query(query); @@ -65,16 +60,12 @@ public class TagDataService { /** * Save a single piece of metadata - * @param metadata */ public boolean save(TagData tagData) { return tagDataDao.persist(tagData); } /** - * - * @param properties - * @param id id * @return item, or null if it doesn't exist */ public TagData fetchById(long id, Property... properties) { @@ -100,10 +91,6 @@ public class TagDataService { /** * Fetch tag data - * @param queryTemplate - * @param constraint - * @param properties - * @return */ public TodorooCursor fetchFiltered(String queryTemplate, CharSequence constraint, Property... properties) { @@ -192,8 +179,6 @@ public class TagDataService { /** * Return update - * @param tagData - * @return */ public UserActivity getLatestUpdate(TagData tagData) { if(RemoteModel.NO_UUID.equals(tagData.getValue(TagData.UUID))) { diff --git a/astrid/src/main/java/com/todoroo/astrid/service/TaskService.java b/astrid/src/main/java/com/todoroo/astrid/service/TaskService.java index 4fb4d7b9a..5acd5aa91 100644 --- a/astrid/src/main/java/com/todoroo/astrid/service/TaskService.java +++ b/astrid/src/main/java/com/todoroo/astrid/service/TaskService.java @@ -97,17 +97,12 @@ public class TaskService { /** * Query underlying database - * @param query - * @return */ public TodorooCursor query(Query query) { return taskDao.query(query); } /** - * - * @param properties - * @param id id * @return item, or null if it doesn't exist */ public Task fetchById(long id, Property... properties) { @@ -116,8 +111,6 @@ public class TaskService { /** * - * @param uuid - * @param properties * @return item, or null if it doesn't exist */ public Task fetchByUUID(String uuid, Property... properties) { @@ -135,8 +128,6 @@ public class TaskService { /** * Mark the given task as completed and save it. - * - * @param item */ public void setComplete(Task item, boolean completed) { if(completed) { @@ -162,11 +153,6 @@ public class TaskService { /** * Create or save the given action item - * - * @param item - * @param skipHooks - * Whether pre and post hooks should run. This should be set - * to true if tasks are created as part of synchronization */ public boolean save(Task item) { return taskDao.save(item); @@ -175,7 +161,6 @@ public class TaskService { /** * Clone the given task and all its metadata * - * @param the old task * @return the new task */ public Task clone(Task task) { @@ -241,8 +226,6 @@ public class TaskService { /** * Delete the given task. Instead of deleting from the database, we set * the deleted flag. - * - * @param model */ public void delete(Task item) { if(!item.isSaved()) { @@ -263,8 +246,6 @@ public class TaskService { /** * Permanently delete the given task. - * - * @param model */ public void purge(long taskId) { taskDao.delete(taskId); @@ -292,10 +273,7 @@ public class TaskService { /** * Fetch tasks for the given filter - * @param properties * @param constraint text constraint, or null - * @param filter - * @return */ public TodorooCursor fetchFiltered(String queryTemplate, CharSequence constraint, Property... properties) { @@ -357,7 +335,6 @@ public class TaskService { } /** - * @param query * @return how many tasks are matched by this query */ public int count(Query query) { @@ -367,7 +344,6 @@ public class TaskService { /** * Clear details cache. Useful if user performs some operation that * affects details - * @param criterion * * @return # of affected rows */ @@ -379,10 +355,6 @@ public class TaskService { /** * Update database based on selection and values - * @param selection - * @param selectionArgs - * @param setValues - * @return */ public int updateBySelection(String selection, String[] selectionArgs, Task taskValues) { @@ -417,8 +389,6 @@ public class TaskService { /** * Count tasks overall - * @param filter - * @return */ public int countTasks() { TodorooCursor cursor = query(Query.select(Task.ID)); @@ -443,7 +413,6 @@ public class TaskService { /** * Delete all tasks matching a given criterion - * @param all */ public int deleteWhere(Criterion criteria) { return taskDao.deleteWhere(criteria); @@ -465,9 +434,7 @@ public class TaskService { /** * Parse quick add markup for the given task - * @param task * @param tags an empty array to apply tags to - * @return */ public static boolean parseQuickAddMarkup(Task task, ArrayList tags) { return TitleParser.parse(task, tags); @@ -475,7 +442,6 @@ public class TaskService { /** * Create an uncompleted copy of this task and edit it - * @param itemId * @return cloned item id */ public long duplicateTask(long itemId) { @@ -499,12 +465,6 @@ public class TaskService { /** * Create task from the given content values, saving it. This version * doesn't need to start with a base task model. - * - * @param values - * @param title - * @param taskService - * @param metadataService - * @return */ public static Task createWithValues(ContentValues values, String title) { Task task = new Task(); @@ -513,13 +473,7 @@ public class TaskService { /** * Create task from the given content values, saving it. - * * @param task base task to start with - * @param values - * @param title - * @param taskService - * @param metadataService - * @return */ public static Task createWithValues(Task task, ContentValues values, String title) { if (title != null) { diff --git a/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java b/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java index 8a3b63bbd..c191cae82 100644 --- a/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java +++ b/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListFragmentHelper.java @@ -5,13 +5,6 @@ */ package com.todoroo.astrid.subtasks; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - import android.app.Activity; import android.database.Cursor; import android.text.TextUtils; @@ -24,7 +17,6 @@ import android.widget.ListView; import com.commonsware.cwac.tlv.TouchListView.DropListener; import com.commonsware.cwac.tlv.TouchListView.GrabberClickListener; import com.commonsware.cwac.tlv.TouchListView.SwipeListener; -import org.tasks.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.service.Autowired; @@ -46,6 +38,15 @@ import com.todoroo.astrid.subtasks.OrderedMetadataListUpdater.OrderedListNodeVis import com.todoroo.astrid.ui.DraggableListView; import com.todoroo.astrid.utility.AstridPreferences; +import org.tasks.R; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + public class OrderedMetadataListFragmentHelper implements OrderedListFragmentHelperInterface { private final DisplayMetrics metrics = new DisplayMetrics(); @@ -118,7 +119,6 @@ public class OrderedMetadataListFragmentHelper implements OrderedListFragm @Override public void beforeSetUpTaskList(Filter filter) { - updater.initialize(list, filter); } @Override diff --git a/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListUpdater.java b/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListUpdater.java index 44d077659..8299a1baf 100644 --- a/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListUpdater.java +++ b/astrid/src/main/java/com/todoroo/astrid/subtasks/OrderedMetadataListUpdater.java @@ -5,12 +5,6 @@ */ package com.todoroo.astrid.subtasks; -import java.util.ArrayList; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicReference; - import com.todoroo.andlib.data.Property.IntegerProperty; import com.todoroo.andlib.data.Property.LongProperty; import com.todoroo.andlib.service.DependencyInjectionService; @@ -18,7 +12,12 @@ import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.core.PluginServices; import com.todoroo.astrid.data.Metadata; import com.todoroo.astrid.data.Task; -import com.todoroo.astrid.subtasks.OrderedMetadataListUpdater.OrderedListIterator; + +import java.util.ArrayList; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; abstract public class OrderedMetadataListUpdater { @@ -44,39 +43,14 @@ abstract public class OrderedMetadataListUpdater { abstract protected Metadata createEmptyMetadata(LIST list, long taskId); - /** - * @param list - * @param filter - */ - protected void initialize(LIST list, Filter filter) { - // - } - - /** - * @param list - */ protected void beforeIndent(LIST list) { // } - /** - * @param metadata - */ protected void onMovedOrIndented(Metadata metadata) { // } - /** - * @param list - * @param taskId - * @param metadata - * @param indent - * @param order - */ - protected void beforeSaveIndent(LIST list, long taskId, Metadata metadata, int indent, int order) { - // - } - // --- task indenting /** @@ -148,10 +122,6 @@ abstract public class OrderedMetadataListUpdater { /** * Helper function to iterate through a list and compute a new parent for the target task * based on the target parent's indent - * @param list - * @param targetTaskId - * @param newIndent - * @return */ private long computeNewParent(Filter filter, LIST list, long targetTaskId, int targetParentIndent) { final AtomicInteger desiredParentIndent = new AtomicInteger(targetParentIndent); @@ -184,8 +154,6 @@ abstract public class OrderedMetadataListUpdater { /** * Move a task and all its children to the position right above * taskIdToMoveto. Will change the indent level to match taskIdToMoveTo. - * - * @param newTaskId task we will move above. if -1, moves to end of list */ public void moveTo(Filter filter, LIST list, final long targetTaskId, final long moveBeforeTaskId) { @@ -357,9 +325,6 @@ abstract public class OrderedMetadataListUpdater { /** * Removes a task from the order hierarchy and un-indent children - * @param filter - * @param list - * @param targetTaskId */ public void onDeleteTask(Filter filter, LIST list, final long targetTaskId) { if(list == null) { diff --git a/astrid/src/main/java/com/todoroo/astrid/subtasks/SubtasksHelper.java b/astrid/src/main/java/com/todoroo/astrid/subtasks/SubtasksHelper.java index c562f9638..b56aa2b9f 100644 --- a/astrid/src/main/java/com/todoroo/astrid/subtasks/SubtasksHelper.java +++ b/astrid/src/main/java/com/todoroo/astrid/subtasks/SubtasksHelper.java @@ -130,8 +130,6 @@ public class SubtasksHelper { /** * Takes a subtasks string containing local ids and remaps it to one containing UUIDs - * @param localTree - * @return */ public static String convertTreeToRemoteIds(String localTree) { Long[] localIds = getIdArray(localTree); diff --git a/astrid/src/main/java/com/todoroo/astrid/tags/TagService.java b/astrid/src/main/java/com/todoroo/astrid/tags/TagService.java index 9db282b97..7bf2874fd 100644 --- a/astrid/src/main/java/com/todoroo/astrid/tags/TagService.java +++ b/astrid/src/main/java/com/todoroo/astrid/tags/TagService.java @@ -5,19 +5,11 @@ */ package com.todoroo.astrid.tags; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; - import android.content.Context; import android.content.Intent; import android.text.TextUtils; import android.widget.Toast; -import org.tasks.R; import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.Property.CountProperty; import com.todoroo.andlib.data.TodorooCursor; @@ -47,6 +39,15 @@ import com.todoroo.astrid.service.MetadataService; import com.todoroo.astrid.service.TagDataService; import com.todoroo.astrid.service.TaskService; +import org.tasks.R; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; + /** * Provides operations for working with tags * @@ -144,9 +145,6 @@ public final class TagService { /** * Return SQL selector query for getting tasks with a given tagData - * - * @param tagData - * @return */ public QueryTemplate queryTemplate(Criterion criterion) { Criterion fullCriterion = Criterion.and( @@ -240,9 +238,6 @@ public final class TagService { /** * Creates a link for a nameless tag. We expect the server to fill in the tag name with a MakeChanges message later - * @param taskId - * @param taskUuid - * @param tagUuid */ public void createLink(long taskId, String taskUuid, String tagUuid, boolean suppressOutstanding) { TodorooCursor existingTag = tagDataService.query(Query.select(TagData.NAME, TagData.UUID).where(TagData.UUID.eq(tagUuid))); @@ -274,8 +269,6 @@ public final class TagService { /** * Delete a single task to tag link - * @param taskUuid - * @param tagUuid */ public void deleteLink(long taskId, String taskUuid, String tagUuid, boolean suppressOutstanding) { Metadata deleteTemplate = new Metadata(); @@ -291,8 +284,6 @@ public final class TagService { /** * Delete all links between the specified task and the list of tags - * @param taskUuid - * @param tagUuids */ public void deleteLinks(long taskId, String taskUuid, String[] tagUuids, boolean suppressOutstanding) { Metadata deleteTemplate = new Metadata(); @@ -314,8 +305,6 @@ public final class TagService { /** * Return tags on the given task - * - * @param taskId * @return cursor. PLEASE CLOSE THE CURSOR! */ public TodorooCursor getTags(long taskId) { @@ -345,8 +334,6 @@ public final class TagService { /** * Return tags as a comma-separated list of strings - * - * @param taskId * @return empty string if no tags, otherwise string */ public String getTagsAsString(long taskId) { @@ -355,8 +342,6 @@ public final class TagService { /** * Return tags as a list of strings separated by given separator - * - * @param taskId * @return empty string if no tags, otherwise string */ public String getTagsAsString(long taskId, String separator) { @@ -399,7 +384,6 @@ public final class TagService { /** * Return all tags (including metadata tags and TagData tags) in an array list - * @return */ public ArrayList getTagList() { ArrayList tagList = new ArrayList(); @@ -459,8 +443,6 @@ public final class TagService { /** * Save the given array of tags into the database - * @param taskId - * @param tags */ public boolean synchronizeTags(long taskId, String taskUuid, Set tags) { HashSet existingLinks = new HashSet(); @@ -499,8 +481,6 @@ public final class TagService { /** * If a tag already exists in the database that case insensitively matches the * given tag, return that. Otherwise, return the argument - * @param tag - * @return */ public String getTagWithCase(String tag) { MetadataService service = PluginServices.getMetadataService(); diff --git a/astrid/src/main/java/com/todoroo/astrid/tags/TagsControlSet.java b/astrid/src/main/java/com/todoroo/astrid/tags/TagsControlSet.java index f5066a357..90aafce54 100644 --- a/astrid/src/main/java/com/todoroo/astrid/tags/TagsControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/tags/TagsControlSet.java @@ -227,7 +227,6 @@ public final class TagsControlSet extends PopupControlSet { /** * Get tags container last text view. might be null - * @return */ private TextView getLastTextView() { if(newTags.getChildCount() == 0) { diff --git a/astrid/src/main/java/com/todoroo/astrid/tags/TagsPlugin.java b/astrid/src/main/java/com/todoroo/astrid/tags/TagsPlugin.java index 11f065934..c562a3832 100644 --- a/astrid/src/main/java/com/todoroo/astrid/tags/TagsPlugin.java +++ b/astrid/src/main/java/com/todoroo/astrid/tags/TagsPlugin.java @@ -32,7 +32,6 @@ public class TagsPlugin extends BroadcastReceiver { /** * Create new tag data - * @param activity */ public static Intent newTagDialog(Context context) { Class settingsComponent = AstridPreferences.useTabletLayout(context) ? TagSettingsActivityTablet.class : TagSettingsActivity.class; diff --git a/astrid/src/main/java/com/todoroo/astrid/tags/TaskToTagMetadata.java b/astrid/src/main/java/com/todoroo/astrid/tags/TaskToTagMetadata.java index 1002e42e8..a92eed773 100644 --- a/astrid/src/main/java/com/todoroo/astrid/tags/TaskToTagMetadata.java +++ b/astrid/src/main/java/com/todoroo/astrid/tags/TaskToTagMetadata.java @@ -26,11 +26,6 @@ public class TaskToTagMetadata { * New metadata object for linking a task to the specified tag. The task * object should be saved and have the uuid property. All parameters * are manditory - * @param taskId - * @param tagName - * @param taskUuid - * @param tagUuid - * @return */ public static Metadata newTagMetadata(long taskId, String taskUuid, String tagName, String tagUuid) { Metadata link = new Metadata(); diff --git a/astrid/src/main/java/com/todoroo/astrid/tags/reusable/FeaturedListFilterMode.java b/astrid/src/main/java/com/todoroo/astrid/tags/reusable/FeaturedListFilterMode.java index b02e01abb..6e73c7ef7 100644 --- a/astrid/src/main/java/com/todoroo/astrid/tags/reusable/FeaturedListFilterMode.java +++ b/astrid/src/main/java/com/todoroo/astrid/tags/reusable/FeaturedListFilterMode.java @@ -43,11 +43,6 @@ public class FeaturedListFilterMode implements FilterModeSpec { return R.attr.asMainMenu; } - @Override - public void onFilterItemClickedCallback(FilterListItem item) { - // - } - @Override public boolean showComments() { return false; diff --git a/astrid/src/main/java/com/todoroo/astrid/tags/reusable/FeaturedTaskListFragment.java b/astrid/src/main/java/com/todoroo/astrid/tags/reusable/FeaturedTaskListFragment.java index 832ac4cfe..4d4e8b936 100644 --- a/astrid/src/main/java/com/todoroo/astrid/tags/reusable/FeaturedTaskListFragment.java +++ b/astrid/src/main/java/com/todoroo/astrid/tags/reusable/FeaturedTaskListFragment.java @@ -28,7 +28,6 @@ import com.todoroo.astrid.data.RemoteModel; import com.todoroo.astrid.data.TagData; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.helper.AsyncImageView; -import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.service.TagDataService; import com.todoroo.astrid.tags.TagFilterExposer; import com.todoroo.astrid.tags.TagService.Tag; diff --git a/astrid/src/main/java/com/todoroo/astrid/timers/TimerControlSet.java b/astrid/src/main/java/com/todoroo/astrid/timers/TimerControlSet.java index 17648681e..4d0cbae17 100644 --- a/astrid/src/main/java/com/todoroo/astrid/timers/TimerControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/timers/TimerControlSet.java @@ -156,7 +156,6 @@ public class TimerControlSet extends PopupControlSet implements TimerActionListe @Override public void timerStarted(Task task) { - return; } } diff --git a/astrid/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java b/astrid/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java index 616fce58c..ce89a97f4 100644 --- a/astrid/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java +++ b/astrid/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java @@ -24,7 +24,6 @@ import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.core.PluginServices; import com.todoroo.astrid.data.Task; -import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.utility.Constants; public class TimerPlugin extends BroadcastReceiver { @@ -44,7 +43,6 @@ public class TimerPlugin extends BroadcastReceiver { /** * toggles timer and updates elapsed time. - * @param task * @param start if true, start timer. else, stop it */ public static void updateTimer(Context context, Task task, boolean start) { diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/CalendarView.java b/astrid/src/main/java/com/todoroo/astrid/ui/CalendarView.java index 7707132f6..4b6a10119 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/CalendarView.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/CalendarView.java @@ -86,7 +86,6 @@ public class CalendarView extends View { /** * Constructor. This version is only needed if you will be instantiating * the object manually (not from a layout XML file). - * @param context */ public CalendarView(Context context) { super(context); diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/ContactListAdapter.java b/astrid/src/main/java/com/todoroo/astrid/ui/ContactListAdapter.java deleted file mode 100644 index 2c3ab1b83..000000000 --- a/astrid/src/main/java/com/todoroo/astrid/ui/ContactListAdapter.java +++ /dev/null @@ -1,199 +0,0 @@ -/** - * Copyright (c) 2012 Todoroo Inc - * - * See the file "LICENSE" for the full license governing this code. - */ -package com.todoroo.astrid.ui; - -import java.io.InputStream; - -import android.app.Activity; -import android.content.ContentResolver; -import android.content.ContentUris; -import android.content.ContentValues; -import android.content.Context; -import android.database.Cursor; -import android.database.MergeCursor; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.net.Uri; -import android.os.AsyncTask; -import android.provider.Contacts; -import android.provider.ContactsContract; -import android.provider.ContactsContract.CommonDataKinds.Email; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.CursorAdapter; -import android.widget.ImageView; -import android.widget.TextView; - -import org.tasks.R; -import com.todoroo.andlib.service.Autowired; -import com.todoroo.andlib.service.ContextManager; -import com.todoroo.andlib.service.DependencyInjectionService; -import com.todoroo.andlib.sql.Criterion; -import com.todoroo.andlib.sql.Functions; -import com.todoroo.andlib.sql.Order; -import com.todoroo.andlib.sql.Query; -import com.todoroo.astrid.data.TagData; -import com.todoroo.astrid.service.TagDataService; - -public class ContactListAdapter extends CursorAdapter { - - @Autowired TagDataService tagDataService; - - private static final String[] PEOPLE_PROJECTION = new String[] { - Email._ID, Email.CONTACT_ID, ContactsContract.Contacts.DISPLAY_NAME, Email.DATA - }; - - private boolean completeSharedTags = false; - - public ContactListAdapter(Activity activity, Cursor c) { - super(activity, c); - mContent = activity.getContentResolver(); - DependencyInjectionService.getInstance().inject(this); - } - - public void setCompleteSharedTags(boolean completeSharedTags) { - this.completeSharedTags = completeSharedTags; - } - - @Override - public View newView(Context context, Cursor cursor, ViewGroup parent) { - final LayoutInflater inflater = LayoutInflater.from(context); - final View view = inflater.inflate(R.layout.contact_adapter_row, parent, false); - bindView(view, context, cursor); - return view; - } - - @Override - public void bindView(View view, Context context, Cursor cursor) { - TextView text1 = (TextView) view.findViewById(android.R.id.text1); - TextView text2 = (TextView) view.findViewById(android.R.id.text2); - ImageView imageView = (ImageView) view.findViewById(R.id.icon); - - if(cursor.getColumnNames().length == PEOPLE_PROJECTION.length) { - int name = cursor.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME); - int email = cursor.getColumnIndexOrThrow(Email.DATA); - if(cursor.isNull(name)) { - text1.setText(cursor.getString(email)); - text2.setText(""); - } else { - text1.setText(cursor.getString(name)); - text2.setText(cursor.getString(email)); - } - imageView.setImageResource(R.drawable.icn_default_person_image); - Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, cursor.getLong(0)); - imageView.setTag(uri); - ContactImageTask ciTask = new ContactImageTask(imageView); - ciTask.execute(uri); - } else { - int name = cursor.getColumnIndexOrThrow(TagData.NAME.name); - text1.setText(cursor.getString(name)); - imageView.setImageResource(R.drawable.med_tag); - } - } - - private class ContactImageTask extends AsyncTask { - private Uri uri; - private final ImageView imageView; - - - public ContactImageTask(ImageView imageView) { - this.imageView = imageView; - } - - @Override - protected Bitmap doInBackground(Uri... params) { - uri = params[0]; - InputStream input = ContactsContract.Contacts.openContactPhotoInputStream(mContent, uri); - if (input == null) { - return null; - } - return BitmapFactory.decodeStream(input); - } - - @Override - protected void onPostExecute(Bitmap bitmap) { - if (isCancelled()) { - bitmap = null; - } - if(imageView != null && uri.equals(imageView.getTag()) && bitmap != null) { - imageView.setImageBitmap(bitmap); - } - } - } - - @Override - public String convertToString(Cursor cursor) { - if(cursor.getColumnIndex(Email.DATA) > -1) { - int name = cursor.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME); - int email = cursor.getColumnIndexOrThrow(Email.DATA); - if(cursor.isNull(name)) { - return cursor.getString(email); - } - return cursor.getString(name) + " <" + cursor.getString(email) +">"; - } else { - int name = cursor.getColumnIndexOrThrow(TagData.NAME.name); - return "#" + cursor.getString(name); - } - } - - @Override - public Cursor runQueryOnBackgroundThread(CharSequence constraint) { - if (getFilterQueryProvider() != null) { - return getFilterQueryProvider().runQuery(constraint); - } - - String filterParams = constraint == null ? "" : Uri.encode(constraint.toString()); - Uri uri = Uri.withAppendedPath(Email.CONTENT_FILTER_URI, filterParams); - String sort = Email.TIMES_CONTACTED + " DESC LIMIT 20"; - Cursor peopleCursor = mContent.query(uri, PEOPLE_PROJECTION, - null, null, sort); - - if(!completeSharedTags) { - return peopleCursor; - } - - Criterion crit = Criterion.all; - if(constraint != null) { - crit = Functions.upper(TagData.NAME).like("%" + constraint.toString().toUpperCase() + "%"); - } else { - crit = Criterion.none; - } - Cursor tagCursor = tagDataService.query(Query.select(TagData.ID, TagData.NAME, TagData.PICTURE, TagData.THUMB). - where(Criterion.and(TagData.USER_ID.eq(0), TagData.MEMBER_COUNT.gt(0), - crit)).orderBy(Order.desc(TagData.NAME))); - - return new MergeCursor(new Cursor[] { tagCursor, peopleCursor }); - } - - private final ContentResolver mContent; - - /** - * debug method - */ - public static void makeLotsOfContacts() { - ContentResolver cr = ContextManager.getContext().getContentResolver(); - ContentValues personValues = new ContentValues(); - ContentValues emailValues = new ContentValues(); - for(int i = 0; i < 2000; i++) { - personValues.clear(); - personValues.put(Contacts.People.NAME, "John " + i + " Doe"); - Uri newPersonUri = cr.insert(Contacts.People.CONTENT_URI, personValues); - if (newPersonUri != null) { - emailValues.clear(); - Uri emailUri = Uri.withAppendedPath(newPersonUri, - Contacts.People.ContactMethods.CONTENT_DIRECTORY); - emailValues.put(Contacts.ContactMethods.KIND, - Contacts.KIND_EMAIL); - emailValues.put(Contacts.ContactMethods.TYPE, - Contacts.ContactMethods.TYPE_HOME); - emailValues.put(Contacts.ContactMethods.DATA, - "john." + i + ".doe@test.com"); - cr.insert(emailUri, emailValues); - } - } - } -} diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/ContactsAutoComplete.java b/astrid/src/main/java/com/todoroo/astrid/ui/ContactsAutoComplete.java deleted file mode 100644 index 192fc92bb..000000000 --- a/astrid/src/main/java/com/todoroo/astrid/ui/ContactsAutoComplete.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Copyright (c) 2012 Todoroo Inc - * - * See the file "LICENSE" for the full license governing this code. - */ -package com.todoroo.astrid.ui; - -import android.app.Activity; -import android.content.Context; -import android.content.res.TypedArray; -import android.text.TextUtils; -import android.util.AttributeSet; -import android.widget.AutoCompleteTextView; - -import org.tasks.R; - -public class ContactsAutoComplete extends AutoCompleteTextView { - - private boolean allowMultiple = false; - private boolean completeTags = false; - - public ContactsAutoComplete(final Context context, final AttributeSet attrs, - final int defStyle) { - super(context, attrs, defStyle); - this.setThreshold(0); - this.setUpContacts(); - } - - public ContactsAutoComplete(final Context context, final AttributeSet attrs) { - super(context, attrs); - this.setThreshold(0); - this.setUpContacts(); - - TypedArray a = getContext().obtainStyledAttributes(attrs, - R.styleable.ContactsAutoComplete); - allowMultiple = a.getBoolean(R.styleable.ContactsAutoComplete_allowMultiple, false); - completeTags = a.getBoolean(R.styleable.ContactsAutoComplete_completeTags, false); - } - - public ContactsAutoComplete(final Context context) { - super(context); - this.setThreshold(0); - this.setUpContacts(); - } - - // --- comma separating stuff - - private String previous = ""; //$NON-NLS-1$ - private String seperator = ", "; //$NON-NLS-1$ - private ContactListAdapter adapter; - - /** - * This method filters out the existing text till the separator and launched - * the filtering process again - */ - @Override - protected void performFiltering(final CharSequence text, final int keyCode) { - String filterText = text.toString().trim(); - if(allowMultiple) { - previous = filterText.substring(0, - filterText.lastIndexOf(getSeperator()) + 1); - filterText = filterText.substring(filterText.lastIndexOf(getSeperator()) + 1); - } - - if (!TextUtils.isEmpty(filterText)) { - super.performFiltering(filterText, keyCode); - } - } - - /** - * After a selection, capture the new value and append to the existing text - */ - @Override - protected void replaceText(final CharSequence text) { - if(allowMultiple) { - super.replaceText(previous + text + getSeperator()); - } else { - super.replaceText(text); - } - } - - // --- cursor stuff - - private void setUpContacts() { - try { - adapter = new ContactListAdapter((Activity) getContext(), null); - adapter.setCompleteSharedTags(completeTags); - setAdapter(adapter); - } catch (VerifyError ve) { - adapter = null; - } - } - - // --- getters and setters - - public boolean isAllowMultiple() { - return allowMultiple; - } - - public String getSeperator() { - return seperator; - } - - public void setCompleteSharedTags(boolean value) { - completeTags = value; - if (adapter != null) { - adapter.setCompleteSharedTags(value); - } - } - - public void setAllowMultiple(boolean allowMultiple) { - this.allowMultiple = allowMultiple; - } - - public void setSeperator(final String seperator) { - this.seperator = seperator; - } - -} diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/NNumberPickerDialog.java b/astrid/src/main/java/com/todoroo/astrid/ui/NNumberPickerDialog.java index 291fba085..50b192633 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/NNumberPickerDialog.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/NNumberPickerDialog.java @@ -33,7 +33,6 @@ public class NNumberPickerDialog extends AlertDialog implements OnClickListener /** Instantiate the dialog box. * - * @param context * @param callBack callback function to get the numbers you requested * @param title title of the dialog box * @param initialValue initial picker values array diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/NumberPicker.java b/astrid/src/main/java/com/todoroo/astrid/ui/NumberPicker.java index dd664991f..beeb134f0 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/NumberPicker.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/NumberPicker.java @@ -476,7 +476,6 @@ public class NumberPicker extends LinearLayout implements OnClickListener, /** * Override the number picker's text - * @param text */ public void setText(String text) { mText.setText(text); diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/QuickAddBar.java b/astrid/src/main/java/com/todoroo/astrid/ui/QuickAddBar.java index b2ea229c6..4f557e75e 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/QuickAddBar.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/QuickAddBar.java @@ -5,13 +5,8 @@ */ package com.todoroo.astrid.ui; -import java.util.HashSet; -import java.util.concurrent.atomic.AtomicReference; - -import android.app.Activity; import android.content.ContentValues; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.text.Editable; @@ -30,7 +25,6 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; -import org.tasks.R; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.DependencyInjectionService; @@ -59,6 +53,11 @@ import com.todoroo.astrid.service.TaskService; import com.todoroo.astrid.utility.Flags; import com.todoroo.astrid.voice.VoiceRecognizer; +import org.tasks.R; + +import java.util.HashSet; +import java.util.concurrent.atomic.AtomicReference; + /** * Quick Add Bar lets you add tasks. * @@ -254,9 +253,6 @@ public class QuickAddBar extends LinearLayout { /** * Quick-add a new task - * - * @param title - * @return */ public Task quickAddTask(String title, boolean selectNewTask) { TagData tagData = fragment.getActiveTagData(); @@ -350,8 +346,6 @@ public class QuickAddBar extends LinearLayout { /** * Static method to quickly add tasks without all the control set nonsense. * Used from the share link activity. - * @param title - * @return */ public static Task basicQuickAddTask(String title) { if (TextUtils.isEmpty(title)) { diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/RandomReminderControlSet.java b/astrid/src/main/java/com/todoroo/astrid/ui/RandomReminderControlSet.java index 2a82c2e8b..2156d1c7c 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/RandomReminderControlSet.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/RandomReminderControlSet.java @@ -17,7 +17,6 @@ import org.tasks.R; import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.helper.TaskEditControlSet; -import com.todoroo.astrid.service.StatisticsConstants; /** * Control set dealing with random reminder settings diff --git a/astrid/src/main/java/com/todoroo/astrid/ui/TaskListFragmentPager.java b/astrid/src/main/java/com/todoroo/astrid/ui/TaskListFragmentPager.java index 3a0741abc..9791d5836 100644 --- a/astrid/src/main/java/com/todoroo/astrid/ui/TaskListFragmentPager.java +++ b/astrid/src/main/java/com/todoroo/astrid/ui/TaskListFragmentPager.java @@ -14,7 +14,6 @@ import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; -import org.tasks.R; import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.activity.TaskListFragment; @@ -23,6 +22,8 @@ import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.service.ThemeService; import com.todoroo.astrid.utility.Flags; +import org.tasks.R; + public class TaskListFragmentPager extends ViewPager { public static final String PREF_SHOWED_SWIPE_HELPER = "showed_swipe_helper"; //$NON-NLS-1$ @@ -53,7 +54,6 @@ public class TaskListFragmentPager extends ViewPager { /** * Show the supplied filter, adding it to the data source if it doesn't exist - * @param f */ public void showFilter(Filter f) { TaskListFragmentPagerAdapter adapter = (TaskListFragmentPagerAdapter) getAdapter(); @@ -62,7 +62,6 @@ public class TaskListFragmentPager extends ViewPager { /** * Show the filter at the supplied index, with animation - * @param index */ public void showFilter(int index) { setCurrentItem(index, true); @@ -70,7 +69,6 @@ public class TaskListFragmentPager extends ViewPager { /** * Returns the currently showing fragment - * @return */ public TaskListFragment getCurrentFragment() { return (TaskListFragment) ((TaskListFragmentPagerAdapter) getAdapter()).lookupFragmentForPosition(getCurrentItem()); diff --git a/astrid/src/main/java/com/todoroo/astrid/utility/Entities.java b/astrid/src/main/java/com/todoroo/astrid/utility/Entities.java deleted file mode 100644 index 33f516634..000000000 --- a/astrid/src/main/java/com/todoroo/astrid/utility/Entities.java +++ /dev/null @@ -1,1342 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.todoroo.astrid.utility; - -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; -import java.util.HashMap; -import java.util.Map; -import java.util.TreeMap; - -/** - *

- * Provides HTML and XML entity utilities. - *

- * - * @see ISO Entities - * @see HTML 3.2 Character Entities for ISO Latin-1 - * @see HTML 4.0 Character entity references - * @see HTML 4.01 Character References - * @see HTML 4.01 Code positions - * - * @author Alexander Day Chaffee - * @author Gary Gregory - * @since 2.0 - * @version $Id: Entities.java 2696 2007-06-20 13:24:53Z damencho $ - */ -class Entities { - - private static final String[][] BASIC_ARRAY = {{"quot", "34"}, // " - double-quote - {"amp", "38"}, // & - ampersand - {"lt", "60"}, // < - less-than - {"gt", "62"}, // > - greater-than - }; - - private static final String[][] APOS_ARRAY = {{"apos", "39"}, // XML apostrophe - }; - - // package scoped for testing - static final String[][] ISO8859_1_ARRAY = {{"nbsp", "160"}, // non-breaking space - {"iexcl", "161"}, // inverted exclamation mark - {"cent", "162"}, // cent sign - {"pound", "163"}, // pound sign - {"curren", "164"}, // currency sign - {"yen", "165"}, // yen sign = yuan sign - {"brvbar", "166"}, // broken bar = broken vertical bar - {"sect", "167"}, // section sign - {"uml", "168"}, // diaeresis = spacing diaeresis - {"copy", "169"}, // ? - copyright sign - {"ordf", "170"}, // feminine ordinal indicator - {"laquo", "171"}, // left-pointing double angle quotation mark = left pointing guillemet - {"not", "172"}, // not sign - {"shy", "173"}, // soft hyphen = discretionary hyphen - {"reg", "174"}, // ? - registered trademark sign - {"macr", "175"}, // macron = spacing macron = overline = APL overbar - {"deg", "176"}, // degree sign - {"plusmn", "177"}, // plus-minus sign = plus-or-minus sign - {"sup2", "178"}, // superscript two = superscript digit two = squared - {"sup3", "179"}, // superscript three = superscript digit three = cubed - {"acute", "180"}, // acute accent = spacing acute - {"micro", "181"}, // micro sign - {"para", "182"}, // pilcrow sign = paragraph sign - {"middot", "183"}, // middle dot = Georgian comma = Greek middle dot - {"cedil", "184"}, // cedilla = spacing cedilla - {"sup1", "185"}, // superscript one = superscript digit one - {"ordm", "186"}, // masculine ordinal indicator - {"raquo", "187"}, // right-pointing double angle quotation mark = right pointing guillemet - {"frac14", "188"}, // vulgar fraction one quarter = fraction one quarter - {"frac12", "189"}, // vulgar fraction one half = fraction one half - {"frac34", "190"}, // vulgar fraction three quarters = fraction three quarters - {"iquest", "191"}, // inverted question mark = turned question mark - {"Agrave", "192"}, // ? - uppercase A, grave accent - {"Aacute", "193"}, // ? - uppercase A, acute accent - {"Acirc", "194"}, // ? - uppercase A, circumflex accent - {"Atilde", "195"}, // ? - uppercase A, tilde - {"Auml", "196"}, // ? - uppercase A, umlaut - {"Aring", "197"}, // ? - uppercase A, ring - {"AElig", "198"}, // ? - uppercase AE - {"Ccedil", "199"}, // ? - uppercase C, cedilla - {"Egrave", "200"}, // ? - uppercase E, grave accent - {"Eacute", "201"}, // ? - uppercase E, acute accent - {"Ecirc", "202"}, // ? - uppercase E, circumflex accent - {"Euml", "203"}, // ? - uppercase E, umlaut - {"Igrave", "204"}, // ? - uppercase I, grave accent - {"Iacute", "205"}, // ? - uppercase I, acute accent - {"Icirc", "206"}, // ? - uppercase I, circumflex accent - {"Iuml", "207"}, // ? - uppercase I, umlaut - {"ETH", "208"}, // ? - uppercase Eth, Icelandic - {"Ntilde", "209"}, // ? - uppercase N, tilde - {"Ograve", "210"}, // ? - uppercase O, grave accent - {"Oacute", "211"}, // ? - uppercase O, acute accent - {"Ocirc", "212"}, // ? - uppercase O, circumflex accent - {"Otilde", "213"}, // ? - uppercase O, tilde - {"Ouml", "214"}, // ? - uppercase O, umlaut - {"times", "215"}, // multiplication sign - {"Oslash", "216"}, // ? - uppercase O, slash - {"Ugrave", "217"}, // ? - uppercase U, grave accent - {"Uacute", "218"}, // ? - uppercase U, acute accent - {"Ucirc", "219"}, // ? - uppercase U, circumflex accent - {"Uuml", "220"}, // ? - uppercase U, umlaut - {"Yacute", "221"}, // ? - uppercase Y, acute accent - {"THORN", "222"}, // ? - uppercase THORN, Icelandic - {"szlig", "223"}, // ? - lowercase sharps, German - {"agrave", "224"}, // ? - lowercase a, grave accent - {"aacute", "225"}, // ? - lowercase a, acute accent - {"acirc", "226"}, // ? - lowercase a, circumflex accent - {"atilde", "227"}, // ? - lowercase a, tilde - {"auml", "228"}, // ? - lowercase a, umlaut - {"aring", "229"}, // ? - lowercase a, ring - {"aelig", "230"}, // ? - lowercase ae - {"ccedil", "231"}, // ? - lowercase c, cedilla - {"egrave", "232"}, // ? - lowercase e, grave accent - {"eacute", "233"}, // ? - lowercase e, acute accent - {"ecirc", "234"}, // ? - lowercase e, circumflex accent - {"euml", "235"}, // ? - lowercase e, umlaut - {"igrave", "236"}, // ? - lowercase i, grave accent - {"iacute", "237"}, // ? - lowercase i, acute accent - {"icirc", "238"}, // ? - lowercase i, circumflex accent - {"iuml", "239"}, // ? - lowercase i, umlaut - {"eth", "240"}, // ? - lowercase eth, Icelandic - {"ntilde", "241"}, // ? - lowercase n, tilde - {"ograve", "242"}, // ? - lowercase o, grave accent - {"oacute", "243"}, // ? - lowercase o, acute accent - {"ocirc", "244"}, // ? - lowercase o, circumflex accent - {"otilde", "245"}, // ? - lowercase o, tilde - {"ouml", "246"}, // ? - lowercase o, umlaut - {"divide", "247"}, // division sign - {"oslash", "248"}, // ? - lowercase o, slash - {"ugrave", "249"}, // ? - lowercase u, grave accent - {"uacute", "250"}, // ? - lowercase u, acute accent - {"ucirc", "251"}, // ? - lowercase u, circumflex accent - {"uuml", "252"}, // ? - lowercase u, umlaut - {"yacute", "253"}, // ? - lowercase y, acute accent - {"thorn", "254"}, // ? - lowercase thorn, Icelandic - {"yuml", "255"}, // ? - lowercase y, umlaut - }; - - // http://www.w3.org/TR/REC-html40/sgml/entities.html - // package scoped for testing - static final String[][] HTML40_ARRAY = { - // - {"fnof", "402"}, // latin small f with hook = function= florin, U+0192 ISOtech --> - // - {"Alpha", "913"}, // greek capital letter alpha, U+0391 --> - {"Beta", "914"}, // greek capital letter beta, U+0392 --> - {"Gamma", "915"}, // greek capital letter gamma,U+0393 ISOgrk3 --> - {"Delta", "916"}, // greek capital letter delta,U+0394 ISOgrk3 --> - {"Epsilon", "917"}, // greek capital letter epsilon, U+0395 --> - {"Zeta", "918"}, // greek capital letter zeta, U+0396 --> - {"Eta", "919"}, // greek capital letter eta, U+0397 --> - {"Theta", "920"}, // greek capital letter theta,U+0398 ISOgrk3 --> - {"Iota", "921"}, // greek capital letter iota, U+0399 --> - {"Kappa", "922"}, // greek capital letter kappa, U+039A --> - {"Lambda", "923"}, // greek capital letter lambda,U+039B ISOgrk3 --> - {"Mu", "924"}, // greek capital letter mu, U+039C --> - {"Nu", "925"}, // greek capital letter nu, U+039D --> - {"Xi", "926"}, // greek capital letter xi, U+039E ISOgrk3 --> - {"Omicron", "927"}, // greek capital letter omicron, U+039F --> - {"Pi", "928"}, // greek capital letter pi, U+03A0 ISOgrk3 --> - {"Rho", "929"}, // greek capital letter rho, U+03A1 --> - // - {"Sigma", "931"}, // greek capital letter sigma,U+03A3 ISOgrk3 --> - {"Tau", "932"}, // greek capital letter tau, U+03A4 --> - {"Upsilon", "933"}, // greek capital letter upsilon,U+03A5 ISOgrk3 --> - {"Phi", "934"}, // greek capital letter phi,U+03A6 ISOgrk3 --> - {"Chi", "935"}, // greek capital letter chi, U+03A7 --> - {"Psi", "936"}, // greek capital letter psi,U+03A8 ISOgrk3 --> - {"Omega", "937"}, // greek capital letter omega,U+03A9 ISOgrk3 --> - {"alpha", "945"}, // greek small letter alpha,U+03B1 ISOgrk3 --> - {"beta", "946"}, // greek small letter beta, U+03B2 ISOgrk3 --> - {"gamma", "947"}, // greek small letter gamma,U+03B3 ISOgrk3 --> - {"delta", "948"}, // greek small letter delta,U+03B4 ISOgrk3 --> - {"epsilon", "949"}, // greek small letter epsilon,U+03B5 ISOgrk3 --> - {"zeta", "950"}, // greek small letter zeta, U+03B6 ISOgrk3 --> - {"eta", "951"}, // greek small letter eta, U+03B7 ISOgrk3 --> - {"theta", "952"}, // greek small letter theta,U+03B8 ISOgrk3 --> - {"iota", "953"}, // greek small letter iota, U+03B9 ISOgrk3 --> - {"kappa", "954"}, // greek small letter kappa,U+03BA ISOgrk3 --> - {"lambda", "955"}, // greek small letter lambda,U+03BB ISOgrk3 --> - {"mu", "956"}, // greek small letter mu, U+03BC ISOgrk3 --> - {"nu", "957"}, // greek small letter nu, U+03BD ISOgrk3 --> - {"xi", "958"}, // greek small letter xi, U+03BE ISOgrk3 --> - {"omicron", "959"}, // greek small letter omicron, U+03BF NEW --> - {"pi", "960"}, // greek small letter pi, U+03C0 ISOgrk3 --> - {"rho", "961"}, // greek small letter rho, U+03C1 ISOgrk3 --> - {"sigmaf", "962"}, // greek small letter final sigma,U+03C2 ISOgrk3 --> - {"sigma", "963"}, // greek small letter sigma,U+03C3 ISOgrk3 --> - {"tau", "964"}, // greek small letter tau, U+03C4 ISOgrk3 --> - {"upsilon", "965"}, // greek small letter upsilon,U+03C5 ISOgrk3 --> - {"phi", "966"}, // greek small letter phi, U+03C6 ISOgrk3 --> - {"chi", "967"}, // greek small letter chi, U+03C7 ISOgrk3 --> - {"psi", "968"}, // greek small letter psi, U+03C8 ISOgrk3 --> - {"omega", "969"}, // greek small letter omega,U+03C9 ISOgrk3 --> - {"thetasym", "977"}, // greek small letter theta symbol,U+03D1 NEW --> - {"upsih", "978"}, // greek upsilon with hook symbol,U+03D2 NEW --> - {"piv", "982"}, // greek pi symbol, U+03D6 ISOgrk3 --> - // - {"bull", "8226"}, // bullet = black small circle,U+2022 ISOpub --> - // - {"hellip", "8230"}, // horizontal ellipsis = three dot leader,U+2026 ISOpub --> - {"prime", "8242"}, // prime = minutes = feet, U+2032 ISOtech --> - {"Prime", "8243"}, // double prime = seconds = inches,U+2033 ISOtech --> - {"oline", "8254"}, // overline = spacing overscore,U+203E NEW --> - {"frasl", "8260"}, // fraction slash, U+2044 NEW --> - // - {"weierp", "8472"}, // script capital P = power set= Weierstrass p, U+2118 ISOamso --> - {"image", "8465"}, // blackletter capital I = imaginary part,U+2111 ISOamso --> - {"real", "8476"}, // blackletter capital R = real part symbol,U+211C ISOamso --> - {"trade", "8482"}, // trade mark sign, U+2122 ISOnum --> - {"alefsym", "8501"}, // alef symbol = first transfinite cardinal,U+2135 NEW --> - // - // - {"larr", "8592"}, // leftwards arrow, U+2190 ISOnum --> - {"uarr", "8593"}, // upwards arrow, U+2191 ISOnum--> - {"rarr", "8594"}, // rightwards arrow, U+2192 ISOnum --> - {"darr", "8595"}, // downwards arrow, U+2193 ISOnum --> - {"harr", "8596"}, // left right arrow, U+2194 ISOamsa --> - {"crarr", "8629"}, // downwards arrow with corner leftwards= carriage return, U+21B5 NEW --> - {"lArr", "8656"}, // leftwards double arrow, U+21D0 ISOtech --> - // - {"uArr", "8657"}, // upwards double arrow, U+21D1 ISOamsa --> - {"rArr", "8658"}, // rightwards double arrow,U+21D2 ISOtech --> - // - {"dArr", "8659"}, // downwards double arrow, U+21D3 ISOamsa --> - {"hArr", "8660"}, // left right double arrow,U+21D4 ISOamsa --> - // - {"forall", "8704"}, // for all, U+2200 ISOtech --> - {"part", "8706"}, // partial differential, U+2202 ISOtech --> - {"exist", "8707"}, // there exists, U+2203 ISOtech --> - {"empty", "8709"}, // empty set = null set = diameter,U+2205 ISOamso --> - {"nabla", "8711"}, // nabla = backward difference,U+2207 ISOtech --> - {"isin", "8712"}, // element of, U+2208 ISOtech --> - {"notin", "8713"}, // not an element of, U+2209 ISOtech --> - {"ni", "8715"}, // contains as member, U+220B ISOtech --> - // - {"prod", "8719"}, // n-ary product = product sign,U+220F ISOamsb --> - // - {"sum", "8721"}, // n-ary summation, U+2211 ISOamsb --> - // - {"minus", "8722"}, // minus sign, U+2212 ISOtech --> - {"lowast", "8727"}, // asterisk operator, U+2217 ISOtech --> - {"radic", "8730"}, // square root = radical sign,U+221A ISOtech --> - {"prop", "8733"}, // proportional to, U+221D ISOtech --> - {"infin", "8734"}, // infinity, U+221E ISOtech --> - {"ang", "8736"}, // angle, U+2220 ISOamso --> - {"and", "8743"}, // logical and = wedge, U+2227 ISOtech --> - {"or", "8744"}, // logical or = vee, U+2228 ISOtech --> - {"cap", "8745"}, // intersection = cap, U+2229 ISOtech --> - {"cup", "8746"}, // union = cup, U+222A ISOtech --> - {"int", "8747"}, // integral, U+222B ISOtech --> - {"there4", "8756"}, // therefore, U+2234 ISOtech --> - {"sim", "8764"}, // tilde operator = varies with = similar to,U+223C ISOtech --> - // - {"cong", "8773"}, // approximately equal to, U+2245 ISOtech --> - {"asymp", "8776"}, // almost equal to = asymptotic to,U+2248 ISOamsr --> - {"ne", "8800"}, // not equal to, U+2260 ISOtech --> - {"equiv", "8801"}, // identical to, U+2261 ISOtech --> - {"le", "8804"}, // less-than or equal to, U+2264 ISOtech --> - {"ge", "8805"}, // greater-than or equal to,U+2265 ISOtech --> - {"sub", "8834"}, // subset of, U+2282 ISOtech --> - {"sup", "8835"}, // superset of, U+2283 ISOtech --> - // - {"sube", "8838"}, // subset of or equal to, U+2286 ISOtech --> - {"supe", "8839"}, // superset of or equal to,U+2287 ISOtech --> - {"oplus", "8853"}, // circled plus = direct sum,U+2295 ISOamsb --> - {"otimes", "8855"}, // circled times = vector product,U+2297 ISOamsb --> - {"perp", "8869"}, // up tack = orthogonal to = perpendicular,U+22A5 ISOtech --> - {"sdot", "8901"}, // dot operator, U+22C5 ISOamsb --> - // - // - {"lceil", "8968"}, // left ceiling = apl upstile,U+2308 ISOamsc --> - {"rceil", "8969"}, // right ceiling, U+2309 ISOamsc --> - {"lfloor", "8970"}, // left floor = apl downstile,U+230A ISOamsc --> - {"rfloor", "8971"}, // right floor, U+230B ISOamsc --> - {"lang", "9001"}, // left-pointing angle bracket = bra,U+2329 ISOtech --> - // - {"rang", "9002"}, // right-pointing angle bracket = ket,U+232A ISOtech --> - // - // - {"loz", "9674"}, // lozenge, U+25CA ISOpub --> - // - {"spades", "9824"}, // black spade suit, U+2660 ISOpub --> - // - {"clubs", "9827"}, // black club suit = shamrock,U+2663 ISOpub --> - {"hearts", "9829"}, // black heart suit = valentine,U+2665 ISOpub --> - {"diams", "9830"}, // black diamond suit, U+2666 ISOpub --> - - // - {"OElig", "338"}, // -- latin capital ligature OE,U+0152 ISOlat2 --> - {"oelig", "339"}, // -- latin small ligature oe, U+0153 ISOlat2 --> - // - {"Scaron", "352"}, // -- latin capital letter S with caron,U+0160 ISOlat2 --> - {"scaron", "353"}, // -- latin small letter s with caron,U+0161 ISOlat2 --> - {"Yuml", "376"}, // -- latin capital letter Y with diaeresis,U+0178 ISOlat2 --> - // - {"circ", "710"}, // -- modifier letter circumflex accent,U+02C6 ISOpub --> - {"tilde", "732"}, // small tilde, U+02DC ISOdia --> - // - {"ensp", "8194"}, // en space, U+2002 ISOpub --> - {"emsp", "8195"}, // em space, U+2003 ISOpub --> - {"thinsp", "8201"}, // thin space, U+2009 ISOpub --> - {"zwnj", "8204"}, // zero width non-joiner,U+200C NEW RFC 2070 --> - {"zwj", "8205"}, // zero width joiner, U+200D NEW RFC 2070 --> - {"lrm", "8206"}, // left-to-right mark, U+200E NEW RFC 2070 --> - {"rlm", "8207"}, // right-to-left mark, U+200F NEW RFC 2070 --> - {"ndash", "8211"}, // en dash, U+2013 ISOpub --> - {"mdash", "8212"}, // em dash, U+2014 ISOpub --> - {"lsquo", "8216"}, // left single quotation mark,U+2018 ISOnum --> - {"rsquo", "8217"}, // right single quotation mark,U+2019 ISOnum --> - {"sbquo", "8218"}, // single low-9 quotation mark, U+201A NEW --> - {"ldquo", "8220"}, // left double quotation mark,U+201C ISOnum --> - {"rdquo", "8221"}, // right double quotation mark,U+201D ISOnum --> - {"bdquo", "8222"}, // double low-9 quotation mark, U+201E NEW --> - {"dagger", "8224"}, // dagger, U+2020 ISOpub --> - {"Dagger", "8225"}, // double dagger, U+2021 ISOpub --> - {"permil", "8240"}, // per mille sign, U+2030 ISOtech --> - {"lsaquo", "8249"}, // single left-pointing angle quotation mark,U+2039 ISO proposed --> - // - {"rsaquo", "8250"}, // single right-pointing angle quotation mark,U+203A ISO proposed --> - // - {"euro", "8364"}, // -- euro sign, U+20AC NEW --> - }; - - /** - *

- * The set of entities supported by standard XML. - *

- */ - public static final Entities XML; - - /** - *

- * The set of entities supported by HTML 3.2. - *

- */ - public static final Entities HTML32; - - /** - *

- * The set of entities supported by HTML 4.0. - *

- */ - public static final Entities HTML40; - - static { - XML = new Entities(); - XML.addEntities(BASIC_ARRAY); - XML.addEntities(APOS_ARRAY); - } - - static { - HTML32 = new Entities(); - HTML32.addEntities(BASIC_ARRAY); - HTML32.addEntities(ISO8859_1_ARRAY); - } - - static { - HTML40 = new Entities(); - fillWithHtml40Entities(HTML40); - } - - /** - *

- * Fills the specified entities instance with HTML 40 entities. - *

- * - * @param entities - * the instance to be filled. - */ - static void fillWithHtml40Entities(Entities entities) { - entities.addEntities(BASIC_ARRAY); - entities.addEntities(ISO8859_1_ARRAY); - entities.addEntities(HTML40_ARRAY); - } - - static interface EntityMap { - /** - *

- * Add an entry to this entity map. - *

- * - * @param name - * the entity name - * @param value - * the entity value - */ - void add(String name, int value); - - /** - *

- * Returns the name of the entity identified by the specified value. - *

- * - * @param value - * the value to locate - * @return entity name associated with the specified value - */ - String name(int value); - - /** - *

- * Returns the value of the entity identified by the specified name. - *

- * - * @param name - * the name to locate - * @return entity value associated with the specified name - */ - int value(String name); - } - - static class PrimitiveEntityMap implements EntityMap { - private final Map mapNameToValue = new HashMap(); - - private final IntHashMap mapValueToName = new IntHashMap(); - - /** - * {@inheritDoc} - */ - @Override - public void add(String name, int value) { - mapNameToValue.put(name, new Integer(value)); - mapValueToName.put(value, name); - } - - /** - * {@inheritDoc} - */ - @Override - public String name(int value) { - return (String) mapValueToName.get(value); - } - - /** - * {@inheritDoc} - */ - @Override - public int value(String name) { - Object value = mapNameToValue.get(name); - if (value == null) { - return -1; - } - return ((Integer) value).intValue(); - } - } - - static abstract class MapIntMap implements Entities.EntityMap { - protected Map mapNameToValue; - - protected Map mapValueToName; - - /** - * {@inheritDoc} - */ - @Override - public void add(String name, int value) { - mapNameToValue.put(name, new Integer(value)); - mapValueToName.put(new Integer(value), name); - } - - /** - * {@inheritDoc} - */ - @Override - public String name(int value) { - return (String) mapValueToName.get(new Integer(value)); - } - - /** - * {@inheritDoc} - */ - @Override - public int value(String name) { - Object value = mapNameToValue.get(name); - if (value == null) { - return -1; - } - return ((Integer) value).intValue(); - } - } - - static class HashEntityMap extends MapIntMap { - /** - * Constructs a new instance of HashEntityMap. - */ - public HashEntityMap() { - mapNameToValue = new HashMap(); - mapValueToName = new HashMap(); - } - } - - static class TreeEntityMap extends MapIntMap { - /** - * Constructs a new instance of TreeEntityMap. - */ - public TreeEntityMap() { - mapNameToValue = new TreeMap(); - mapValueToName = new TreeMap(); - } - } - - static class LookupEntityMap extends PrimitiveEntityMap { - private String[] lookupTable; - - private final int LOOKUP_TABLE_SIZE = 256; - - /** - * {@inheritDoc} - */ - @Override - public String name(int value) { - if (value < LOOKUP_TABLE_SIZE) { - return lookupTable()[value]; - } - return super.name(value); - } - - /** - *

- * Returns the lookup table for this entity map. The lookup table is created if it has not been previously. - *

- * - * @return the lookup table - */ - private String[] lookupTable() { - if (lookupTable == null) { - createLookupTable(); - } - return lookupTable; - } - - /** - *

- * Creates an entity lookup table of LOOKUP_TABLE_SIZE elements, initialized with entity names. - *

- */ - private void createLookupTable() { - lookupTable = new String[LOOKUP_TABLE_SIZE]; - for (int i = 0; i < LOOKUP_TABLE_SIZE; ++i) { - lookupTable[i] = super.name(i); - } - } - } - - static class ArrayEntityMap implements EntityMap { - protected int growBy = 100; - - protected int size = 0; - - protected String[] names; - - protected int[] values; - - /** - * Constructs a new instance of ArrayEntityMap. - */ - public ArrayEntityMap() { - names = new String[growBy]; - values = new int[growBy]; - } - - /** - * Constructs a new instance of ArrayEntityMap specifying the size by which the array should - * grow. - * - * @param growBy - * array will be initialized to and will grow by this amount - */ - public ArrayEntityMap(int growBy) { - this.growBy = growBy; - names = new String[growBy]; - values = new int[growBy]; - } - - /** - * {@inheritDoc} - */ - @Override - public void add(String name, int value) { - ensureCapacity(size + 1); - names[size] = name; - values[size] = value; - size++; - } - - /** - * Verifies the capacity of the entity array, adjusting the size if necessary. - * - * @param capacity - * size the array should be - */ - protected void ensureCapacity(int capacity) { - if (capacity > names.length) { - int newSize = Math.max(capacity, size + growBy); - String[] newNames = new String[newSize]; - System.arraycopy(names, 0, newNames, 0, size); - names = newNames; - int[] newValues = new int[newSize]; - System.arraycopy(values, 0, newValues, 0, size); - values = newValues; - } - } - - /** - * {@inheritDoc} - */ - @Override - public String name(int value) { - for (int i = 0; i < size; ++i) { - if (values[i] == value) { - return names[i]; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public int value(String name) { - for (int i = 0; i < size; ++i) { - if (names[i].equals(name)) { - return values[i]; - } - } - return -1; - } - } - - static class BinaryEntityMap extends ArrayEntityMap { - - /** - * Constructs a new instance of BinaryEntityMap. - */ - public BinaryEntityMap() { - super(); - } - - /** - * Constructs a new instance of ArrayEntityMap specifying the size by which the underlying array - * should grow. - * - * @param growBy - * array will be initialized to and will grow by this amount - */ - public BinaryEntityMap(int growBy) { - super(growBy); - } - - /** - * Performs a binary search of the entity array for the specified key. This method is based on code in - * {@link java.util.Arrays}. - * - * @param key - * the key to be found - * @return the index of the entity array matching the specified key - */ - private int binarySearch(int key) { - int low = 0; - int high = size - 1; - - while (low <= high) { - int mid = (low + high) >> 1; - int midVal = values[mid]; - - if (midVal < key) { - low = mid + 1; - } else if (midVal > key) { - high = mid - 1; - } else { - return mid; // key found - } - } - return -(low + 1); // key not found. - } - - /** - * {@inheritDoc} - */ - @Override - public void add(String name, int value) { - ensureCapacity(size + 1); - int insertAt = binarySearch(value); - if (insertAt > 0) { - return; // note: this means you can't insert the same value twice - } - insertAt = -(insertAt + 1); // binarySearch returns it negative and off-by-one - System.arraycopy(values, insertAt, values, insertAt + 1, size - insertAt); - values[insertAt] = value; - System.arraycopy(names, insertAt, names, insertAt + 1, size - insertAt); - names[insertAt] = name; - size++; - } - - /** - * {@inheritDoc} - */ - @Override - public String name(int value) { - int index = binarySearch(value); - if (index < 0) { - return null; - } - return names[index]; - } - } - - // package scoped for testing - EntityMap map = new Entities.LookupEntityMap(); - - /** - *

- * Adds entities to this entity. - *

- * - * @param entityArray - * array of entities to be added - */ - public void addEntities(String[][] entityArray) { - for (int i = 0; i < entityArray.length; ++i) { - addEntity(entityArray[i][0], Integer.parseInt(entityArray[i][1])); - } - } - - /** - *

- * Add an entity to this entity. - *

- * - * @param name - * name of the entity - * @param value - * vale of the entity - */ - public void addEntity(String name, int value) { - map.add(name, value); - } - - /** - *

- * Returns the name of the entity identified by the specified value. - *

- * - * @param value - * the value to locate - * @return entity name associated with the specified value - */ - public String entityName(int value) { - return map.name(value); - } - - /** - *

- * Returns the value of the entity identified by the specified name. - *

- * - * @param name - * the name to locate - * @return entity value associated with the specified name - */ - public int entityValue(String name) { - return map.value(name); - } - - /** - *

- * Escapes the characters in a String. - *

- * - *

- * For example, if you have called addEntity("foo", 0xA1), escape("\u00A1") will return - * "&foo;" - *

- * - * @param str - * The String to escape. - * @return A new escaped String. - */ - public String escape(String str) { - StringWriter stringWriter = createStringWriter(str); - try { - this.escape(stringWriter, str); - } catch (IOException e) { - // This should never happen because ALL the StringWriter methods called by #escape(Writer, String) do not - // throw IOExceptions. - throw new RuntimeException(e); - } - return stringWriter.toString(); - } - - /** - *

- * Escapes the characters in the String passed and writes the result to the Writer - * passed. - *

- * - * @param writer - * The Writer to write the results of the escaping to. Assumed to be a non-null value. - * @param str - * The String to escape. Assumed to be a non-null value. - * @throws IOException - * when Writer passed throws the exception from calls to the {@link Writer#write(int)} - * methods. - * - * @see #escape(String) - * @see Writer - */ - public void escape(Writer writer, String str) throws IOException { - int len = str.length(); - for (int i = 0; i < len; i++) { - char c = str.charAt(i); - String entityName = this.entityName(c); - if (entityName == null) { - if (c > 0x7F) { - writer.write("&#"); - writer.write(Integer.toString(c, 10)); - writer.write(';'); - } else { - writer.write(c); - } - } else { - writer.write('&'); - writer.write(entityName); - writer.write(';'); - } - } - } - - /** - *

- * Unescapes the entities in a String. - *

- * - *

- * For example, if you have called addEntity("foo", 0xA1), unescape("&foo;") will return - * "\u00A1" - *

- * - * @param str - * The String to escape. - * @return A new escaped String. - */ - public String unescape(String str) { - int firstAmp = str.indexOf('&'); - if (firstAmp < 0) { - return str; - } else { - StringWriter stringWriter = createStringWriter(str); - try { - this.doUnescape(stringWriter, str, firstAmp); - } catch (IOException e) { - // This should never happen because ALL the StringWriter methods called by #escape(Writer, String) - // do not throw IOExceptions. - throw new RuntimeException(e); - } - return stringWriter.toString(); - } - } - - /** - * Make the StringWriter 10% larger than the source String to avoid growing the writer - * - * @param str The source string - * @return A newly created StringWriter - */ - private StringWriter createStringWriter(String str) { - return new StringWriter((int) (str.length() + (str.length() * 0.1))); - } - - /** - *

- * Unescapes the escaped entities in the String passed and writes the result to the - * Writer passed. - *

- * - * @param writer - * The Writer to write the results to; assumed to be non-null. - * @param str - * The source String to unescape; assumed to be non-null. - * @throws IOException - * when Writer passed throws the exception from calls to the {@link Writer#write(int)} - * methods. - * - * @see #escape(String) - * @see Writer - */ - public void unescape(Writer writer, String str) throws IOException { - int firstAmp = str.indexOf('&'); - if (firstAmp < 0) { - writer.write(str); - return; - } else { - doUnescape(writer, str, firstAmp); - } - } - - /** - * Underlying unescape method that allows the optimisation of not starting from the 0 index again. - * - * @param writer - * The Writer to write the results to; assumed to be non-null. - * @param str - * The source String to unescape; assumed to be non-null. - * @param firstAmp - * The int index of the first ampersand in the source String. - * @throws IOException - * when Writer passed throws the exception from calls to the {@link Writer#write(int)} - * methods. - */ - private void doUnescape(Writer writer, String str, int firstAmp) throws IOException { - writer.write(str, 0, firstAmp); - int len = str.length(); - for (int i = firstAmp; i < len; i++) { - char c = str.charAt(i); - if (c == '&') { - int nextIdx = i + 1; - int semiColonIdx = str.indexOf(';', nextIdx); - if (semiColonIdx == -1) { - writer.write(c); - continue; - } - int amphersandIdx = str.indexOf('&', i + 1); - if (amphersandIdx != -1 && amphersandIdx < semiColonIdx) { - // Then the text looks like &...&...; - writer.write(c); - continue; - } - String entityContent = str.substring(nextIdx, semiColonIdx); - int entityValue = -1; - int entityContentLen = entityContent.length(); - if (entityContentLen > 0) { - if (entityContent.charAt(0) == '#') { // escaped value content is an integer (decimal or - // hexidecimal) - if (entityContentLen > 1) { - char isHexChar = entityContent.charAt(1); - try { - switch (isHexChar) { - case 'X' : - case 'x' : { - entityValue = Integer.parseInt(entityContent.substring(2), 16); - break; - } - default : { - entityValue = Integer.parseInt(entityContent.substring(1), 10); - } - } - if (entityValue > 0xFFFF) { - entityValue = -1; - } - } catch (NumberFormatException e) { - entityValue = -1; - } - } - } else { // escaped value content is an entity name - entityValue = this.entityValue(entityContent); - } - } - - if (entityValue == -1) { - writer.write('&'); - writer.write(entityContent); - writer.write(';'); - } else { - writer.write(entityValue); - } - i = semiColonIdx; // move index up to the semi-colon - } else { - writer.write(c); - } - } - } - - /** - *

A hash map that uses primitive ints for the key rather than objects.

- * - *

Note that this class is for internal optimization purposes only, and may - * not be supported in future releases of Jakarta Commons Lang. Utilities of - * this sort may be included in future releases of Jakarta Commons Collections.

- * - * @author Justin Couch - * @author Alex Chaffee (alex@apache.org) - * @author Stephen Colebourne - * @since 2.0 - * @version $Revision: 2696 $ - * @see java.util.HashMap - */ - static class IntHashMap { - - /** - * The hash table data. - */ - private transient Entry table[]; - - /** - * The total number of entries in the hash table. - */ - private transient int count; - - /** - * The table is rehashed when its size exceeds this threshold. (The - * value of this field is (int)(capacity * loadFactor).) - * - * @serial - */ - private int threshold; - - /** - * The load factor for the hashtable. - * - * @serial - */ - private final float loadFactor; - - /** - *

Innerclass that acts as a datastructure to create a new entry in the - * table.

- */ - private static class Entry { - int hash; - int key; - Object value; - Entry next; - - /** - *

Create a new entry with the given values.

- * - * @param hash The code used to hash the object with - * @param key The key used to enter this in the table - * @param value The value for this key - * @param next A reference to the next entry in the table - */ - protected Entry(int hash, int key, Object value, Entry next) { - this.hash = hash; - this.key = key; - this.value = value; - this.next = next; - } - } - - /** - *

Constructs a new, empty hashtable with a default capacity and load - * factor, which is 20 and 0.75 respectively.

- */ - public IntHashMap() { - this(20, 0.75f); - } - - /** - *

Constructs a new, empty hashtable with the specified initial capacity - * and default load factor, which is 0.75.

- * - * @param initialCapacity the initial capacity of the hashtable. - * @throws IllegalArgumentException if the initial capacity is less - * than zero. - */ - public IntHashMap(int initialCapacity) { - this(initialCapacity, 0.75f); - } - - /** - *

Constructs a new, empty hashtable with the specified initial - * capacity and the specified load factor.

- * - * @param initialCapacity the initial capacity of the hashtable. - * @param loadFactor the load factor of the hashtable. - * @throws IllegalArgumentException if the initial capacity is less - * than zero, or if the load factor is nonpositive. - */ - public IntHashMap(int initialCapacity, float loadFactor) { - super(); - if (initialCapacity < 0) { - throw new IllegalArgumentException("Illegal Capacity: " + initialCapacity); - } - if (loadFactor <= 0) { - throw new IllegalArgumentException("Illegal Load: " + loadFactor); - } - if (initialCapacity == 0) { - initialCapacity = 1; - } - - this.loadFactor = loadFactor; - table = new Entry[initialCapacity]; - threshold = (int) (initialCapacity * loadFactor); - } - - /** - *

Returns the number of keys in this hashtable.

- * - * @return the number of keys in this hashtable. - */ - public int size() { - return count; - } - - /** - *

Tests if this hashtable maps no keys to values.

- * - * @return true if this hashtable maps no keys to values; - * false otherwise. - */ - public boolean isEmpty() { - return count == 0; - } - - /** - *

Tests if some key maps into the specified value in this hashtable. - * This operation is more expensive than the containsKey - * method.

- * - *

Note that this method is identical in functionality to containsValue, - * (which is part of the Map interface in the collections framework).

- * - * @param value a value to search for. - * @return true if and only if some key maps to the - * value argument in this hashtable as - * determined by the equals method; - * false otherwise. - * @throws NullPointerException if the value is null. - * @see #containsKey(int) - * @see #containsValue(Object) - * @see java.util.Map - */ - public boolean contains(Object value) { - if (value == null) { - throw new NullPointerException(); - } - - Entry tab[] = table; - for (int i = tab.length; i-- > 0;) { - for (Entry e = tab[i]; e != null; e = e.next) { - if (e.value.equals(value)) { - return true; - } - } - } - return false; - } - - /** - *

Returns true if this HashMap maps one or more keys - * to this value.

- * - *

Note that this method is identical in functionality to contains - * (which predates the Map interface).

- * - * @param value value whose presence in this HashMap is to be tested. - * @return boolean true if the value is contained - * @see java.util.Map - * @since JDK1.2 - */ - public boolean containsValue(Object value) { - return contains(value); - } - - /** - *

Tests if the specified object is a key in this hashtable.

- * - * @param key possible key. - * @return true if and only if the specified object is a - * key in this hashtable, as determined by the equals - * method; false otherwise. - * @see #contains(Object) - */ - public boolean containsKey(int key) { - Entry tab[] = table; - int hash = key; - int index = (hash & 0x7FFFFFFF) % tab.length; - for (Entry e = tab[index]; e != null; e = e.next) { - if (e.hash == hash) { - return true; - } - } - return false; - } - - /** - *

Returns the value to which the specified key is mapped in this map.

- * - * @param key a key in the hashtable. - * @return the value to which the key is mapped in this hashtable; - * null if the key is not mapped to any value in - * this hashtable. - * @see #put(int, Object) - */ - public Object get(int key) { - Entry tab[] = table; - int hash = key; - int index = (hash & 0x7FFFFFFF) % tab.length; - for (Entry e = tab[index]; e != null; e = e.next) { - if (e.hash == hash) { - return e.value; - } - } - return null; - } - - /** - *

Increases the capacity of and internally reorganizes this - * hashtable, in order to accommodate and access its entries more - * efficiently.

- * - *

This method is called automatically when the number of keys - * in the hashtable exceeds this hashtable's capacity and load - * factor.

- */ - protected void rehash() { - int oldCapacity = table.length; - Entry oldMap[] = table; - - int newCapacity = oldCapacity * 2 + 1; - Entry newMap[] = new Entry[newCapacity]; - - threshold = (int) (newCapacity * loadFactor); - table = newMap; - - for (int i = oldCapacity; i-- > 0;) { - for (Entry old = oldMap[i]; old != null;) { - Entry e = old; - old = old.next; - - int index = (e.hash & 0x7FFFFFFF) % newCapacity; - e.next = newMap[index]; - newMap[index] = e; - } - } - } - - /** - *

Maps the specified key to the specified - * value in this hashtable. The key cannot be - * null.

- * - *

The value can be retrieved by calling the get method - * with a key that is equal to the original key.

- * - * @param key the hashtable key. - * @param value the value. - * @return the previous value of the specified key in this hashtable, - * or null if it did not have one. - * @throws NullPointerException if the key is null. - * @see #get(int) - */ - public Object put(int key, Object value) { - // Makes sure the key is not already in the hashtable. - Entry tab[] = table; - int hash = key; - int index = (hash & 0x7FFFFFFF) % tab.length; - for (Entry e = tab[index]; e != null; e = e.next) { - if (e.hash == hash) { - Object old = e.value; - e.value = value; - return old; - } - } - - if (count >= threshold) { - // Rehash the table if the threshold is exceeded - rehash(); - - tab = table; - index = (hash & 0x7FFFFFFF) % tab.length; - } - - // Creates the new entry. - Entry e = new Entry(hash, key, value, tab[index]); - tab[index] = e; - count++; - return null; - } - - /** - *

Removes the key (and its corresponding value) from this - * hashtable.

- * - *

This method does nothing if the key is not present in the - * hashtable.

- * - * @param key the key that needs to be removed. - * @return the value to which the key had been mapped in this hashtable, - * or null if the key did not have a mapping. - */ - public Object remove(int key) { - Entry tab[] = table; - int hash = key; - int index = (hash & 0x7FFFFFFF) % tab.length; - for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.next) { - if (e.hash == hash) { - if (prev != null) { - prev.next = e.next; - } else { - tab[index] = e.next; - } - count--; - Object oldValue = e.value; - e.value = null; - return oldValue; - } - } - return null; - } - - /** - *

Clears this hashtable so that it contains no keys.

- */ - public synchronized void clear() { - Entry tab[] = table; - for (int index = tab.length; --index >= 0;) { - tab[index] = null; - } - count = 0; - } - } -} diff --git a/astrid/src/main/java/com/todoroo/astrid/utility/SyncMetadataService.java b/astrid/src/main/java/com/todoroo/astrid/utility/SyncMetadataService.java index cbe61f0e9..c12cfd9ff 100644 --- a/astrid/src/main/java/com/todoroo/astrid/utility/SyncMetadataService.java +++ b/astrid/src/main/java/com/todoroo/astrid/utility/SyncMetadataService.java @@ -83,8 +83,6 @@ abstract public class SyncMetadataService { /** * Gets tasks that were created since last sync - * @param properties - * @return */ public TodorooCursor getLocallyCreated(Property... properties) { TodorooCursor tasks = taskDao.query(Query.select(Task.ID).where( @@ -95,7 +93,6 @@ abstract public class SyncMetadataService { /** * Gets tasks that were modified since last sync - * @param properties * @return null if never sync'd */ public TodorooCursor getLocallyUpdated(Property... properties) { @@ -112,10 +109,6 @@ abstract public class SyncMetadataService { return joinWithMetadata(tasks, true, properties); } - /** - * @param tasks - * @param lastSyncDate - */ protected TodorooCursor filterLocallyUpdated(TodorooCursor tasks, long lastSyncDate) { // override hook return tasks; @@ -142,9 +135,6 @@ abstract public class SyncMetadataService { /** * Join rows from two cursors on the first column, assuming its an id column - * @param left - * @param right - * @param matchingRows * @param both - if false, returns rows no right row exists, if true, * returns rows where both exist */ @@ -182,7 +172,6 @@ abstract public class SyncMetadataService { /** * Searches for a local task with same remote id, updates this task's id - * @param remoteTask */ public void findLocalMatch(TYPE remoteTask) { if(remoteTask.task.getId() != Task.NO_ID) { @@ -204,7 +193,6 @@ abstract public class SyncMetadataService { /** * Saves a task and its metadata - * @param task */ public void saveTaskAndMetadata(TYPE task) { task.prepareForSaving(); @@ -215,8 +203,6 @@ abstract public class SyncMetadataService { /** * Reads a task and its metadata - * @param task - * @return */ public TYPE readTaskAndMetadata(TodorooCursor taskCursor) { Task task = new Task(taskCursor); diff --git a/astrid/src/main/java/com/todoroo/astrid/voice/VoiceInputAssistant.java b/astrid/src/main/java/com/todoroo/astrid/voice/VoiceInputAssistant.java index 77a1a55dd..204e94e55 100644 --- a/astrid/src/main/java/com/todoroo/astrid/voice/VoiceInputAssistant.java +++ b/astrid/src/main/java/com/todoroo/astrid/voice/VoiceInputAssistant.java @@ -98,9 +98,7 @@ public class VoiceInputAssistant { * Creates a new VoiceInputAssistance-instance for use with a specified button and textfield. * If you need more than one microphone-button on a given fragment, use the other constructor. * - * @param fragment the fragment which holds the microphone-buttone and the textField to insert recognized test * @param voiceButton the microphone-Button - * @param textField the textfield that should get the resulttext */ public VoiceInputAssistant(ImageButton voiceButton) { Assert.assertNotNull("A VoiceInputAssistant without a voiceButton makes no sense!", voiceButton); @@ -116,9 +114,6 @@ public class VoiceInputAssistant { * you can leave it to its default, VOICE_RECOGNITION_REQUEST_CODE. * * - * @param fragment - * @param voiceButton - * @param textField * @param requestCode has to be unique in a single fragment-context, * dont use VOICE_RECOGNITION_REQUEST_CODE, this is reserved for the other constructor */ @@ -136,7 +131,6 @@ public class VoiceInputAssistant { * * @param activity the activity which holds the microphone-buttone and the textField to insert recognized test * @param voiceButton the microphone-Button - * @param textField the textfield that should get the resulttext */ public VoiceInputAssistant(Activity activity, ImageButton voiceButton) { Assert.assertNotNull("Each VoiceInputAssistant must be bound to a activity!", activity); @@ -154,9 +148,6 @@ public class VoiceInputAssistant { * you can leave it to its default, VOICE_RECOGNITION_REQUEST_CODE. * * - * @param activity - * @param voiceButton - * @param textField * @param requestCode has to be unique in a single fragment-context, * dont use VOICE_RECOGNITION_REQUEST_CODE, this is reserved for the other constructor */ @@ -200,9 +191,6 @@ public class VoiceInputAssistant { * these other requests as you need. * * @param activityRequestCode if this equals the requestCode specified by constructor, then results of voice-recognition - * @param resultCode - * @param data - * @return */ public boolean handleActivityResult(int activityRequestCode, int resultCode, Intent data, EditText textField) { boolean result = false; @@ -238,10 +226,6 @@ public class VoiceInputAssistant { * Can also be called from Fragment.onActivityResult to simply get the string result * of the speech to text, or null if it couldn't be processed. Convenient when you * don't have a bunch of UI elements to hook into. - * @param activityRequestCode - * @param resultCode - * @param data - * @return */ public String getActivityResult(int activityRequestCode, int resultCode, Intent data) { if (activityRequestCode == this.requestCode) { diff --git a/astrid/src/main/java/com/todoroo/astrid/widget/TasksWidget.java b/astrid/src/main/java/com/todoroo/astrid/widget/TasksWidget.java index 8ab845202..e25835379 100644 --- a/astrid/src/main/java/com/todoroo/astrid/widget/TasksWidget.java +++ b/astrid/src/main/java/com/todoroo/astrid/widget/TasksWidget.java @@ -17,11 +17,8 @@ import android.content.SharedPreferences; import android.content.res.Resources; import android.os.Bundle; import android.os.IBinder; -import android.util.DisplayMetrics; import android.util.Log; -import android.view.Display; import android.view.View; -import android.view.WindowManager; import android.widget.RemoteViews; import org.tasks.R; @@ -82,7 +79,6 @@ public class TasksWidget extends AppWidgetProvider { /** * Update all widgets - * @param id */ public static void updateWidgets(Context context) { if (suppressUpdateFlag > 0 && DateUtilities.now() - suppressUpdateFlag < SUPPRESS_TIME) { @@ -95,7 +91,6 @@ public class TasksWidget extends AppWidgetProvider { /** * Update widget with the given id - * @param id */ public static void updateWidget(Context context, int id) { Intent intent = new Intent(ContextManager.getContext(), @@ -322,8 +317,6 @@ public class TasksWidget extends AppWidgetProvider { * Android 2.1 (level 7) that doesn't allow setting backgrounds on remote views. I know it's lame, * but I didn't see a better solution. Alternatively, we could disallow theming widgets on * Android 2.1. - * @param context - * @return */ private RemoteViews getThemedRemoteViews(Context context) { int theme = ThemeService.getWidgetTheme(); diff --git a/astrid/src/main/java/com/todoroo/astrid/widget/WidgetConfigActivity.java b/astrid/src/main/java/com/todoroo/astrid/widget/WidgetConfigActivity.java index 93f9230d4..a0d770742 100644 --- a/astrid/src/main/java/com/todoroo/astrid/widget/WidgetConfigActivity.java +++ b/astrid/src/main/java/com/todoroo/astrid/widget/WidgetConfigActivity.java @@ -15,16 +15,16 @@ import android.view.View; import android.widget.Button; import android.widget.ListView; -import org.tasks.R; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.Preferences; import com.todoroo.astrid.adapter.FilterAdapter; import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.api.FilterListItem; import com.todoroo.astrid.api.FilterWithCustomIntent; -import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.service.ThemeService; +import org.tasks.R; + abstract public class WidgetConfigActivity extends ListActivity { static final String PREF_TITLE = "widget-title-"; @@ -119,11 +119,6 @@ abstract public class WidgetConfigActivity extends ListActivity { adapter.unregisterRecevier(); } - @Override - protected void onStart() { - super.onStart(); - } - @Override protected void onStop() { super.onStop(); diff --git a/astrid/src/main/java/edu/mit/mobile/android/imagecache/DiskCache.java b/astrid/src/main/java/edu/mit/mobile/android/imagecache/DiskCache.java index ba53687c5..78624001e 100644 --- a/astrid/src/main/java/edu/mit/mobile/android/imagecache/DiskCache.java +++ b/astrid/src/main/java/edu/mit/mobile/android/imagecache/DiskCache.java @@ -116,8 +116,6 @@ public abstract class DiskCache { /** * Creates a new disk cache with no cachePrefix or cacheSuffix - * - * @param cacheBase */ public DiskCache(File cacheBase) { this(cacheBase, null, null); @@ -219,9 +217,6 @@ public abstract class DiskCache { /** * Gets the cache filename for the given key. - * - * @param key - * @return */ protected File getFile(K key) { return new File(mCacheBase, (mCachePrefix != null ? mCachePrefix : "") + hash(key) @@ -255,9 +250,6 @@ public abstract class DiskCache { * Writes the contents of the InputStream straight to disk. It is the caller's responsibility to * ensure it's the same type as what would be written with * {@link #toDisk(Object, Object, OutputStream)} - * - * @param key - * @param value * @throws IOException * @throws FileNotFoundException */ @@ -299,8 +291,6 @@ public abstract class DiskCache { /** * Puts the key at the end of the queue, removing it if it's already present. This will cause it * to be removed last when {@link #trim()} is called. - * - * @param cacheFile */ private void touchEntry(File cacheFile) { if (mQueue.contains(cacheFile)) { @@ -312,8 +302,6 @@ public abstract class DiskCache { /** * Marks the given key as accessed recently. This will deprioritize it from automatically being * purged upon {@link #trim()}. - * - * @param key */ protected void touchKey(K key) { touchEntry(getFile(key)); @@ -346,9 +334,6 @@ public abstract class DiskCache { /** * Reads from an inputstream, dumps to an outputstream - * - * @param is - * @param os * @throws IOException */ static public void inputStreamToOutputStream(InputStream is, OutputStream os) @@ -365,7 +350,6 @@ public abstract class DiskCache { /** * Reads the value from disk using {@link #fromDisk(Object, InputStream)}. * - * @param key * @return The value for key or null if the key doesn't map to any existing entries. */ public final synchronized V get(K key) throws IOException { @@ -387,7 +371,6 @@ public abstract class DiskCache { /** * Checks the disk cache for a given key. * - * @param key * @return true if the disk cache contains the given key */ public final synchronized boolean contains(K key) { @@ -399,7 +382,6 @@ public abstract class DiskCache { /** * Removes the item from the disk cache. * - * @param key * @return true if the cached item has been removed or was already removed, false if it was not * able to be removed. */ @@ -423,7 +405,6 @@ public abstract class DiskCache { /** * Removes the item from the disk cache. * - * @param cacheFile * @return true if the cached item has been removed or was already removed, false if it was not * able to be removed. */ @@ -588,18 +569,11 @@ public abstract class DiskCache { /** * Implement this to do the actual disk writing. Do not close the OutputStream; it will be * closed for you. - * - * @param key - * @param in - * @param out */ protected abstract void toDisk(K key, V in, OutputStream out); /** * Implement this to do the actual disk reading. - * - * @param key - * @param in * @return a new instance of {@link V} containing the contents of in. */ protected abstract V fromDisk(K key, InputStream in); @@ -608,7 +582,6 @@ public abstract class DiskCache { * Using the key's {@link Object#toString() toString()} method, generates a string suitable for * using as a filename. * - * @param key * @return a string uniquely representing the the key. */ public String hash(K key) { diff --git a/astrid/src/main/java/edu/mit/mobile/android/imagecache/ImageCache.java b/astrid/src/main/java/edu/mit/mobile/android/imagecache/ImageCache.java index 6a66e4a78..df7f45596 100644 --- a/astrid/src/main/java/edu/mit/mobile/android/imagecache/ImageCache.java +++ b/astrid/src/main/java/edu/mit/mobile/android/imagecache/ImageCache.java @@ -51,7 +51,6 @@ import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; import org.apache.http.params.CoreConnectionPNames; import org.apache.http.params.HttpParams; -import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.res.Resources; @@ -151,7 +150,6 @@ public class ImageCache extends DiskCache { /** * Gets an instance of the cache. * - * @param context * @return an instance of the cache */ public static ImageCache getInstance(Context context) { @@ -164,10 +162,6 @@ public class ImageCache extends DiskCache { /** * Generally, it's best to use the shared image cache using {@link #getInstance(Context)}. Use * this if you want to customize a cache or keep it separate. - * - * @param context - * @param format - * @param quality */ public ImageCache(Context context, CompressFormat format, int quality) { super(context.getCacheDir(), null, getExtension(format)); @@ -185,8 +179,6 @@ public class ImageCache extends DiskCache { /** * Sets the compression format for resized images. - * - * @param format */ public void setCompressFormat(CompressFormat format) { mCompressFormat = format; @@ -196,8 +188,6 @@ public class ImageCache extends DiskCache { * Set the image quality. Hint to the compressor, 0-100. 0 meaning compress for small size, 100 * meaning compress for max quality. Some formats, like PNG which is lossless, will ignore the * quality setting - * - * @param quality */ public void setQuality(int quality) { mQuality = quality; @@ -331,8 +321,6 @@ public class ImageCache extends DiskCache { *

* This should probably be called from {@link Activity#onResume()}. *

- * - * @param onImageLoadListener */ public void registerOnImageLoadListener(OnImageLoadListener onImageLoadListener) { mImageLoadListeners.add(onImageLoadListener); @@ -346,8 +334,6 @@ public class ImageCache extends DiskCache { *

* This should probably be called from {@link Activity#onPause()}. *

- * - * @param onImageLoadListener */ public void unregisterOnImageLoadListener(OnImageLoadListener onImageLoadListener) { mImageLoadListeners.remove(onImageLoadListener); @@ -399,7 +385,6 @@ public class ImageCache extends DiskCache { * * @param key * a key generated by {@link #getKey(Uri)} or {@link #getKey(Uri, int, int)} - * @param drawable */ public void putDrawable(String key, Drawable drawable) { mMemCache.put(key, drawable); @@ -410,10 +395,6 @@ public class ImageCache extends DiskCache { * Otherwise it will download, scale, and cache the image before returning it. For non-blocking * use, see {@link #loadImage(int, Uri, int, int)} * - * @param uri - * @param width - * @param height - * @return * @throws ClientProtocolException * @throws IOException * @throws ImageCacheException @@ -611,11 +592,6 @@ public class ImageCache extends DiskCache { /** * Deprecated to make IDs ints instead of longs. See {@link #loadImage(int, Uri, int, int)}. * - * @param id - * @param image - * @param width - * @param height - * @return * @throws IOException */ @Deprecated @@ -651,11 +627,6 @@ public class ImageCache extends DiskCache { /** * Deprecated in favour of {@link #scheduleLoadImage(int, Uri, int, int)}. - * - * @param id - * @param image - * @param width - * @param height */ @Deprecated public void scheduleLoadImage(long id, Uri image, int width, int height) { @@ -686,8 +657,6 @@ public class ImageCache extends DiskCache { /** * Deprecated in favour of {@link #cancel(int)}. - * - * @param id */ @Deprecated public void cancel(long id) { @@ -765,7 +734,6 @@ public class ImageCache extends DiskCache { * * @param uri * the location of the image - * @return a decoded bitmap * @throws ClientProtocolException * if the HTTP response code wasn't 200 or any other HTTP errors * @throws IOException diff --git a/astrid/src/main/java/edu/mit/mobile/android/imagecache/KeyedLock.java b/astrid/src/main/java/edu/mit/mobile/android/imagecache/KeyedLock.java index 9ccdc19b9..434cf6d04 100644 --- a/astrid/src/main/java/edu/mit/mobile/android/imagecache/KeyedLock.java +++ b/astrid/src/main/java/edu/mit/mobile/android/imagecache/KeyedLock.java @@ -20,9 +20,6 @@ public class KeyedLock { private static boolean DEBUG = false; - /** - * @param key - */ public void lock(K key) { if (DEBUG) { log("acquiring lock for key " + key); @@ -44,9 +41,6 @@ public class KeyedLock { lock.lock(); } - /** - * @param key - */ public void unlock(K key) { if (DEBUG) { log("unlocking lock for key " + key); diff --git a/astrid/src/main/res/drawable/med_tag.png b/astrid/src/main/res/drawable/med_tag.png deleted file mode 100644 index 974fe4c5e..000000000 Binary files a/astrid/src/main/res/drawable/med_tag.png and /dev/null differ diff --git a/astrid/src/main/res/layout/contact_adapter_row.xml b/astrid/src/main/res/layout/contact_adapter_row.xml deleted file mode 100644 index 836cb534f..000000000 --- a/astrid/src/main/res/layout/contact_adapter_row.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - diff --git a/astrid/src/main/res/values/attrs.xml b/astrid/src/main/res/values/attrs.xml index 27c92b0e1..78dd9ad2b 100644 --- a/astrid/src/main/res/values/attrs.xml +++ b/astrid/src/main/res/values/attrs.xml @@ -43,11 +43,6 @@ - - - - - diff --git a/astrid/translation-notes b/astrid/translation-notes deleted file mode 100644 index 4b81f330d..000000000 --- a/astrid/translation-notes +++ /dev/null @@ -1,76 +0,0 @@ -reminders - - Absolute Deadline! - Goal Deadline! - Working on: - - You have $NUM tagged $TAG! - -task edit - - - Astrid: Editing Task - Astrid: Editing - Astrid: New Task - - - Basic - Dates - Alerts - - - Summary - Task Name - How Important is it? - Tags: - Tag Name - - How Long Will it Take? - Time Already Spent on Task - Absolute Deadline - Goal Deadline - Add Task To Calendar - Open Calendar Event - Hide Until This Date - Repeat Every - No Repeat Set - Hide Until This Task is Done - Notes - Enter Task Notes - - Periodic Reminders - Every - Notify me... - As Deadlines Approach - At Deadlines - After Absolute Deadline Passes - Alarm Clock Mode - Fixed Reminders - Add New Reminder - - - Time (hours : minutes) - Remind Me Every - Repeat Every (0 to disable) - Help: Astrid Repeats - -To use repeats, set at least one of the deadlines above. When you complete this task, the deadline will be automatically advanced. -\n\n -If you don\'t want to see the new task right after you complete the old one, you should use the \"Hide Until\" field, which will also be advanced automatically. -\n - - Don\'t Show Help Anymore - - - Save - Discard - Edit - Delete - Click to Set - Start Timer - Stop Timer - - Save - Task Saved: due in %s - Task Saved: due %s ago - Task Saved \ No newline at end of file