Tighten access

pull/437/head
Alex Baker 9 years ago
parent 905c9a1ac9
commit 61360e114b

@ -39,7 +39,7 @@ public class GtasksTaskListUpdater extends OrderedMetadataListUpdater<GtasksList
/** map of task -> prior sibling */ /** map of task -> prior sibling */
final HashMap<Long, Long> siblings = new HashMap<>(); final HashMap<Long, Long> siblings = new HashMap<>();
final HashMap<Long, String> localToRemoteIdMap = private final HashMap<Long, String> localToRemoteIdMap =
new HashMap<>(); new HashMap<>();
private final GtasksSyncService gtasksSyncService; private final GtasksSyncService gtasksSyncService;

@ -93,7 +93,7 @@ public class OrderedMetadataListFragmentHelper<LIST> implements OrderedListFragm
return fragment.getListView(); return fragment.getListView();
} }
public DraggableListView getTouchListView() { private DraggableListView getTouchListView() {
return (DraggableListView) fragment.getListView(); return (DraggableListView) fragment.getListView();
} }
@ -156,7 +156,7 @@ public class OrderedMetadataListFragmentHelper<LIST> implements OrderedListFragm
indent(which, -1); indent(which, -1);
} }
protected void indent(int which, int delta) { void indent(int which, int delta) {
long targetTaskId = taskAdapter.getItemId(which); long targetTaskId = taskAdapter.getItemId(which);
if (targetTaskId <= 0) { if (targetTaskId <= 0) {
return; // This can happen with gestures on empty parts of the list (e.g. extra space below tasks) return; // This can happen with gestures on empty parts of the list (e.g. extra space below tasks)

@ -39,15 +39,15 @@ abstract public class OrderedMetadataListUpdater<LIST> {
abstract protected Metadata createEmptyMetadata(LIST list, long taskId); abstract protected Metadata createEmptyMetadata(LIST list, long taskId);
public OrderedMetadataListUpdater(MetadataDao metadataDao) { OrderedMetadataListUpdater(MetadataDao metadataDao) {
this.metadataDao = metadataDao; this.metadataDao = metadataDao;
} }
protected void beforeIndent(LIST list) { void beforeIndent(LIST list) {
// //
} }
protected void onMovedOrIndented(Metadata metadata) { void onMovedOrIndented(Metadata metadata) {
// //
} }
@ -204,7 +204,7 @@ abstract public class OrderedMetadataListUpdater<LIST> {
} }
} }
protected void traverseTreeAndWriteValues(LIST list, Node node, AtomicLong order, int indent) { private void traverseTreeAndWriteValues(LIST list, Node node, AtomicLong order, int indent) {
if(node.taskId != Task.NO_ID) { if(node.taskId != Task.NO_ID) {
Metadata metadata = getTaskMetadata(node.taskId); Metadata metadata = getTaskMetadata(node.taskId);
if(metadata == null) { if(metadata == null) {
@ -229,7 +229,7 @@ abstract public class OrderedMetadataListUpdater<LIST> {
} }
} }
protected Node findNode(Node node, long taskId) { private Node findNode(Node node, long taskId) {
if(node.taskId == taskId) { if(node.taskId == taskId) {
return node; return node;
} }
@ -242,7 +242,7 @@ abstract public class OrderedMetadataListUpdater<LIST> {
return null; return null;
} }
protected Node buildTreeModel(LIST list) { private Node buildTreeModel(LIST list) {
final Node root = new Node(Task.NO_ID, null); final Node root = new Node(Task.NO_ID, null);
final AtomicInteger previoustIndent = new AtomicInteger(-1); final AtomicInteger previoustIndent = new AtomicInteger(-1);
final AtomicReference<Node> currentNode = new AtomicReference<>(root); final AtomicReference<Node> currentNode = new AtomicReference<>(root);
@ -277,7 +277,7 @@ abstract public class OrderedMetadataListUpdater<LIST> {
return root; return root;
} }
protected void saveAndUpdateModifiedDate(Metadata metadata) { private void saveAndUpdateModifiedDate(Metadata metadata) {
if(metadata.getSetValues().size() == 0) { if(metadata.getSetValues().size() == 0) {
return; return;
} }

@ -65,7 +65,7 @@ public class GtasksSyncService {
} }
private class MoveOp implements SyncOnSaveOperation { private class MoveOp implements SyncOnSaveOperation {
protected Metadata metadata; Metadata metadata;
public MoveOp(Metadata metadata) { public MoveOp(Metadata metadata) {
this.metadata = metadata; this.metadata = metadata;
@ -143,7 +143,7 @@ public class GtasksSyncService {
operationQueue.offer(new MoveOp(metadata)); operationQueue.offer(new MoveOp(metadata));
} }
public void pushMetadataOnSave(Metadata model, GtasksInvoker invoker) throws IOException { private void pushMetadataOnSave(Metadata model, GtasksInvoker invoker) throws IOException {
AndroidUtilities.sleepDeep(1000L); AndroidUtilities.sleepDeep(1000L);
String taskId = model.getValue(GtasksMetadata.ID); String taskId = model.getValue(GtasksMetadata.ID);

@ -76,7 +76,7 @@ public class SyncAdapterHelper {
getAccount() != null; getAccount() != null;
} }
public boolean masterSyncEnabled() { private boolean masterSyncEnabled() {
return ContentResolver.getMasterSyncAutomatically(); return ContentResolver.getMasterSyncAutomatically();
} }

@ -5,7 +5,7 @@ import android.content.Context;
public abstract class InjectingAbstractThreadedSyncAdapter extends AbstractThreadedSyncAdapter { public abstract class InjectingAbstractThreadedSyncAdapter extends AbstractThreadedSyncAdapter {
public InjectingAbstractThreadedSyncAdapter(Context context, boolean autoInitialize) { protected InjectingAbstractThreadedSyncAdapter(Context context, boolean autoInitialize) {
super(context, autoInitialize); super(context, autoInitialize);
inject(context); inject(context);
} }

@ -10,7 +10,7 @@ public final class PluginBundleValues {
public static final String BUNDLE_EXTRA_STRING_FILTER = "org.tasks.locale.STRING_FILTER"; public static final String BUNDLE_EXTRA_STRING_FILTER = "org.tasks.locale.STRING_FILTER";
public static final String BUNDLE_EXTRA_PREVIOUS_BUNDLE = "org.tasks.locale.PREVIOUS_BUNDLE"; public static final String BUNDLE_EXTRA_PREVIOUS_BUNDLE = "org.tasks.locale.PREVIOUS_BUNDLE";
public static final String BUNDLE_EXTRA_INT_VERSION_CODE = "org.tasks.locale.INT_VERSION_CODE"; private static final String BUNDLE_EXTRA_INT_VERSION_CODE = "org.tasks.locale.INT_VERSION_CODE";
public static boolean isBundleValid(final Bundle bundle) { public static boolean isBundleValid(final Bundle bundle) {
if (null == bundle) { if (null == bundle) {

@ -9,9 +9,9 @@ import timber.log.Timber;
public abstract class AbstractFragmentPluginAppCompatActivity extends ThemedInjectingAppCompatActivity { public abstract class AbstractFragmentPluginAppCompatActivity extends ThemedInjectingAppCompatActivity {
protected boolean mIsCancelled = false; boolean mIsCancelled = false;
/* package */ static boolean isLocalePluginIntent(final Intent intent) { /* package */ private static boolean isLocalePluginIntent(final Intent intent) {
final String action = intent.getAction(); final String action = intent.getAction();
return com.twofortyfouram.locale.api.Intent.ACTION_EDIT_CONDITION.equals(action) return com.twofortyfouram.locale.api.Intent.ACTION_EDIT_CONDITION.equals(action)
@ -71,7 +71,7 @@ public abstract class AbstractFragmentPluginAppCompatActivity extends ThemedInje
* editing. Internally, this method relies on {@link #isBundleValid(Bundle)}. If * editing. Internally, this method relies on {@link #isBundleValid(Bundle)}. If
* the bundle exists but is not valid, this method will return null. * the bundle exists but is not valid, this method will return null.
*/ */
public final Bundle getPreviousBundle() { private Bundle getPreviousBundle() {
final Bundle bundle = getIntent().getBundleExtra( final Bundle bundle = getIntent().getBundleExtra(
com.twofortyfouram.locale.api.Intent.EXTRA_BUNDLE); com.twofortyfouram.locale.api.Intent.EXTRA_BUNDLE);
@ -90,7 +90,7 @@ public abstract class AbstractFragmentPluginAppCompatActivity extends ThemedInje
* previously saved to the host and subsequently passed back to this Activity for further * previously saved to the host and subsequently passed back to this Activity for further
* editing. * editing.
*/ */
public final String getPreviousBlurb() { private String getPreviousBlurb() {
return getIntent().getStringExtra( return getIntent().getStringExtra(
com.twofortyfouram.locale.api.Intent.EXTRA_STRING_BLURB); com.twofortyfouram.locale.api.Intent.EXTRA_STRING_BLURB);
} }
@ -103,7 +103,7 @@ public abstract class AbstractFragmentPluginAppCompatActivity extends ThemedInje
* Activity. {@code bundle} should not be mutated by this method. * Activity. {@code bundle} should not be mutated by this method.
* @return true if {@code bundle} is valid for the plug-in. * @return true if {@code bundle} is valid for the plug-in.
*/ */
public abstract boolean isBundleValid(final Bundle bundle); protected abstract boolean isBundleValid(final Bundle bundle);
/** /**
* Plug-in Activity lifecycle callback to allow the Activity to restore * Plug-in Activity lifecycle callback to allow the Activity to restore
@ -123,18 +123,18 @@ public abstract class AbstractFragmentPluginAppCompatActivity extends ThemedInje
* @param previousBundle Previous bundle that the Activity saved. * @param previousBundle Previous bundle that the Activity saved.
* @param previousBlurb Previous blurb that the Activity saved * @param previousBlurb Previous blurb that the Activity saved
*/ */
public abstract void onPostCreateWithPreviousResult( protected abstract void onPostCreateWithPreviousResult(
final Bundle previousBundle, final String previousBlurb); final Bundle previousBundle, final String previousBlurb);
/** /**
* @return Bundle for the plug-in or {@code null} if a valid Bundle cannot * @return Bundle for the plug-in or {@code null} if a valid Bundle cannot
* be generated. * be generated.
*/ */
public abstract Bundle getResultBundle(); protected abstract Bundle getResultBundle();
/** /**
* @param bundle Valid bundle for the component. * @param bundle Valid bundle for the component.
* @return Blurb for {@code bundle}. * @return Blurb for {@code bundle}.
*/ */
public abstract String getResultBlurb(final Bundle bundle); protected abstract String getResultBlurb(final Bundle bundle);
} }

@ -104,7 +104,7 @@ public final class TaskerSettingsActivity extends AbstractFragmentPluginAppCompa
} }
@Override @Override
public Bundle getResultBundle() { protected Bundle getResultBundle() {
return PluginBundleValues.generateBundle(defaultFilterProvider.getFilterPreferenceValue(filter)); return PluginBundleValues.generateBundle(defaultFilterProvider.getFilterPreferenceValue(filter));
} }

@ -48,8 +48,8 @@ public class TouchListView extends ListView {
private int mUpperBound; private int mUpperBound;
private int mLowerBound; private int mLowerBound;
private int mHeight; private int mHeight;
public static final int SLIDE_RIGHT = 1; private static final int SLIDE_RIGHT = 1;
public static final int SLIDE_LEFT = 2; private static final int SLIDE_LEFT = 2;
private int mRemoveMode = -1; private int mRemoveMode = -1;
private final Rect mTempRect = new Rect(); private final Rect mTempRect = new Rect();
private Bitmap mDragBitmap; private Bitmap mDragBitmap;
@ -169,7 +169,7 @@ public class TouchListView extends ListView {
return super.onInterceptTouchEvent(ev); return super.onInterceptTouchEvent(ev);
} }
protected boolean isDraggableRow(View view) { private boolean isDraggableRow(View view) {
return(view.findViewById(grabberId)!=null); return(view.findViewById(grabberId)!=null);
} }

@ -68,7 +68,7 @@ public class AstridChronic {
* will be made, and the first matching instance of that time will * will be made, and the first matching instance of that time will
* be used. * be used.
*/ */
public static Span parse(String text, Options options) { private static Span parse(String text, Options options) {
// store now for later =) // store now for later =)
//_now = options.getNow(); //_now = options.getNow();
@ -119,7 +119,7 @@ public class AstridChronic {
* to numbers (three => 3), and converting ordinal words to numeric * to numbers (three => 3), and converting ordinal words to numeric
* ordinals (third => 3rd) * ordinals (third => 3rd)
*/ */
protected static String preNormalize(String text) { private static String preNormalize(String text) {
String normalizedText = text.toLowerCase(); String normalizedText = text.toLowerCase();
normalizedText = Chronic.numericizeNumbers(normalizedText); normalizedText = Chronic.numericizeNumbers(normalizedText);
normalizedText = normalizedText.replaceAll("['\"\\.]", ""); normalizedText = normalizedText.replaceAll("['\"\\.]", "");
@ -146,7 +146,7 @@ public class AstridChronic {
/** /**
* Convert ordinal words to numeric ordinals (third => 3rd) * Convert ordinal words to numeric ordinals (third => 3rd)
*/ */
protected static String numericizeOrdinals(String text) { private static String numericizeOrdinals(String text) {
return text; return text;
} }
@ -154,7 +154,7 @@ public class AstridChronic {
* Split the text on spaces and convert each word into * Split the text on spaces and convert each word into
* a Token * a Token
*/ */
protected static List<Token> baseTokenize(String text) { private static List<Token> baseTokenize(String text) {
String[] words = text.split(" "); String[] words = text.split(" ");
List<Token> tokens = new LinkedList<>(); List<Token> tokens = new LinkedList<>();
for (String word : words) { for (String word : words) {
@ -167,7 +167,7 @@ public class AstridChronic {
* Guess a specific time within the given span * Guess a specific time within the given span
*/ */
// DIFF: We return Span instead of Date // DIFF: We return Span instead of Date
protected static Span guess(Span span) { private static Span guess(Span span) {
if (span == null) { if (span == null) {
return null; return null;
} }

@ -73,16 +73,17 @@ public abstract class AbstractModel implements Parcelable, Cloneable {
protected ContentValues values = null; protected ContentValues values = null;
/** Transitory Metadata (not saved in database) */ /** Transitory Metadata (not saved in database) */
protected HashMap<String, Object> transitoryData = null; @SuppressWarnings("WeakerAccess")
HashMap<String, Object> transitoryData = null;
public AbstractModel() { protected AbstractModel() {
} }
public AbstractModel(TodorooCursor<? extends AbstractModel> cursor) { protected AbstractModel(TodorooCursor<? extends AbstractModel> cursor) {
readPropertiesFromCursor(cursor); readPropertiesFromCursor(cursor);
} }
public AbstractModel(AbstractModel abstractModel) { protected AbstractModel(AbstractModel abstractModel) {
if (abstractModel != null) { if (abstractModel != null) {
if (abstractModel.setValues != null) { if (abstractModel.setValues != null) {
setValues = new ContentValues(abstractModel.setValues); setValues = new ContentValues(abstractModel.setValues);
@ -308,7 +309,7 @@ public abstract class AbstractModel implements Parcelable, Cloneable {
* Check whether the user has changed this property value and it should be * Check whether the user has changed this property value and it should be
* stored for saving in the database * stored for saving in the database
*/ */
protected synchronized <TYPE> boolean shouldSaveValue( private synchronized <TYPE> boolean shouldSaveValue(
Property<TYPE> property, TYPE newValue) { Property<TYPE> property, TYPE newValue) {
// we've already decided to save it, so overwrite old value // we've already decided to save it, so overwrite old value
@ -394,14 +395,14 @@ public abstract class AbstractModel implements Parcelable, Cloneable {
transitoryData.put(key, value); transitoryData.put(key, value);
} }
public Object getTransitory(String key) { private Object getTransitory(String key) {
if(transitoryData == null) { if(transitoryData == null) {
return null; return null;
} }
return transitoryData.get(key); return transitoryData.get(key);
} }
public Object clearTransitory(String key) { private Object clearTransitory(String key) {
if (transitoryData == null) { if (transitoryData == null) {
return null; return null;
} }

@ -48,13 +48,13 @@ public abstract class Property<TYPE> extends Field implements Cloneable {
/** Is this field for pictures? (usually as a json object containing "path" key or urls) */ /** Is this field for pictures? (usually as a json object containing "path" key or urls) */
public static final int PROP_FLAG_PICTURE = 1 << 5; public static final int PROP_FLAG_PICTURE = 1 << 5;
public int flags = 0; private int flags = 0;
/** /**
* Create a property by table and column name. Uses the default property * Create a property by table and column name. Uses the default property
* expression which is derived from default table name * expression which is derived from default table name
*/ */
protected Property(Table table, String columnName) { Property(Table table, String columnName) {
this(table, columnName, (table == null) ? (columnName) : (table.name() + "." + columnName)); this(table, columnName, (table == null) ? (columnName) : (table.name() + "." + columnName));
} }
@ -62,7 +62,7 @@ public abstract class Property<TYPE> extends Field implements Cloneable {
* Create a property by table and column name. Uses the default property * Create a property by table and column name. Uses the default property
* expression which is derived from default table name * expression which is derived from default table name
*/ */
protected Property(Table table, String columnName, int flags) { Property(Table table, String columnName, int flags) {
this(table, columnName, (table == null) ? (columnName) : (table.name() + "." + columnName)); this(table, columnName, (table == null) ? (columnName) : (table.name() + "." + columnName));
this.flags = flags; this.flags = flags;
} }
@ -71,7 +71,7 @@ public abstract class Property<TYPE> extends Field implements Cloneable {
* Create a property by table and column name, manually specifying an * Create a property by table and column name, manually specifying an
* expression to use in SQL * expression to use in SQL
*/ */
protected Property(Table table, String columnName, String expression) { Property(Table table, String columnName, String expression) {
super(expression); super(expression);
this.table = table; this.table = table;
this.name = columnName; this.name = columnName;
@ -98,7 +98,7 @@ public abstract class Property<TYPE> extends Field implements Cloneable {
/** /**
* Return a clone of this property * Return a clone of this property
*/ */
public Property<TYPE> cloneAs(String tableAlias, String columnAlias) { Property<TYPE> cloneAs(String tableAlias, String columnAlias) {
Table aliasedTable = this.table; Table aliasedTable = this.table;
if (!TextUtils.isEmpty(tableAlias)) { if (!TextUtils.isEmpty(tableAlias)) {
aliasedTable = table.as(tableAlias); aliasedTable = table.as(tableAlias);
@ -147,7 +147,7 @@ public abstract class Property<TYPE> extends Field implements Cloneable {
super(table, name); super(table, name);
} }
protected IntegerProperty(String name, String expression) { IntegerProperty(String name, String expression) {
super(null, name, expression); super(null, name, expression);
} }

@ -66,7 +66,7 @@ public class TodorooCursor<TYPE extends AbstractModel> extends CursorWrapper {
/** /**
* Use cache to get the column index for the given field name * Use cache to get the column index for the given field name
*/ */
public synchronized int getColumnIndexFromCache(String field) { synchronized int getColumnIndexFromCache(String field) {
Integer index = columnIndexCache.get(field); Integer index = columnIndexCache.get(field);
if(index == null) { if(index == null) {
index = getColumnIndexOrThrow(field); index = getColumnIndexOrThrow(field);

@ -13,7 +13,7 @@ import static com.todoroo.andlib.sql.SqlConstants.RIGHT_PARENTHESIS;
import static com.todoroo.andlib.sql.SqlConstants.SPACE; import static com.todoroo.andlib.sql.SqlConstants.SPACE;
public abstract class Criterion { public abstract class Criterion {
protected final Operator operator; final Operator operator;
public Criterion(Operator operator) { public Criterion(Operator operator) {
this.operator = operator; this.operator = operator;

@ -12,11 +12,11 @@ public abstract class DBObject<T extends DBObject<?>> implements Cloneable {
protected String alias; protected String alias;
protected final String expression; protected final String expression;
protected DBObject(String expression){ DBObject(String expression){
this.expression = expression; this.expression = expression;
} }
public T as(String newAlias) { protected T as(String newAlias) {
try { try {
T clone = (T) clone(); T clone = (T) clone();
clone.alias = newAlias; clone.alias = newAlias;
@ -26,7 +26,7 @@ public abstract class DBObject<T extends DBObject<?>> implements Cloneable {
} }
} }
public boolean hasAlias() { protected boolean hasAlias() {
return alias != null; return alias != null;
} }

@ -8,10 +8,10 @@ package com.todoroo.andlib.sql;
import static com.todoroo.andlib.sql.SqlConstants.SPACE; import static com.todoroo.andlib.sql.SqlConstants.SPACE;
public class UnaryCriterion extends Criterion { public class UnaryCriterion extends Criterion {
protected final Field expression; private final Field expression;
protected final Object value; private final Object value;
UnaryCriterion(Field expression, Operator operator, Object value) { private UnaryCriterion(Field expression, Operator operator, Object value) {
super(operator); super(operator);
this.expression = expression; this.expression = expression;
this.value = value; this.value = value;
@ -28,15 +28,18 @@ public class UnaryCriterion extends Criterion {
return new UnaryCriterion(expression, Operator.eq, value); return new UnaryCriterion(expression, Operator.eq, value);
} }
protected void beforePopulateOperator(StringBuilder sb) { @SuppressWarnings("WeakerAccess")
void beforePopulateOperator(StringBuilder sb) {
sb.append(expression); sb.append(expression);
} }
protected void populateOperator(StringBuilder sb) { @SuppressWarnings("WeakerAccess")
void populateOperator(StringBuilder sb) {
sb.append(operator); sb.append(operator);
} }
protected void afterPopulateOperator(StringBuilder sb) { @SuppressWarnings("WeakerAccess")
void afterPopulateOperator(StringBuilder sb) {
if(value == null) { if(value == null) {
return; return;
} }

@ -182,7 +182,7 @@ public class AndroidUtilities {
* Copy stream from source to destination * Copy stream from source to destination
* @throws IOException * @throws IOException
*/ */
public static void copyStream(InputStream source, OutputStream dest) throws IOException { private static void copyStream(InputStream source, OutputStream dest) throws IOException {
int bytes; int bytes;
byte[] buffer; byte[] buffer;
int BUFFER_SIZE = 1024; int BUFFER_SIZE = 1024;

@ -41,7 +41,7 @@ public class Pair<L, R> {
return equal(getLeft(), other.getLeft()) && equal(getRight(), other.getRight()); return equal(getLeft(), other.getLeft()) && equal(getRight(), other.getRight());
} }
public static boolean equal(Object o1, Object o2) { private static boolean equal(Object o1, Object o2) {
if (o1 == null) { if (o1 == null) {
return o2 == null; return o2 == null;
} }

@ -43,9 +43,9 @@ public class BeastModePreferences extends ThemedInjectingAppCompatActivity imple
private ArrayList<String> items; private ArrayList<String> items;
public static final String BEAST_MODE_ORDER_PREF = "beast_mode_order_v3"; //$NON-NLS-1$ private static final String BEAST_MODE_ORDER_PREF = "beast_mode_order_v3"; //$NON-NLS-1$
public static final String BEAST_MODE_PREF_ITEM_SEPARATOR = ";"; //$NON-NLS-1$ private static final String BEAST_MODE_PREF_ITEM_SEPARATOR = ";"; //$NON-NLS-1$
private HashMap<String, String> prefsToDescriptions; private HashMap<String, String> prefsToDescriptions;

@ -287,7 +287,7 @@ public final class TaskEditFragment extends InjectingFragment implements Toolbar
callback.taskEditFinished(); callback.taskEditFinished();
} }
protected void deleteButtonClick() { private void deleteButtonClick() {
dialogBuilder.newMessageDialog(R.string.DLG_delete_this_task_question) dialogBuilder.newMessageDialog(R.string.DLG_delete_this_task_question)
.setPositiveButton(android.R.string.ok, (dialog, which) -> { .setPositiveButton(android.R.string.ok, (dialog, which) -> {
TimerPlugin.stopTimer(notificationManager, taskService, getActivity(), model); TimerPlugin.stopTimer(notificationManager, taskService, getActivity(), model);

@ -202,7 +202,7 @@ public class TaskListActivity extends InjectingAppCompatActivity implements
.commit(); .commit();
} }
public NavigationDrawerFragment getNavigationDrawerFragment() { private NavigationDrawerFragment getNavigationDrawerFragment() {
return (NavigationDrawerFragment) getSupportFragmentManager() return (NavigationDrawerFragment) getSupportFragmentManager()
.findFragmentById(NavigationDrawerFragment.FRAGMENT_NAVIGATION_DRAWER); .findFragmentById(NavigationDrawerFragment.FRAGMENT_NAVIGATION_DRAWER);
} }
@ -458,7 +458,7 @@ public class TaskListActivity extends InjectingAppCompatActivity implements
return getTaskEditFragment().startTimer(); return getTaskEditFragment().startTimer();
} }
public boolean isDoublePaneLayout() { private boolean isDoublePaneLayout() {
return getResources().getBoolean(R.bool.two_pane_layout); return getResources().getBoolean(R.bool.two_pane_layout);
} }
@ -490,7 +490,7 @@ public class TaskListActivity extends InjectingAppCompatActivity implements
reloadCurrentFilter(); reloadCurrentFilter();
} }
void reloadCurrentFilter() { private void reloadCurrentFilter() {
onFilterItemClicked(getCurrentFilter()); onFilterItemClicked(getCurrentFilter());
} }

@ -120,9 +120,9 @@ public class TaskListFragment extends InjectingListFragment implements
// --- menu codes // --- menu codes
protected static final int CONTEXT_MENU_COPY_TASK_ID = R.string.TAd_contextCopyTask; private static final int CONTEXT_MENU_COPY_TASK_ID = R.string.TAd_contextCopyTask;
protected static final int CONTEXT_MENU_DELETE_TASK_ID = R.string.TAd_contextDeleteTask; private static final int CONTEXT_MENU_DELETE_TASK_ID = R.string.TAd_contextDeleteTask;
protected static final int CONTEXT_MENU_UNDELETE_TASK_ID = R.string.TAd_contextUndeleteTask; private static final int CONTEXT_MENU_UNDELETE_TASK_ID = R.string.TAd_contextUndeleteTask;
// --- instance variables // --- instance variables
@ -168,7 +168,7 @@ public class TaskListFragment extends InjectingListFragment implements
} }
} }
public void setSyncOngoing(final boolean ongoing) { protected void setSyncOngoing(final boolean ongoing) {
Activity activity = getActivity(); Activity activity = getActivity();
if (activity != null) { if (activity != null) {
activity.runOnUiThread(() -> { activity.runOnUiThread(() -> {
@ -492,7 +492,7 @@ public class TaskListFragment extends InjectingListFragment implements
* Called by the RefreshReceiver when the task list receives a refresh * Called by the RefreshReceiver when the task list receives a refresh
* broadcast. Subclasses should override this. * broadcast. Subclasses should override this.
*/ */
protected void refresh() { private void refresh() {
loadTaskListContent(); loadTaskListContent();
setSyncOngoing(gtasksPreferenceService.isOngoing()); setSyncOngoing(gtasksPreferenceService.isOngoing());
@ -534,7 +534,7 @@ public class TaskListFragment extends InjectingListFragment implements
/** /**
* Fill in the Task List with current items * Fill in the Task List with current items
*/ */
public void setTaskAdapter() { protected void setTaskAdapter() {
if (filter == null) { if (filter == null) {
return; return;
} }
@ -735,7 +735,7 @@ public class TaskListFragment extends InjectingListFragment implements
} }
} }
protected void duplicateTask(long itemId) { private void duplicateTask(long itemId) {
long cloneId = taskDuplicator.duplicateTask(itemId); long cloneId = taskDuplicator.duplicateTask(itemId);
onTaskListItemClicked(cloneId); onTaskListItemClicked(cloneId);
} }

@ -120,22 +120,22 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
private final TaskAttachmentDao taskAttachmentDao; private final TaskAttachmentDao taskAttachmentDao;
private final TaskService taskService; private final TaskService taskService;
protected final Context context; private final Context context;
protected final TaskListFragment fragment; private final TaskListFragment fragment;
private DialogBuilder dialogBuilder; private DialogBuilder dialogBuilder;
private final TagService tagService; private final TagService tagService;
private ThemeCache themeCache; private ThemeCache themeCache;
protected final Resources resources; private final Resources resources;
protected OnCompletedTaskListener onCompletedTaskListener = null; private OnCompletedTaskListener onCompletedTaskListener = null;
protected final LayoutInflater inflater; private final LayoutInflater inflater;
private int fontSize; private int fontSize;
private final AtomicReference<String> query; private final AtomicReference<String> query;
// measure utilities // measure utilities
protected final DisplayMetrics displayMetrics; private final DisplayMetrics displayMetrics;
protected final int minRowHeight; private final int minRowHeight;
private final float tagCharacters; private final float tagCharacters;
private final Map<String, TagData> tagMap = new HashMap<>(); private final Map<String, TagData> tagMap = new HashMap<>();
@ -179,7 +179,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
this.minRowHeight = computeMinRowHeight(); this.minRowHeight = computeMinRowHeight();
} }
protected int computeMinRowHeight() { private int computeMinRowHeight() {
DisplayMetrics metrics = resources.getDisplayMetrics(); DisplayMetrics metrics = resources.getDisplayMetrics();
return (int) (metrics.density * 40); return (int) (metrics.density * 40);
} }
@ -434,7 +434,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
} }
} }
protected final View.OnClickListener completeBoxListener = v -> { private final View.OnClickListener completeBoxListener = v -> {
int[] location = new int[2]; int[] location = new int[2];
v.getLocationOnScreen(location); v.getLocationOnScreen(location);
ViewHolder viewHolder = getTagFromCheckBox(v); ViewHolder viewHolder = getTagFromCheckBox(v);
@ -459,7 +459,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
/** Helper method to adjust a tasks' appearance if the task is completed or /** Helper method to adjust a tasks' appearance if the task is completed or
* uncompleted. * uncompleted.
*/ */
protected void setTaskAppearance(ViewHolder viewHolder, Task task) { private void setTaskAppearance(ViewHolder viewHolder, Task task) {
boolean completed = task.isCompleted(); boolean completed = task.isCompleted();
TextView name = viewHolder.nameView; TextView name = viewHolder.nameView;
@ -606,7 +606,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
* @param newState * @param newState
* state that this task should be set to * state that this task should be set to
*/ */
protected void completeTask(final Task task, final boolean newState) { private void completeTask(final Task task, final boolean newState) {
if(task == null) { if(task == null) {
return; return;
} }

@ -45,7 +45,7 @@ public class CustomFilter extends Filter {
} }
@Override @Override
public void readFromParcel(Parcel source) { protected void readFromParcel(Parcel source) {
super.readFromParcel(source); super.readFromParcel(source);
id = source.readLong(); id = source.readLong();
} }

@ -58,7 +58,7 @@ abstract public class CustomFilterCriterion implements Parcelable {
/** /**
* Icon for this criteria. Can be null for no bitmap * Icon for this criteria. Can be null for no bitmap
*/ */
public Bitmap icon; Bitmap icon;
/** /**
* Criteria name. This is displayed when users are selecting a criteria * Criteria name. This is displayed when users are selecting a criteria
@ -70,7 +70,7 @@ abstract public class CustomFilterCriterion implements Parcelable {
/** /**
* Utility method to write to parcel * Utility method to write to parcel
*/ */
public void writeToParcel(Parcel dest) { void writeToParcel(Parcel dest) {
dest.writeString(identifier); dest.writeString(identifier);
dest.writeString(text); dest.writeString(text);
dest.writeString(sql); dest.writeString(sql);
@ -82,7 +82,7 @@ abstract public class CustomFilterCriterion implements Parcelable {
/** /**
* Utility method to read from parcel * Utility method to read from parcel
*/ */
public void readFromParcel(Parcel source) { void readFromParcel(Parcel source) {
identifier = source.readString(); identifier = source.readString();
text = source.readString(); text = source.readString();
sql = source.readString(); sql = source.readString();

@ -47,13 +47,13 @@ public class Filter extends FilterListItem {
* metadata.value = 'b' GROUP BY tasks.id ORDER BY tasks.title"</code> * metadata.value = 'b' GROUP BY tasks.id ORDER BY tasks.title"</code>
* </ul> * </ul>
*/ */
protected String sqlQuery; String sqlQuery;
/** /**
* Field for holding a modified sqlQuery based on sqlQuery. Useful for adjusting * Field for holding a modified sqlQuery based on sqlQuery. Useful for adjusting
* query for sort/subtasks without breaking the equality checking based on sqlQuery. * query for sort/subtasks without breaking the equality checking based on sqlQuery.
*/ */
protected String filterOverride; private String filterOverride;
/** /**
* Values to apply to a task when quick-adding a task from this filter. * Values to apply to a task when quick-adding a task from this filter.
@ -107,7 +107,7 @@ public class Filter extends FilterListItem {
/** /**
* Utility constructor * Utility constructor
*/ */
protected Filter() { Filter() {
// do nothing // do nothing
} }
@ -169,7 +169,7 @@ public class Filter extends FilterListItem {
} }
@Override @Override
public void readFromParcel(Parcel source) { protected void readFromParcel(Parcel source) {
super.readFromParcel(source); super.readFromParcel(source);
source.readString(); // old title source.readString(); // old title
sqlQuery = source.readString(); sqlQuery = source.readString();

@ -55,7 +55,7 @@ abstract public class FilterListItem implements Parcelable {
/** /**
* Utility method to read FilterListItem properties from a parcel. * Utility method to read FilterListItem properties from a parcel.
*/ */
public void readFromParcel(Parcel source) { protected void readFromParcel(Parcel source) {
listingTitle = source.readString(); listingTitle = source.readString();
icon = source.readInt(); icon = source.readInt();
tint = source.readInt(); tint = source.readInt();

@ -23,9 +23,9 @@ public class GtasksFilter extends Filter {
private static final int CLOUD = R.drawable.ic_cloud_queue_24dp; private static final int CLOUD = R.drawable.ic_cloud_queue_24dp;
public long storeId; private long storeId;
protected GtasksFilter() { private GtasksFilter() {
super(); super();
} }
@ -67,7 +67,7 @@ public class GtasksFilter extends Filter {
} }
@Override @Override
public void readFromParcel(Parcel source) { protected void readFromParcel(Parcel source) {
super.readFromParcel(source); super.readFromParcel(source);
storeId = source.readLong(); storeId = source.readLong();
} }

@ -46,7 +46,7 @@ public class MultipleSelectCriterion extends CustomFilterCriterion implements Pa
this.name = name; this.name = name;
} }
protected MultipleSelectCriterion() { private MultipleSelectCriterion() {
// constructor for inflating from parceling // constructor for inflating from parceling
} }

@ -34,31 +34,31 @@ public final class PermaSql {
public static final String VALUE_EOD_YESTERDAY = "EODY()"; //$NON-NLS-1$ public static final String VALUE_EOD_YESTERDAY = "EODY()"; //$NON-NLS-1$
/** value to be replaced by noon yesterday as long */ /** value to be replaced by noon yesterday as long */
public static final String VALUE_NOON_YESTERDAY = "NOONY()"; //$NON-NLS-1$ private static final String VALUE_NOON_YESTERDAY = "NOONY()"; //$NON-NLS-1$
/** value to be replaced by end of day tomorrow as long */ /** value to be replaced by end of day tomorrow as long */
public static final String VALUE_EOD_TOMORROW = "EODT()"; //$NON-NLS-1$ public static final String VALUE_EOD_TOMORROW = "EODT()"; //$NON-NLS-1$
/** value to be replaced by noon tomorrow as long */ /** value to be replaced by noon tomorrow as long */
public static final String VALUE_NOON_TOMORROW = "NOONT()"; //$NON-NLS-1$ private static final String VALUE_NOON_TOMORROW = "NOONT()"; //$NON-NLS-1$
/** value to be replaced by end of day day after tomorrow as long */ /** value to be replaced by end of day day after tomorrow as long */
public static final String VALUE_EOD_DAY_AFTER = "EODTT()"; //$NON-NLS-1$ public static final String VALUE_EOD_DAY_AFTER = "EODTT()"; //$NON-NLS-1$
/** value to be replaced by noon day after tomorrow as long */ /** value to be replaced by noon day after tomorrow as long */
public static final String VALUE_NOON_DAY_AFTER = "NOONTT()"; //$NON-NLS-1$ private static final String VALUE_NOON_DAY_AFTER = "NOONTT()"; //$NON-NLS-1$
/** value to be replaced by end of day next week as long */ /** value to be replaced by end of day next week as long */
public static final String VALUE_EOD_NEXT_WEEK = "EODW()"; //$NON-NLS-1$ public static final String VALUE_EOD_NEXT_WEEK = "EODW()"; //$NON-NLS-1$
/** value to be replaced by noon next week as long */ /** value to be replaced by noon next week as long */
public static final String VALUE_NOON_NEXT_WEEK = "NOONW()"; //$NON-NLS-1$ private static final String VALUE_NOON_NEXT_WEEK = "NOONW()"; //$NON-NLS-1$
/** value to be replaced by approximate end of day next month as long */ /** value to be replaced by approximate end of day next month as long */
public static final String VALUE_EOD_NEXT_MONTH = "EODM()"; //$NON-NLS-1$ public static final String VALUE_EOD_NEXT_MONTH = "EODM()"; //$NON-NLS-1$
/** value to be replaced by approximate noon next month as long */ /** value to be replaced by approximate noon next month as long */
public static final String VALUE_NOON_NEXT_MONTH = "NOONM()"; //$NON-NLS-1$ private static final String VALUE_NOON_NEXT_MONTH = "NOONM()"; //$NON-NLS-1$
/** Replace placeholder strings with actual */ /** Replace placeholder strings with actual */
public static String replacePlaceholders(String value) { public static String replacePlaceholders(String value) {

@ -22,7 +22,7 @@ public class TagFilter extends Filter {
private String uuid; private String uuid;
protected TagFilter() { private TagFilter() {
super(); super();
} }
@ -65,7 +65,7 @@ public class TagFilter extends Filter {
} }
@Override @Override
public void readFromParcel(Parcel source) { protected void readFromParcel(Parcel source) {
super.readFromParcel(source); super.readFromParcel(source);
uuid = source.readString(); uuid = source.readString();
} }

@ -21,7 +21,7 @@ public class TextInputCriterion extends CustomFilterCriterion implements Parcela
/** /**
* Text area prompt * Text area prompt
*/ */
public String prompt; private String prompt;
/** /**
* Text area hint * Text area hint
@ -44,7 +44,7 @@ public class TextInputCriterion extends CustomFilterCriterion implements Parcela
this.name = name; this.name = name;
} }
protected TextInputCriterion() { private TextInputCriterion() {
// constructor for inflating from parceling // constructor for inflating from parceling
} }

@ -11,7 +11,7 @@ package com.todoroo.astrid.backup;
* @author Tim Su <tim@todoroo.com> * @author Tim Su <tim@todoroo.com>
* *
*/ */
public class BackupConstants { class BackupConstants {
// Do NOT edit the constants in this file! You will break compatibility with old backups // Do NOT edit the constants in this file! You will break compatibility with old backups

@ -147,10 +147,10 @@ public class TasksXmlImporter {
private static final String FORMAT2 = "2"; //$NON-NLS-1$ private static final String FORMAT2 = "2"; //$NON-NLS-1$
private class Format2TaskImporter { private class Format2TaskImporter {
protected XmlPullParser xpp; XmlPullParser xpp;
protected Task currentTask = new Task(); Task currentTask = new Task();
protected Metadata metadata = new Metadata(); Metadata metadata = new Metadata();
protected TagData tagdata = new TagData(); TagData tagdata = new TagData();
public Format2TaskImporter() { } public Format2TaskImporter() { }
public Format2TaskImporter(XmlPullParser xpp) throws XmlPullParserException, IOException { public Format2TaskImporter(XmlPullParser xpp) throws XmlPullParserException, IOException {
@ -177,7 +177,7 @@ public class TasksXmlImporter {
} }
} }
protected void parseTask() { void parseTask() {
taskCount++; taskCount++;
setProgressMessage(activity.getString(R.string.import_progress_read, taskCount)); setProgressMessage(activity.getString(R.string.import_progress_read, taskCount));
currentTask.clear(); currentTask.clear();
@ -223,7 +223,7 @@ public class TasksXmlImporter {
importCount++; importCount++;
} }
protected void parseMetadata(int format) { void parseMetadata(int format) {
if(!currentTask.isSaved()) { if(!currentTask.isSaved()) {
return; return;
} }
@ -257,7 +257,7 @@ public class TasksXmlImporter {
/** /**
* Turn a model into xml attributes * Turn a model into xml attributes
*/ */
protected void deserializeModel(AbstractModel model, Property<?>[] properties) { void deserializeModel(AbstractModel model, Property<?>[] properties) {
for(Property<?> property : properties) { for(Property<?> property : properties) {
try { try {
property.accept(xmlReadingVisitor, model); property.accept(xmlReadingVisitor, model);

@ -65,7 +65,7 @@ public class CustomFilterActivity extends ThemedInjectingAppCompatActivity imple
private static final String IDENTIFIER_UNIVERSE = "active"; //$NON-NLS-1$ private static final String IDENTIFIER_UNIVERSE = "active"; //$NON-NLS-1$
static final int MENU_GROUP_FILTER = 0; private static final int MENU_GROUP_FILTER = 0;
static final int MENU_GROUP_CONTEXT_TYPE = 1; static final int MENU_GROUP_CONTEXT_TYPE = 1;
static final int MENU_GROUP_CONTEXT_DELETE = 2; static final int MENU_GROUP_CONTEXT_DELETE = 2;
@ -223,7 +223,7 @@ public class CustomFilterActivity extends ThemedInjectingAppCompatActivity imple
} }
} }
void saveAndView() { private void saveAndView() {
String title = filterName.getText().toString().trim(); String title = filterName.getText().toString().trim();
if (isEmpty(title)) { if (isEmpty(title)) {

@ -34,7 +34,7 @@ import java.util.List;
* @author Tim Su <tim@todoroo.com> * @author Tim Su <tim@todoroo.com>
* *
*/ */
public class CustomFilterAdapter extends ArrayAdapter<CriterionInstance> { class CustomFilterAdapter extends ArrayAdapter<CriterionInstance> {
private final CustomFilterActivity activity; private final CustomFilterActivity activity;
private DialogBuilder dialogBuilder; private DialogBuilder dialogBuilder;
@ -52,7 +52,7 @@ public class CustomFilterAdapter extends ArrayAdapter<CriterionInstance> {
// --- view event handling // --- view event handling
View.OnClickListener filterClickListener = new View.OnClickListener() { private View.OnClickListener filterClickListener = new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
ViewHolder viewHolder = (ViewHolder) v.getTag(); ViewHolder viewHolder = (ViewHolder) v.getTag();

@ -37,7 +37,7 @@ public class SavedFilter {
StoreObject.VALUE2.name); StoreObject.VALUE2.name);
/** serialized list of filters applied */ /** serialized list of filters applied */
public static final StringProperty FILTERS = new StringProperty(StoreObject.TABLE, private static final StringProperty FILTERS = new StringProperty(StoreObject.TABLE,
StoreObject.VALUE3.name); StoreObject.VALUE3.name);
// --- data storage and retrieval methods // --- data storage and retrieval methods

@ -63,7 +63,7 @@ public class SortHelper {
return originalSql; return originalSql;
} }
public static Order orderForSortType(int sortType) { private static Order orderForSortType(int sortType) {
Order order; Order order;
switch(sortType) { switch(sortType) {
case SORT_ALPHA: case SORT_ALPHA:

@ -69,7 +69,7 @@ public class StoreObjectDao {
dao.saveExisting(storeObject); dao.saveExisting(storeObject);
} }
public List<StoreObject> getByType(String type) { private List<StoreObject> getByType(String type) {
return dao.toList(select(StoreObject.PROPERTIES) return dao.toList(select(StoreObject.PROPERTIES)
.where(StoreObject.TYPE.eq(type))); .where(StoreObject.TYPE.eq(type)));
} }

@ -206,7 +206,7 @@ public class TaskDao {
} }
} }
public boolean handleSQLiteConstraintException(Task task) { private boolean handleSQLiteConstraintException(Task task) {
TodorooCursor<Task> cursor = dao.query(Query.select(Task.ID).where( TodorooCursor<Task> cursor = dao.query(Query.select(Task.ID).where(
Task.UUID.eq(task.getUUID()))); Task.UUID.eq(task.getUUID())));
if (cursor.getCount() > 0) { if (cursor.getCount() > 0) {
@ -245,7 +245,7 @@ public class TaskDao {
return false; return false;
} }
public static void createDefaultHideUntil(Preferences preferences, Task item) { private static void createDefaultHideUntil(Preferences preferences, Task item) {
if(!item.containsValue(Task.HIDE_UNTIL)) { if(!item.containsValue(Task.HIDE_UNTIL)) {
int setting = preferences.getIntegerFromString(R.string.p_default_hideUntil_key, int setting = preferences.getIntegerFromString(R.string.p_default_hideUntil_key,
Task.HIDE_UNTIL_NONE); Task.HIDE_UNTIL_NONE);

@ -28,20 +28,20 @@ import timber.log.Timber;
*/ */
abstract public class RemoteModel extends AbstractModel { abstract public class RemoteModel extends AbstractModel {
public RemoteModel() { RemoteModel() {
super(); super();
} }
public RemoteModel(TodorooCursor<? extends AbstractModel> cursor) { RemoteModel(TodorooCursor<? extends AbstractModel> cursor) {
super(cursor); super(cursor);
} }
public RemoteModel(AbstractModel model) { RemoteModel(AbstractModel model) {
super(model); super(model);
} }
/** remote id property common to all remote models */ /** remote id property common to all remote models */
public static final String UUID_PROPERTY_NAME = "remoteId"; //$NON-NLS-1$ static final String UUID_PROPERTY_NAME = "remoteId"; //$NON-NLS-1$
/** remote id property */ /** remote id property */
public static final StringProperty UUID_PROPERTY = new StringProperty(null, UUID_PROPERTY_NAME); public static final StringProperty UUID_PROPERTY = new StringProperty(null, UUID_PROPERTY_NAME);
@ -59,7 +59,7 @@ abstract public class RemoteModel extends AbstractModel {
} }
} }
protected String getUuidHelper(StringProperty uuid) { String getUuidHelper(StringProperty uuid) {
if(setValues != null && setValues.containsKey(uuid.name)) { if(setValues != null && setValues.containsKey(uuid.name)) {
return setValues.getAsString(uuid.name); return setValues.getAsString(uuid.name);
} else if(values != null && values.containsKey(uuid.name)) { } else if(values != null && values.containsKey(uuid.name)) {

@ -33,7 +33,7 @@ public final class TaskAttachment extends RemoteModel {
TABLE, ID_PROPERTY_NAME); TABLE, ID_PROPERTY_NAME);
/** Remote id */ /** Remote id */
public static final StringProperty UUID = new StringProperty( private static final StringProperty UUID = new StringProperty(
TABLE, UUID_PROPERTY_NAME); TABLE, UUID_PROPERTY_NAME);
/** Task uuid */ /** Task uuid */
@ -41,7 +41,7 @@ public final class TaskAttachment extends RemoteModel {
TABLE, "task_id"); TABLE, "task_id");
/** File name */ /** File name */
public static final StringProperty NAME = new StringProperty( private static final StringProperty NAME = new StringProperty(
TABLE, "name"); TABLE, "name");
/** File path (on local storage) */ /** File path (on local storage) */
@ -107,11 +107,11 @@ public final class TaskAttachment extends RemoteModel {
public static final Creator<TaskAttachment> CREATOR = new ModelCreator<>(TaskAttachment.class); public static final Creator<TaskAttachment> CREATOR = new ModelCreator<>(TaskAttachment.class);
public void setDeletedAt(Long deletedAt) { private void setDeletedAt(Long deletedAt) {
setValue(DELETED_AT, deletedAt); setValue(DELETED_AT, deletedAt);
} }
public void setTaskUUID(String taskUuid) { private void setTaskUUID(String taskUuid) {
setValue(TASK_UUID, taskUuid); setValue(TASK_UUID, taskUuid);
} }
@ -119,7 +119,7 @@ public final class TaskAttachment extends RemoteModel {
return getValue(NAME); return getValue(NAME);
} }
public void setName(String name) { private void setName(String name) {
setValue(NAME, name); setValue(NAME, name);
} }

@ -29,11 +29,11 @@ public final class TaskListMetadata extends RemoteModel {
// --- properties // --- properties
/** ID */ /** ID */
public static final LongProperty ID = new LongProperty( private static final LongProperty ID = new LongProperty(
TABLE, ID_PROPERTY_NAME); TABLE, ID_PROPERTY_NAME);
/** Remote id */ /** Remote id */
public static final StringProperty UUID = new StringProperty( private static final StringProperty UUID = new StringProperty(
TABLE, UUID_PROPERTY_NAME); TABLE, UUID_PROPERTY_NAME);
/** Tag UUID */ /** Tag UUID */

@ -24,11 +24,11 @@ public class UserActivity extends RemoteModel {
// --- properties // --- properties
/** ID */ /** ID */
public static final LongProperty ID = new LongProperty( private static final LongProperty ID = new LongProperty(
TABLE, ID_PROPERTY_NAME); TABLE, ID_PROPERTY_NAME);
/** Remote ID */ /** Remote ID */
public static final StringProperty UUID = new StringProperty( private static final StringProperty UUID = new StringProperty(
TABLE, UUID_PROPERTY_NAME); TABLE, UUID_PROPERTY_NAME);
/** Action */ /** Action */
@ -36,11 +36,11 @@ public class UserActivity extends RemoteModel {
TABLE, "action"); TABLE, "action");
/** Message */ /** Message */
public static final StringProperty MESSAGE = new StringProperty( private static final StringProperty MESSAGE = new StringProperty(
TABLE, "message"); TABLE, "message");
/** Picture */ /** Picture */
public static final StringProperty PICTURE = new StringProperty( private static final StringProperty PICTURE = new StringProperty(
TABLE, "picture", Property.PROP_FLAG_JSON | Property.PROP_FLAG_PICTURE); TABLE, "picture", Property.PROP_FLAG_JSON | Property.PROP_FLAG_PICTURE);
/** Target id */ /** Target id */

@ -257,7 +257,7 @@ public class FilesControlSet extends TaskEditControlFragment {
} }
} }
public void createNewFileAttachment(String path, String fileName, String fileType) { private void createNewFileAttachment(String path, String fileName, String fileType) {
TaskAttachment attachment = TaskAttachment.createNewAttachment(taskUuid, path, fileName, fileType); TaskAttachment attachment = TaskAttachment.createNewAttachment(taskUuid, path, fileName, fileType);
taskAttachmentDao.createNew(attachment); taskAttachmentDao.createNew(attachment);
addAttachment(attachment); addAttachment(attachment);

@ -51,7 +51,7 @@ public class GCalHelper {
cr = context.getContentResolver(); cr = context.getContentResolver();
} }
public String getTaskEventUri(Task task) { private String getTaskEventUri(Task task) {
String uri; String uri;
if (!TextUtils.isEmpty(task.getCalendarURI())) { if (!TextUtils.isEmpty(task.getCalendarURI())) {
uri = task.getCalendarURI(); uri = task.getCalendarURI();
@ -86,7 +86,7 @@ public class GCalHelper {
return createTaskEvent(task, values, true); return createTaskEvent(task, values, true);
} }
public Uri createTaskEvent(Task task, ContentValues values, boolean deleteEventIfExists) { private Uri createTaskEvent(Task task, ContentValues values, boolean deleteEventIfExists) {
if (!permissionChecker.canAccessCalendars()) { if (!permissionChecker.canAccessCalendars()) {
return null; return null;
} }

@ -44,7 +44,7 @@ public class GtasksList {
return storeObject.getValue(StoreObject.ITEM); return storeObject.getValue(StoreObject.ITEM);
} }
public void setRemoteId(String remoteId) { private void setRemoteId(String remoteId) {
storeObject.setValue(StoreObject.ITEM, remoteId); storeObject.setValue(StoreObject.ITEM, remoteId);
} }

@ -21,7 +21,7 @@ public class GtasksPreferenceService {
private final Preferences preferences; private final Preferences preferences;
public static final String IDENTIFIER = "gtasks"; //$NON-NLS-1$ private static final String IDENTIFIER = "gtasks"; //$NON-NLS-1$
private static final String PREF_DEFAULT_LIST = IDENTIFIER + "_defaultlist"; //$NON-NLS-1$ private static final String PREF_DEFAULT_LIST = IDENTIFIER + "_defaultlist"; //$NON-NLS-1$
private static final String PREF_USER_NAME = IDENTIFIER + "_user"; //$NON-NLS-1$ private static final String PREF_USER_NAME = IDENTIFIER + "_user"; //$NON-NLS-1$
@ -47,9 +47,9 @@ public class GtasksPreferenceService {
preferences.setString(PREF_USER_NAME, userName); preferences.setString(PREF_USER_NAME, userName);
} }
protected static final String PREF_LAST_SYNC = "_last_sync"; //$NON-NLS-1$ private static final String PREF_LAST_SYNC = "_last_sync"; //$NON-NLS-1$
protected static final String PREF_ONGOING = "_ongoing"; //$NON-NLS-1$ private static final String PREF_ONGOING = "_ongoing"; //$NON-NLS-1$
/** @return Last Successful Sync Date, or 0 */ /** @return Last Successful Sync Date, or 0 */
public long getLastSyncDate() { public long getLastSyncDate() {

@ -14,7 +14,7 @@ import com.todoroo.astrid.data.Metadata;
* @author Tim Su <tim@todoroo.com> * @author Tim Su <tim@todoroo.com>
* *
*/ */
public class NoteMetadata { class NoteMetadata {
/** metadata key */ /** metadata key */
public static final String METADATA_KEY = "note"; //$NON-NLS-1$ public static final String METADATA_KEY = "note"; //$NON-NLS-1$

@ -50,9 +50,9 @@ import timber.log.Timber;
*/ */
public class Astrid2TaskProvider extends InjectingContentProvider { public class Astrid2TaskProvider extends InjectingContentProvider {
public static final String AUTHORITY = "org.tasks.tasksprovider"; private static final String AUTHORITY = "org.tasks.tasksprovider";
public static final Uri CONTENT_URI = Uri.parse("content://org.tasks.tasksprovider"); private static final Uri CONTENT_URI = Uri.parse("content://org.tasks.tasksprovider");
private static final UriMatcher URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH); private static final UriMatcher URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
@ -71,10 +71,10 @@ public class Astrid2TaskProvider extends InjectingContentProvider {
private final static String TAGS_ID = "tags_id"; private final static String TAGS_ID = "tags_id";
static String[] TASK_FIELD_LIST = new String[] { NAME, IMPORTANCE_COLOR, PREFERRED_DUE_DATE, DEFINITE_DUE_DATE, private static String[] TASK_FIELD_LIST = new String[] { NAME, IMPORTANCE_COLOR, PREFERRED_DUE_DATE, DEFINITE_DUE_DATE,
IMPORTANCE, IDENTIFIER, TAGS_ID }; IMPORTANCE, IDENTIFIER, TAGS_ID };
static String[] TAGS_FIELD_LIST = new String[] { ID, NAME }; private static String[] TAGS_FIELD_LIST = new String[] { ID, NAME };
private static final int URI_TASKS = 0; private static final int URI_TASKS = 0;
private static final int URI_TAGS = 1; private static final int URI_TAGS = 1;
@ -122,7 +122,7 @@ public class Astrid2TaskProvider extends InjectingContentProvider {
* *
* @return two-column cursor: tag id (string) and tag name * @return two-column cursor: tag id (string) and tag name
*/ */
public Cursor getTags() { private Cursor getTags() {
TagData[] tags = tagService.get().getGroupedTags(TagService.GROUPED_TAGS_BY_SIZE, TagData[] tags = tagService.get().getGroupedTags(TagService.GROUPED_TAGS_BY_SIZE,
Criterion.all); Criterion.all);
@ -167,7 +167,7 @@ public class Astrid2TaskProvider extends InjectingContentProvider {
* *
* @return cursor as described above * @return cursor as described above
*/ */
public Cursor getTasks() { private Cursor getTasks() {
MatrixCursor ret = new MatrixCursor(TASK_FIELD_LIST); MatrixCursor ret = new MatrixCursor(TASK_FIELD_LIST);

@ -46,7 +46,7 @@ public final class ReminderService {
// --- constants // --- constants
public static final Property<?>[] NOTIFICATION_PROPERTIES = new Property<?>[] { private static final Property<?>[] NOTIFICATION_PROPERTIES = new Property<?>[] {
Task.ID, Task.ID,
Task.CREATION_DATE, Task.CREATION_DATE,
Task.COMPLETION_DATE, Task.COMPLETION_DATE,
@ -125,7 +125,7 @@ public final class ReminderService {
scheduleAlarm(task, taskDao); scheduleAlarm(task, taskDao);
} }
public void clearAllAlarms(Task task) { private void clearAllAlarms(Task task) {
scheduler.createAlarm(context, task, NO_ALARM, TYPE_SNOOZE); scheduler.createAlarm(context, task, NO_ALARM, TYPE_SNOOZE);
scheduler.createAlarm(context, task, NO_ALARM, TYPE_RANDOM); scheduler.createAlarm(context, task, NO_ALARM, TYPE_RANDOM);
scheduler.createAlarm(context, task, NO_ALARM, TYPE_DUE); scheduler.createAlarm(context, task, NO_ALARM, TYPE_DUE);

@ -80,12 +80,12 @@ public class RepeatControlSet extends TaskEditControlFragment {
// --- spinner constants // --- spinner constants
public static final int INTERVAL_DAYS = 0; private static final int INTERVAL_DAYS = 0;
public static final int INTERVAL_WEEKS = 1; private static final int INTERVAL_WEEKS = 1;
public static final int INTERVAL_MONTHS = 2; private static final int INTERVAL_MONTHS = 2;
public static final int INTERVAL_HOURS = 3; private static final int INTERVAL_HOURS = 3;
public static final int INTERVAL_MINUTES = 4; private static final int INTERVAL_MINUTES = 4;
public static final int INTERVAL_YEARS = 5; private static final int INTERVAL_YEARS = 5;
private static final int TYPE_DUE_DATE = 0; private static final int TYPE_DUE_DATE = 0;
private static final int TYPE_COMPLETION_DATE = 1; private static final int TYPE_COMPLETION_DATE = 1;
@ -413,7 +413,7 @@ public class RepeatControlSet extends TaskEditControlFragment {
updateRepeatUntilOptions(); updateRepeatUntilOptions();
} }
protected void repeatValueClick() { private void repeatValueClick() {
int dialogValue = repeatValue; int dialogValue = repeatValue;
if(dialogValue == 0) { if(dialogValue == 0) {
dialogValue = 1; dialogValue = 1;
@ -443,7 +443,7 @@ public class RepeatControlSet extends TaskEditControlFragment {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
} }
protected void refreshDisplayView() { private void refreshDisplayView() {
if (doRepeat) { if (doRepeat) {
displayView.setText(getRepeatString()); displayView.setText(getRepeatString());
displayView.setTextColor(getColor(context, R.color.text_primary)); displayView.setTextColor(getColor(context, R.color.text_primary));

@ -97,11 +97,11 @@ public class RepeatTaskCompleteListener extends InjectingBroadcastReceiver {
component.inject(this); component.inject(this);
} }
static boolean repeatFinished(long newDueDate, long repeatUntil) { private static boolean repeatFinished(long newDueDate, long repeatUntil) {
return repeatUntil > 0 && newDateTime(newDueDate).startOfDay().isAfter(newDateTime(repeatUntil).startOfDay()); return repeatUntil > 0 && newDateTime(newDueDate).startOfDay().isAfter(newDateTime(repeatUntil).startOfDay());
} }
public static void rescheduleTask(GCalHelper gcalHelper, TaskService taskService, Task task, long newDueDate) { private static void rescheduleTask(GCalHelper gcalHelper, TaskService taskService, Task task, long newDueDate) {
task.setReminderSnooze(0L); task.setReminderSnooze(0L);
task.setCompletionDate(0L); task.setCompletionDate(0L);
task.setDueDateAdjustingHideUntil(newDueDate); task.setDueDateAdjustingHideUntil(newDueDate);
@ -273,7 +273,7 @@ public class RepeatTaskCompleteListener extends InjectingBroadcastReceiver {
} }
} }
static long handleSubdayRepeat(DateTime startDate, RRule rrule) { private static long handleSubdayRepeat(DateTime startDate, RRule rrule) {
long millis; long millis;
switch(rrule.getFreq()) { switch(rrule.getFreq()) {
case HOURLY: case HOURLY:

@ -29,7 +29,7 @@ import timber.log.Timber;
public class StartupService { public class StartupService {
public static final int V4_8_0 = 380; private static final int V4_8_0 = 380;
private final Context context; private final Context context;
private final Database database; private final Database database;

@ -142,7 +142,7 @@ public class AstridOrderedListFragmentHelper<LIST> implements OrderedListFragmen
indent(which, -1); indent(which, -1);
} }
protected void indent(int which, int delta) { void indent(int which, int delta) {
String targetTaskId = taskAdapter.getItemUuid(which); String targetTaskId = taskAdapter.getItemUuid(which);
if (!RemoteModel.isValidUuid(targetTaskId)) { if (!RemoteModel.isValidUuid(targetTaskId)) {
return; // This can happen with gestures on empty parts of the list (e.g. extra space below tasks) return; // This can happen with gestures on empty parts of the list (e.g. extra space below tasks)

@ -21,7 +21,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
private final TaskService taskService; private final TaskService taskService;
public AstridOrderedListUpdater(TaskService taskService) { AstridOrderedListUpdater(TaskService taskService) {
this.taskService = taskService; this.taskService = taskService;
idToNode = new HashMap<>(); idToNode = new HashMap<>();
} }
@ -135,7 +135,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
return ids.toArray(new String[ids.size()]); return ids.toArray(new String[ids.size()]);
} }
public String getOrderString() { String getOrderString() {
String[] ids = getOrderedIds(); String[] ids = getOrderedIds();
return buildOrderString(ids); return buildOrderString(ids);
} }
@ -414,7 +414,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
} }
} }
protected String serializeTree() { String serializeTree() {
return serializeTree(treeRoot); return serializeTree(treeRoot);
} }

@ -138,7 +138,7 @@ public class SubtasksHelper {
T getKeyFromOldUuid(String uuid); T getKeyFromOldUuid(String uuid);
} }
public static <T> void remapTree(Node root, HashMap<T, String> idMap, TreeRemapHelper<T> helper) { private static <T> void remapTree(Node root, HashMap<T, String> idMap, TreeRemapHelper<T> helper) {
ArrayList<Node> children = root.children; ArrayList<Node> children = root.children;
for (int i = 0; i < children.size(); i++) { for (int i = 0; i < children.size(); i++) {
Node child = children.get(i); Node child = children.get(i);

@ -16,7 +16,7 @@ public abstract class SubtasksUpdater<T> extends AstridOrderedListUpdater<T> {
public static final String ACTIVE_TASKS_ORDER = "active_tasks_order"; //$NON-NLS-1$ public static final String ACTIVE_TASKS_ORDER = "active_tasks_order"; //$NON-NLS-1$
public static final String TODAY_TASKS_ORDER = "today_tasks_order"; //$NON-NLS-1$ public static final String TODAY_TASKS_ORDER = "today_tasks_order"; //$NON-NLS-1$
public SubtasksUpdater(TaskService taskService) { SubtasksUpdater(TaskService taskService) {
super(taskService); super(taskService);
} }
@ -27,7 +27,7 @@ public abstract class SubtasksUpdater<T> extends AstridOrderedListUpdater<T> {
} }
@Override @Override
public void applyToFilter(Filter filter) { protected void applyToFilter(Filter filter) {
String query = filter.getSqlQuery(); String query = filter.getSqlQuery();
query = query.replaceAll("ORDER BY .*", ""); query = query.replaceAll("ORDER BY .*", "");

@ -277,7 +277,7 @@ public final class TagsControlSet extends TaskEditControlFragment {
} }
/** Adds a tag to the tag field */ /** Adds a tag to the tag field */
void addTag(String tagName) { private void addTag(String tagName) {
LayoutInflater inflater = getActivity().getLayoutInflater(); LayoutInflater inflater = getActivity().getLayoutInflater();
// check if already exists // check if already exists
@ -373,7 +373,7 @@ public final class TagsControlSet extends TaskEditControlFragment {
return !existingSet.equals(selectedSet); return !existingSet.equals(selectedSet);
} }
protected void refreshDisplayView() { private void refreshDisplayView() {
selectedTags = getSelectedTags(); selectedTags = getSelectedTags();
CharSequence tagString = buildTagString(); CharSequence tagString = buildTagString();
if (TextUtils.isEmpty(tagString)) { if (TextUtils.isEmpty(tagString)) {

@ -69,7 +69,7 @@ public class TimerControlSet extends TaskEditControlFragment {
private TimeDurationControlSet estimated; private TimeDurationControlSet estimated;
private TimeDurationControlSet elapsed; private TimeDurationControlSet elapsed;
private long timerStarted; private long timerStarted;
protected AlertDialog dialog; private AlertDialog dialog;
private View dialogView; private View dialogView;
private int elapsedSeconds; private int elapsedSeconds;
private int estimatedSeconds; private int estimatedSeconds;

@ -337,7 +337,7 @@ public class DraggableListView extends ListView {
} }
} }
protected void initiateDrag(MotionEvent ev) { private void initiateDrag(MotionEvent ev) {
int x = (int) mTouchCurrentX; int x = (int) mTouchCurrentX;
int y = (int) mTouchCurrentY; int y = (int) mTouchCurrentY;
int itemNum = pointToPosition(x, y); int itemNum = pointToPosition(x, y);

@ -298,7 +298,7 @@ public class HideUntilControlSet extends TaskEditControlFragment implements OnIt
refreshDisplayView(); refreshDisplayView();
} }
public void setCustomDate(long timestamp) { private void setCustomDate(long timestamp) {
updateSpinnerOptions(timestamp); updateSpinnerOptions(timestamp);
spinner.setSelection(0); spinner.setSelection(0);
refreshDisplayView(); refreshDisplayView();

@ -9,8 +9,8 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView; import android.widget.TextView;
public class MultilineHelper { class MultilineHelper {
protected static void makeMultiline(View view) { static void makeMultiline(View view) {
if (view instanceof ViewGroup) { if (view instanceof ViewGroup) {
ViewGroup grp = (ViewGroup) view; ViewGroup grp = (ViewGroup) view;

@ -22,7 +22,7 @@ import java.util.LinkedList;
import java.util.List; import java.util.List;
/** Dialog box with an arbitrary number of number pickers */ /** Dialog box with an arbitrary number of number pickers */
public class NNumberPickerDialog extends AlertDialog implements OnClickListener { class NNumberPickerDialog extends AlertDialog implements OnClickListener {
public interface OnNNumberPickedListener { public interface OnNNumberPickedListener {
void onNumbersPicked(int[] number); void onNumbersPicked(int[] number);

@ -77,7 +77,7 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
this(context, null); this(context, null);
} }
protected int getLayout() { private int getLayout() {
return R.layout.number_picker; return R.layout.number_picker;
} }
@ -85,7 +85,7 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
* @return The number of allowable digits that can be typed in (-1 for unlimited) * @return The number of allowable digits that can be typed in (-1 for unlimited)
* e.g. return 2 if you don't want to allow 00002 even if 2 is in range. * e.g. return 2 if you don't want to allow 00002 even if 2 is in range.
*/ */
protected int getMaxDigits() { private int getMaxDigits() {
return -1; return -1;
} }
@ -217,7 +217,7 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
} }
public void updateView() { private void updateView() {
/* /*
* If we don't have displayed values then use the current number else * If we don't have displayed values then use the current number else
@ -297,7 +297,7 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
private final NumberPickerButton mIncrementButton; private final NumberPickerButton mIncrementButton;
private final NumberPickerButton mDecrementButton; private final NumberPickerButton mDecrementButton;
class NumberPickerInputFilter implements InputFilter { private class NumberPickerInputFilter implements InputFilter {
@Override @Override
public CharSequence filter(CharSequence source, int start, int end, public CharSequence filter(CharSequence source, int start, int end,
Spanned dest, int dstart, int dend) { Spanned dest, int dstart, int dend) {
@ -306,7 +306,7 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
} }
} }
class NumberRangeKeyListener extends NumberKeyListener { private class NumberRangeKeyListener extends NumberKeyListener {
@Override @Override
protected char[] getAcceptedChars() { protected char[] getAcceptedChars() {

@ -21,7 +21,7 @@ import org.tasks.R;
* @author Tim Su <tim@todoroo.com> * @author Tim Su <tim@todoroo.com>
* *
*/ */
public class RandomReminderControlSet { class RandomReminderControlSet {
private int selectedIndex; private int selectedIndex;
private final int[] hours; private final int[] hours;

@ -276,19 +276,19 @@ public class ReminderControlSet extends TaskEditControlFragment {
} }
} }
public void addAlarmRow(final Long timestamp) { private void addAlarmRow(final Long timestamp) {
addAlarmRow(getLongDateStringWithTime(context, timestamp), v -> alarms.remove(timestamp)); addAlarmRow(getLongDateStringWithTime(context, timestamp), v -> alarms.remove(timestamp));
alarms.add(timestamp); alarms.add(timestamp);
} }
public void pickLocation() { private void pickLocation() {
Intent intent = PlacePicker.getIntent(getActivity()); Intent intent = PlacePicker.getIntent(getActivity());
if (intent != null) { if (intent != null) {
startActivityForResult(intent, REQUEST_LOCATION_REMINDER); startActivityForResult(intent, REQUEST_LOCATION_REMINDER);
} }
} }
public void addGeolocationReminder(final Geofence geofence) { private void addGeolocationReminder(final Geofence geofence) {
addAlarmRow(geofence.getName(), v -> geofences.remove(geofence)); addAlarmRow(geofence.getName(), v -> geofences.remove(geofence));
geofences.add(geofence); geofences.add(geofence);
} }

@ -58,7 +58,7 @@ public class Broadcaster {
sendOrderedBroadcast(intent, null); sendOrderedBroadcast(intent, null);
} }
void sendOrderedBroadcast(Intent intent, String permissions) { private void sendOrderedBroadcast(Intent intent, String permissions) {
context.sendOrderedBroadcast(intent, permissions); context.sendOrderedBroadcast(intent, permissions);
} }

@ -22,9 +22,9 @@ public class FilterSelectionActivity extends InjectingAppCompatActivity {
public static final String EXTRA_RETURN_FILTER = "extra_include_filter"; public static final String EXTRA_RETURN_FILTER = "extra_include_filter";
public static final String EXTRA_FILTER = "extra_filter"; public static final String EXTRA_FILTER = "extra_filter";
public static final String EXTRA_FILTER_NAME = "extra_filter_name"; private static final String EXTRA_FILTER_NAME = "extra_filter_name";
public static final String EXTRA_FILTER_SQL = "extra_filter_query"; private static final String EXTRA_FILTER_SQL = "extra_filter_query";
public static final String EXTRA_FILTER_VALUES = "extra_filter_values"; private static final String EXTRA_FILTER_VALUES = "extra_filter_values";
@Inject FilterProvider filterProvider; @Inject FilterProvider filterProvider;
@Inject FilterCounter filterCounter; @Inject FilterCounter filterCounter;

@ -21,7 +21,7 @@ public class ExportTasksDialog extends InjectingNativeDialogFragment {
@Inject DialogBuilder dialogBuilder; @Inject DialogBuilder dialogBuilder;
@Inject TasksXmlExporter tasksXmlExporter; @Inject TasksXmlExporter tasksXmlExporter;
ProgressDialog progressDialog; private ProgressDialog progressDialog;
@NonNull @NonNull
@Override @Override

@ -21,7 +21,7 @@ public class ImportTasksDialog extends InjectingNativeDialogFragment {
return importTasksDialog; return importTasksDialog;
} }
public static final String EXTRA_PATH = "extra_path"; private static final String EXTRA_PATH = "extra_path";
@Inject TasksXmlImporter xmlImporter; @Inject TasksXmlImporter xmlImporter;
@Inject DialogBuilder dialogBuilder; @Inject DialogBuilder dialogBuilder;

@ -36,7 +36,7 @@ public class FilterCounter {
this(taskDao, new ThreadPoolExecutor(0, 1, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<>())); this(taskDao, new ThreadPoolExecutor(0, 1, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<>()));
} }
FilterCounter(TaskDao taskDao, ExecutorService executorService) { private FilterCounter(TaskDao taskDao, ExecutorService executorService) {
this.taskDao = taskDao; this.taskDao = taskDao;
this.executorService = executorService; this.executorService = executorService;
} }

@ -38,7 +38,7 @@ public class NavigationDrawerAction extends FilterListItem {
} }
@Override @Override
public void readFromParcel(Parcel source) { protected void readFromParcel(Parcel source) {
super.readFromParcel(source); super.readFromParcel(source);
intent = source.readParcelable(Intent.class.getClassLoader()); intent = source.readParcelable(Intent.class.getClassLoader());
requestCode = source.readInt(); requestCode = source.readInt();

@ -8,7 +8,7 @@ import org.tasks.locale.Locale;
public abstract class InjectingAppCompatActivity extends AppCompatActivity implements InjectingActivity { public abstract class InjectingAppCompatActivity extends AppCompatActivity implements InjectingActivity {
private ActivityComponent activityComponent; private ActivityComponent activityComponent;
public InjectingAppCompatActivity() { protected InjectingAppCompatActivity() {
Locale.getInstance(this).applyOverrideConfiguration(this); Locale.getInstance(this).applyOverrideConfiguration(this);
} }

@ -5,7 +5,7 @@ import android.content.Intent;
public abstract class InjectingIntentService extends IntentService { public abstract class InjectingIntentService extends IntentService {
public InjectingIntentService(String name) { protected InjectingIntentService(String name) {
super(name); super(name);
} }

@ -19,5 +19,5 @@ public abstract class InjectingListFragment extends ListFragment {
} }
} }
public abstract void inject(FragmentComponent component); protected abstract void inject(FragmentComponent component);
} }

@ -24,9 +24,9 @@ public abstract class InjectingPreferenceActivity extends AppCompatPreferenceAct
private ActivityComponent activityComponent; private ActivityComponent activityComponent;
protected Toolbar toolbar; private Toolbar toolbar;
public InjectingPreferenceActivity() { protected InjectingPreferenceActivity() {
Locale.getInstance(this).applyOverrideConfiguration(this); Locale.getInstance(this).applyOverrideConfiguration(this);
} }
@ -87,7 +87,7 @@ public abstract class InjectingPreferenceActivity extends AppCompatPreferenceAct
remove(getPreferenceScreen(), resIds); remove(getPreferenceScreen(), resIds);
} }
protected void remove(PreferenceGroup preferenceGroup, int[] resIds) { private void remove(PreferenceGroup preferenceGroup, int[] resIds) {
for (int resId : resIds) { for (int resId : resIds) {
preferenceGroup.removePreference(findPreference(resId)); preferenceGroup.removePreference(findPreference(resId));
} }

@ -13,7 +13,7 @@ public abstract class ThemedInjectingAppCompatActivity extends AppCompatActivity
@Inject Theme theme; @Inject Theme theme;
public ThemedInjectingAppCompatActivity() { protected ThemedInjectingAppCompatActivity() {
Locale.getInstance(this).applyOverrideConfiguration(this); Locale.getInstance(this).applyOverrideConfiguration(this);
} }

@ -24,7 +24,7 @@ public class TaskIntents {
return taskListIntent; return taskListIntent;
} }
public static Intent getEditTaskIntent(Context context, final Filter filter, final long taskId) { private static Intent getEditTaskIntent(Context context, final Filter filter, final long taskId) {
Intent taskListIntent = getTaskListIntent(context, filter); Intent taskListIntent = getTaskListIntent(context, filter);
taskListIntent.putExtra(TaskListActivity.OPEN_TASK, taskId); taskListIntent.putExtra(TaskListActivity.OPEN_TASK, taskId);
return taskListIntent; return taskListIntent;

@ -68,7 +68,7 @@ public class Locale {
private final int directionOverride; private final int directionOverride;
private final boolean hasUserOverrides; private final boolean hasUserOverrides;
public Locale(java.util.Locale deviceLocale, String languageOverride, int directionOverride) { private Locale(java.util.Locale deviceLocale, String languageOverride, int directionOverride) {
this.deviceLocale = deviceLocale; this.deviceLocale = deviceLocale;
this.languageOverride = languageOverride; this.languageOverride = languageOverride;
this.directionOverride = directionOverride; this.directionOverride = directionOverride;

@ -6,7 +6,7 @@ import com.todoroo.astrid.data.Metadata;
import static com.todoroo.andlib.data.Property.DoubleProperty; import static com.todoroo.andlib.data.Property.DoubleProperty;
import static com.todoroo.andlib.data.Property.StringProperty; import static com.todoroo.andlib.data.Property.StringProperty;
public class GeofenceFields { class GeofenceFields {
public static final String METADATA_KEY = "geofence"; public static final String METADATA_KEY = "geofence";

@ -12,7 +12,7 @@ public abstract class PermissionRequestor {
private final PermissionChecker permissionChecker; private final PermissionChecker permissionChecker;
public PermissionRequestor(PermissionChecker permissionChecker) { PermissionRequestor(PermissionChecker permissionChecker) {
this.permissionChecker = permissionChecker; this.permissionChecker = permissionChecker;
} }

@ -36,7 +36,7 @@ public class Preferences {
private static final String PREF_SORT_SORT = "sort_sort"; //$NON-NLS-1$ private static final String PREF_SORT_SORT = "sort_sort"; //$NON-NLS-1$
protected final Context context; private final Context context;
private final PermissionChecker permissionChecker; private final PermissionChecker permissionChecker;
private final SharedPreferences prefs; private final SharedPreferences prefs;
private final SharedPreferences publicPrefs; private final SharedPreferences publicPrefs;
@ -189,7 +189,7 @@ public class Preferences {
} }
} }
public boolean notificationsEnabled() { private boolean notificationsEnabled() {
return getBoolean(R.string.p_rmd_enabled, true); return getBoolean(R.string.p_rmd_enabled, true);
} }

@ -20,9 +20,9 @@ public class ListNotificationReceiver extends InjectingBroadcastReceiver {
private static ExecutorService executorService = Executors.newSingleThreadExecutor(); private static ExecutorService executorService = Executors.newSingleThreadExecutor();
public static final String EXTRA_FILTER_TITLE = "extra_filter_title"; private static final String EXTRA_FILTER_TITLE = "extra_filter_title";
public static final String EXTRA_FILTER_QUERY = "extra_filter_query"; private static final String EXTRA_FILTER_QUERY = "extra_filter_query";
public static final String EXTRA_FILTER_VALUES = "extra_filter_values"; private static final String EXTRA_FILTER_VALUES = "extra_filter_values";
@Inject Notifier notifier; @Inject Notifier notifier;
@Inject Tracker tracker; @Inject Tracker tracker;

@ -2,7 +2,7 @@ package org.tasks.reminders;
import org.tasks.time.DateTime; import org.tasks.time.DateTime;
public interface SnoozeCallback { interface SnoozeCallback {
void snoozeForTime(DateTime time); void snoozeForTime(DateTime time);

@ -25,7 +25,7 @@ public class CalendarNotificationIntentService extends RecurringIntervalIntentSe
private static final long FIFTEEN_MINUTES = TimeUnit.MINUTES.toMillis(15); private static final long FIFTEEN_MINUTES = TimeUnit.MINUTES.toMillis(15);
public static final String URI_PREFIX = "cal-reminder"; private static final String URI_PREFIX = "cal-reminder";
public static final String URI_PREFIX_POSTPONE = "cal-postpone"; public static final String URI_PREFIX_POSTPONE = "cal-postpone";
@Inject Preferences preferences; @Inject Preferences preferences;

@ -21,7 +21,7 @@ public abstract class MidnightIntentService extends InjectingIntentService {
private final String name; private final String name;
public MidnightIntentService(String name) { MidnightIntentService(String name) {
super(name); super(name);
this.name = name; this.name = name;
} }
@ -55,7 +55,7 @@ public abstract class MidnightIntentService extends InjectingIntentService {
abstract void run(); abstract void run();
protected String getLastRunPreference() { String getLastRunPreference() {
return null; return null;
} }
} }

@ -21,7 +21,7 @@ public abstract class RecurringIntervalIntentService extends InjectingIntentServ
@Inject Preferences preferences; @Inject Preferences preferences;
@Inject AlarmManager alarmManager; @Inject AlarmManager alarmManager;
public RecurringIntervalIntentService(String name) { RecurringIntervalIntentService(String name) {
super(name); super(name);
} }

@ -10,7 +10,7 @@ import org.tasks.R;
public class ThemeBase { public class ThemeBase {
public static final int[] THEMES = new int[]{ private static final int[] THEMES = new int[]{
R.style.TasksOverride, R.style.TasksOverride,
R.style.ThemeBlack, R.style.ThemeBlack,
R.style.TasksOverride, R.style.TasksOverride,

@ -110,7 +110,7 @@ public class ThemeColor {
return actionBarTint; return actionBarTint;
} }
public int getColorPrimaryDark() { private int getColorPrimaryDark() {
return colorPrimaryDark; return colorPrimaryDark;
} }

@ -51,7 +51,7 @@ public class DateTime {
this(timestamp, TimeZone.getDefault()); this(timestamp, TimeZone.getDefault());
} }
public DateTime(long timestamp, TimeZone timeZone) { private DateTime(long timestamp, TimeZone timeZone) {
this.timestamp = timestamp; this.timestamp = timestamp;
this.timeZone = timeZone; this.timeZone = timeZone;
} }

@ -1,5 +1,5 @@
package org.tasks.time; package org.tasks.time;
public interface MillisProvider { interface MillisProvider {
long getMillis(); long getMillis();
} }

@ -42,11 +42,11 @@ public class NavigationDrawerFragment extends InjectingFragment {
public static final int FRAGMENT_NAVIGATION_DRAWER = R.id.navigation_drawer; public static final int FRAGMENT_NAVIGATION_DRAWER = R.id.navigation_drawer;
public static final String TOKEN_LAST_SELECTED = "lastSelected"; //$NON-NLS-1$ private static final String TOKEN_LAST_SELECTED = "lastSelected"; //$NON-NLS-1$
public static final int REQUEST_NEW_LIST = 4; public static final int REQUEST_NEW_LIST = 4;
public FilterAdapter adapter = null; private FilterAdapter adapter = null;
private final RefreshReceiver refreshReceiver = new RefreshReceiver(); private final RefreshReceiver refreshReceiver = new RefreshReceiver();
@ -235,7 +235,7 @@ public class NavigationDrawerFragment extends InjectingFragment {
void onFilterItemClicked(FilterListItem item); void onFilterItemClicked(FilterListItem item);
} }
public void clear() { private void clear() {
adapter.clear(); adapter.clear();
} }

@ -12,7 +12,7 @@ import timber.log.Timber;
public abstract class ProgressDialogAsyncTask extends AsyncTask<Void, Void, Integer> { public abstract class ProgressDialogAsyncTask extends AsyncTask<Void, Void, Integer> {
ProgressDialog progressDialog; private ProgressDialog progressDialog;
private Activity activity; private Activity activity;
private DialogBuilder dialogBuilder; private DialogBuilder dialogBuilder;

@ -34,7 +34,7 @@ import timber.log.Timber;
import static android.support.v4.content.ContextCompat.getColor; import static android.support.v4.content.ContextCompat.getColor;
import static com.todoroo.andlib.utility.AndroidUtilities.atLeastJellybeanMR1; import static com.todoroo.andlib.utility.AndroidUtilities.atLeastJellybeanMR1;
public class ScrollableViewsFactory implements RemoteViewsService.RemoteViewsFactory { class ScrollableViewsFactory implements RemoteViewsService.RemoteViewsFactory {
private final WidgetCheckBoxes checkBoxes; private final WidgetCheckBoxes checkBoxes;
private final ThemeCache themeCache; private final ThemeCache themeCache;
@ -138,7 +138,7 @@ public class ScrollableViewsFactory implements RemoteViewsService.RemoteViewsFac
} }
} }
public RemoteViews buildUpdate(int position) { private RemoteViews buildUpdate(int position) {
try { try {
Task task = getTask(position); Task task = getTask(position);
if (task == null) { if (task == null) {
@ -230,7 +230,7 @@ public class ScrollableViewsFactory implements RemoteViewsService.RemoteViewsFac
return subtasksHelper.applySubtasksToWidgetFilter(filter, query, filter.listingTitle, 0); return subtasksHelper.applySubtasksToWidgetFilter(filter, query, filter.listingTitle, 0);
} }
public void formatDueDate(RemoteViews row, Task task, int textColor) { private void formatDueDate(RemoteViews row, Task task, int textColor) {
if (task.hasDueDate()) { if (task.hasDueDate()) {
Resources resources = context.getResources(); Resources resources = context.getResources();
row.setViewVisibility(R.id.widget_due_date, View.VISIBLE); row.setViewVisibility(R.id.widget_due_date, View.VISIBLE);

@ -5,46 +5,46 @@ import android.content.Context;
import org.tasks.R; import org.tasks.R;
import org.tasks.preferences.Preferences; import org.tasks.preferences.Preferences;
public class WidgetPreferences { class WidgetPreferences {
private final Context context; private final Context context;
private final Preferences preferences; private final Preferences preferences;
private final int widgetId; private final int widgetId;
public WidgetPreferences(Context context, Preferences preferences, int widgetId) { WidgetPreferences(Context context, Preferences preferences, int widgetId) {
this.context = context; this.context = context;
this.preferences = preferences; this.preferences = preferences;
this.widgetId = widgetId; this.widgetId = widgetId;
} }
public boolean showDueDate() { boolean showDueDate() {
return preferences.getBoolean(getKey(R.string.p_widget_show_due_date), true); return preferences.getBoolean(getKey(R.string.p_widget_show_due_date), true);
} }
public boolean showHeader() { boolean showHeader() {
return preferences.getBoolean(getKey(R.string.p_widget_show_header), true); return preferences.getBoolean(getKey(R.string.p_widget_show_header), true);
} }
public boolean showCheckboxes() { boolean showCheckboxes() {
return preferences.getBoolean(getKey(R.string.p_widget_show_checkboxes), true); return preferences.getBoolean(getKey(R.string.p_widget_show_checkboxes), true);
} }
public boolean showSettings() { boolean showSettings() {
return preferences.getBoolean(getKey(R.string.p_widget_show_settings), true); return preferences.getBoolean(getKey(R.string.p_widget_show_settings), true);
} }
public int getFontSize() { int getFontSize() {
return preferences.getInt(getKey(R.string.p_widget_font_size), 16); return preferences.getInt(getKey(R.string.p_widget_font_size), 16);
} }
public String getFilterId() { String getFilterId() {
return preferences.getStringValue(getKey(R.string.p_widget_filter)); return preferences.getStringValue(getKey(R.string.p_widget_filter));
} }
public int getThemeIndex() { int getThemeIndex() {
return preferences.getInt(getKey(R.string.p_widget_theme), 0); return preferences.getInt(getKey(R.string.p_widget_theme), 0);
} }
public int getColorIndex() { int getColorIndex() {
return preferences.getInt(getKey(R.string.p_widget_color), 0); return preferences.getInt(getKey(R.string.p_widget_color), 0);
} }
@ -56,7 +56,7 @@ public class WidgetPreferences {
preferences.setInt(getKey(R.string.p_widget_opacity), value); preferences.setInt(getKey(R.string.p_widget_opacity), value);
} }
public void setFontSize(int value) { void setFontSize(int value) {
preferences.setInt(getKey(R.string.p_widget_font_size), value); preferences.setInt(getKey(R.string.p_widget_font_size), value);
} }

Loading…
Cancel
Save