Apply inspections

pull/281/head
Alex Baker 9 years ago
parent 29b901c81b
commit 6acef7a37b

@ -160,7 +160,7 @@ public class TitleParserTest extends DatabaseTestCase {
// ----------------Days begin----------------// // ----------------Days begin----------------//
public void disabled_testDays() throws Exception{ public void disabled_testDays() {
Calendar today = Calendar.getInstance(); Calendar today = Calendar.getInstance();
Task task = new Task(); Task task = new Task();

@ -4,6 +4,7 @@ import android.support.v4.app.FragmentManager;
import org.tasks.location.OnLocationPickedHandler; import org.tasks.location.OnLocationPickedHandler;
@SuppressWarnings("EmptyMethod")
public class LocationPickerDialog { public class LocationPickerDialog {
public LocationPickerDialog(OnLocationPickedHandler onLocationPickedHandler) { public LocationPickerDialog(OnLocationPickedHandler onLocationPickedHandler) {

@ -4,6 +4,7 @@ import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
@SuppressWarnings("EmptyMethod")
public class GeofenceApi { public class GeofenceApi {
@Inject @Inject

@ -432,8 +432,8 @@ public class TouchListView extends ListView {
} }
public interface GrabberClickListener { public interface GrabberClickListener {
public void onClick(View v); void onClick(View v);
public void onLongClick(View v); void onLongClick(View v);
} }
public interface DropListener { public interface DropListener {

@ -32,10 +32,8 @@ public class DatabaseDao<TYPE extends AbstractModel> {
private static final Logger log = LoggerFactory.getLogger(DatabaseDao.class); private static final Logger log = LoggerFactory.getLogger(DatabaseDao.class);
private final Class<TYPE> modelClass; private final Class<TYPE> modelClass;
private final Table table;
private Table table; private final Database database;
private Database database;
public DatabaseDao(Database database, Class<TYPE> modelClass) { public DatabaseDao(Database database, Class<TYPE> modelClass) {
this.modelClass = modelClass; this.modelClass = modelClass;
@ -56,7 +54,7 @@ public class DatabaseDao<TYPE extends AbstractModel> {
// --- listeners // --- listeners
public interface ModelUpdateListener<MTYPE> { public interface ModelUpdateListener<MTYPE> {
public void onModelUpdated(MTYPE model); void onModelUpdated(MTYPE model);
} }
private final ArrayList<ModelUpdateListener<TYPE>> listeners = new ArrayList<>(); private final ArrayList<ModelUpdateListener<TYPE>> listeners = new ArrayList<>();
@ -214,7 +212,7 @@ public class DatabaseDao<TYPE extends AbstractModel> {
} }
private interface DatabaseChangeOp { private interface DatabaseChangeOp {
public boolean makeChange(); boolean makeChange();
} }
private boolean insertOrUpdateAndRecordChanges(TYPE item, DatabaseChangeOp op) { private boolean insertOrUpdateAndRecordChanges(TYPE item, DatabaseChangeOp op) {

@ -124,13 +124,13 @@ public abstract class Property<TYPE> extends Field implements Cloneable {
* *
*/ */
public interface PropertyVisitor<RETURN, PARAMETER> { public interface PropertyVisitor<RETURN, PARAMETER> {
public RETURN visitInteger(Property<Integer> property, PARAMETER data); RETURN visitInteger(Property<Integer> property, PARAMETER data);
public RETURN visitLong(Property<Long> property, PARAMETER data); RETURN visitLong(Property<Long> property, PARAMETER data);
public RETURN visitDouble(Property<Double> property, PARAMETER data); RETURN visitDouble(Property<Double> property, PARAMETER data);
public RETURN visitString(Property<String> property, PARAMETER data); RETURN visitString(Property<String> property, PARAMETER data);
} }
// --- children // --- children

@ -241,7 +241,7 @@ public class AndroidUtilities {
} }
public interface SerializedPut<T> { public interface SerializedPut<T> {
public void put(T object, String key, char type, String value) throws NumberFormatException; void put(T object, String key, char type, String value) throws NumberFormatException;
} }
private static <T> void fromSerialized(String string, T object, SerializedPut<T> putter) { private static <T> void fromSerialized(String string, T object, SerializedPut<T> putter) {
@ -294,19 +294,6 @@ public class AndroidUtilities {
return result; return result;
} }
/**
* Returns true if a and b or null or a.equals(b)
*/
public static boolean equals(Object a, Object b) {
if(a == null && b == null) {
return true;
}
if(a == null) {
return false;
}
return a.equals(b);
}
/** /**
* Copy a file from one place to another * Copy a file from one place to another
* @throws Exception * @throws Exception

@ -47,7 +47,7 @@ import javax.inject.Inject;
* @author Arne * @author Arne
* *
*/ */
public class AstridActivity extends InjectingAppCompatActivity public abstract class AstridActivity extends InjectingAppCompatActivity
implements NavigationDrawerFragment.OnFilterItemClickedListener, implements NavigationDrawerFragment.OnFilterItemClickedListener,
TaskListFragment.OnTaskListItemClickedListener { TaskListFragment.OnTaskListItemClickedListener {

@ -426,8 +426,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
Class<?> openControl = (Class<?>) getActivity().getIntent().getSerializableExtra(TOKEN_OPEN_CONTROL); Class<?> openControl = (Class<?>) getActivity().getIntent().getSerializableExtra(TOKEN_OPEN_CONTROL);
for (int i = 0; i < itemOrder.length; i++) { for (String item : itemOrder) {
String item = itemOrder[i];
if (item.equals(hideAlwaysTrigger)) { if (item.equals(hideAlwaysTrigger)) {
break; // As soon as we hit the hide section, we're done break; // As soon as we hit the hide section, we're done
} else { } else {

@ -195,10 +195,7 @@ public class TaskListFragment extends InjectingListFragment implements OnSortSel
TaskListFragment newFragment; TaskListFragment newFragment;
try { try {
newFragment = (TaskListFragment) component.newInstance(); newFragment = (TaskListFragment) component.newInstance();
} catch (java.lang.InstantiationException e) { } catch (java.lang.InstantiationException | IllegalAccessException e) {
log.error(e.getMessage(), e);
newFragment = new TaskListFragment();
} catch (IllegalAccessException e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
newFragment = new TaskListFragment(); newFragment = new TaskListFragment();
} }
@ -225,7 +222,7 @@ public class TaskListFragment extends InjectingListFragment implements OnSortSel
* does during the onAttach() callback * does during the onAttach() callback
*/ */
public interface OnTaskListItemClickedListener { public interface OnTaskListItemClickedListener {
public void onTaskListItemClicked(long taskId); void onTaskListItemClicked(long taskId);
} }
@Override @Override

@ -75,7 +75,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
private static final Logger log = LoggerFactory.getLogger(TaskAdapter.class); private static final Logger log = LoggerFactory.getLogger(TaskAdapter.class);
public interface OnCompletedTaskListener { public interface OnCompletedTaskListener {
public void onCompletedTask(Task item, boolean newState); void onCompletedTask(Task item, boolean newState);
} }
private static final StringProperty TAGS = new StringProperty(null, "group_concat(nullif(" + TaskListFragment.TAGS_METADATA_JOIN + "." + TaskToTagMetadata.TAG_NAME.name + ", '')"+ ", ' | ')").as("tags"); private static final StringProperty TAGS = new StringProperty(null, "group_concat(nullif(" + TaskListFragment.TAGS_METADATA_JOIN + "." + TaskToTagMetadata.TAG_NAME.name + ", '')"+ ", ' | ')").as("tags");

@ -219,7 +219,7 @@ public class TasksXmlExporter {
} }
} }
private synchronized void serializeMetadata(Task task) throws IOException { private synchronized void serializeMetadata(Task task) {
metadataDao.byTask(task.getId(), new Callback<Metadata>() { metadataDao.byTask(task.getId(), new Callback<Metadata>() {
@Override @Override
public void apply(Metadata metadata) { public void apply(Metadata metadata) {
@ -296,11 +296,7 @@ public class TasksXmlExporter {
xml.attribute(null, property.name, valueString); xml.attribute(null, property.name, valueString);
} catch (UnsupportedOperationException e) { } catch (UnsupportedOperationException e) {
// didn't read this value, do nothing // didn't read this value, do nothing
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException | IllegalStateException | IOException e) {
throw new RuntimeException(e);
} catch (IllegalStateException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
return null; return null;

@ -1,5 +1,5 @@
package com.todoroo.astrid.dao; package com.todoroo.astrid.dao;
public interface DatabaseUpdateListener { public interface DatabaseUpdateListener {
public void onDatabaseUpdated(); void onDatabaseUpdated();
} }

@ -209,7 +209,7 @@ public class TaskDao {
} }
} }
public boolean createNew(Task item) { public void createNew(Task item) {
if(!item.containsValue(Task.CREATION_DATE)) { if(!item.containsValue(Task.CREATION_DATE)) {
item.setCreationDate(DateUtilities.now()); item.setCreationDate(DateUtilities.now());
} }
@ -230,12 +230,9 @@ public class TaskDao {
setDefaultReminders(preferences, item); setDefaultReminders(preferences, item);
ContentValues values = item.getSetValues(); ContentValues values = item.getSetValues();
boolean result = dao.createNew(item); if(dao.createNew(item)) {
if(result) {
afterSave(item, values); afterSave(item, values);
} }
return result;
} }
public static void createDefaultHideUntil(Preferences preferences, Task item) { public static void createDefaultHideUntil(Preferences preferences, Task item) {
@ -260,21 +257,19 @@ public class TaskDao {
} }
} }
public boolean saveExisting(Task item) { public void saveExisting(Task item) {
ContentValues values = item.getSetValues(); ContentValues values = item.getSetValues();
if(values == null || values.size() == 0) { if(values == null || values.size() == 0) {
return false; return;
} }
if(!TaskApiDao.insignificantChange(values)) { if(!TaskApiDao.insignificantChange(values)) {
if(!values.containsKey(Task.MODIFICATION_DATE.name)) { if(!values.containsKey(Task.MODIFICATION_DATE.name)) {
item.setModificationDate(DateUtilities.now()); item.setModificationDate(DateUtilities.now());
} }
} }
boolean result = dao.saveExisting(item); if(dao.saveExisting(item)) {
if(result) {
afterSave(item, values); afterSave(item, values);
} }
return result;
} }
private static final Property<?>[] SQL_CONSTRAINT_MERGE_PROPERTIES = new Property<?>[] { private static final Property<?>[] SQL_CONSTRAINT_MERGE_PROPERTIES = new Property<?>[] {

@ -20,11 +20,11 @@ public class UserActivityDao {
dao = new RemoteModelDao<>(database, UserActivity.class); dao = new RemoteModelDao<>(database, UserActivity.class);
} }
public boolean createNew(UserActivity item) { public void createNew(UserActivity item) {
if (!item.containsValue(UserActivity.CREATED_AT)) { if (!item.containsValue(UserActivity.CREATED_AT)) {
item.setCreatedAt(DateUtilities.now()); item.setCreatedAt(DateUtilities.now());
} }
return dao.createNew(item); dao.createNew(item);
} }
public boolean saveExisting(UserActivity item) { public boolean saveExisting(UserActivity item) {

@ -171,8 +171,8 @@ public class FilesControlSet extends PopupControlSet {
} }
} }
public static interface PlaybackExceptionHandler { public interface PlaybackExceptionHandler {
public void playbackFailed(); void playbackFailed();
} }
private static void play(String file, PlaybackExceptionHandler handler) { private static void play(String file, PlaybackExceptionHandler handler) {

@ -55,7 +55,7 @@ public final class GtasksMetadataService {
* Clears metadata information. Used when user logs out of sync provider * Clears metadata information. Used when user logs out of sync provider
*/ */
public void clearMetadata() { public void clearMetadata() {
metadataDao.deleteWhere(Metadata.KEY.eq(getMetadataKey())); metadataDao.deleteWhere(Metadata.KEY.eq(GtasksMetadata.METADATA_KEY));
} }
/** /**
@ -64,7 +64,7 @@ public final class GtasksMetadataService {
public void saveTaskAndMetadata(GtasksTaskContainer task) { public void saveTaskAndMetadata(GtasksTaskContainer task) {
task.prepareForSaving(); task.prepareForSaving();
taskDao.save(task.task); taskDao.save(task.task);
synchronizeMetadata(task.task.getId(), task.metadata, getMetadataKey()); synchronizeMetadata(task.task.getId(), task.metadata, GtasksMetadata.METADATA_KEY);
} }
/** /**
@ -73,7 +73,7 @@ public final class GtasksMetadataService {
*/ */
public Metadata getTaskMetadata(long taskId) { public Metadata getTaskMetadata(long taskId) {
return metadataDao.getFirst(Query.select(Metadata.PROPERTIES).where( return metadataDao.getFirst(Query.select(Metadata.PROPERTIES).where(
MetadataCriteria.byTaskAndwithKey(taskId, getMetadataKey()))); MetadataCriteria.byTaskAndwithKey(taskId, GtasksMetadata.METADATA_KEY)));
} }
/** /**
@ -118,10 +118,6 @@ public final class GtasksMetadataService {
} }
} }
private String getMetadataKey() {
return GtasksMetadata.METADATA_KEY;
}
public synchronized void findLocalMatch(GtasksTaskContainer remoteTask) { public synchronized void findLocalMatch(GtasksTaskContainer remoteTask) {
if(remoteTask.task.getId() != Task.NO_ID) { if(remoteTask.task.getId() != Task.NO_ID) {
return; return;
@ -141,7 +137,7 @@ public final class GtasksMetadataService {
private Metadata getMetadataByGtaskId(String gtaskId) { private Metadata getMetadataByGtaskId(String gtaskId) {
return metadataDao.getFirst(Query.select(Metadata.PROPERTIES).where(Criterion.and( return metadataDao.getFirst(Query.select(Metadata.PROPERTIES).where(Criterion.and(
Metadata.KEY.eq(getMetadataKey()), Metadata.KEY.eq(GtasksMetadata.METADATA_KEY),
GtasksMetadata.ID.eq(gtaskId)))); GtasksMetadata.ID.eq(gtaskId))));
} }

@ -33,10 +33,6 @@ public class GtasksPreferenceService {
this.preferences = preferences; this.preferences = preferences;
} }
public String getIdentifier() {
return IDENTIFIER;
}
public String getDefaultList() { public String getDefaultList() {
return preferences.getStringValue(PREF_DEFAULT_LIST); return preferences.getStringValue(PREF_DEFAULT_LIST);
} }
@ -57,74 +53,52 @@ public class GtasksPreferenceService {
protected static final String PREF_LAST_SYNC = "_last_sync"; //$NON-NLS-1$ protected static final String PREF_LAST_SYNC = "_last_sync"; //$NON-NLS-1$
protected static final String PREF_LAST_ATTEMPTED_SYNC = "_last_attempted"; //$NON-NLS-1$
protected static final String PREF_LAST_ERROR = "_last_err"; //$NON-NLS-1$
protected static final String PREF_ONGOING = "_ongoing"; //$NON-NLS-1$ protected static final String PREF_ONGOING = "_ongoing"; //$NON-NLS-1$
/** /**
* @return true if we have a token for this user, false otherwise * @return true if we have a token for this user, false otherwise
*/ */
public boolean isLoggedIn() { public boolean isLoggedIn() {
return preferences.getStringValue(getIdentifier() + PREF_TOKEN) != null; return preferences.getStringValue(IDENTIFIER + PREF_TOKEN) != null;
} }
/** authentication token, or null if doesn't exist */ /** authentication token, or null if doesn't exist */
public String getToken() { public String getToken() {
return preferences.getStringValue(getIdentifier() + PREF_TOKEN); return preferences.getStringValue(IDENTIFIER + PREF_TOKEN);
} }
/** Sets the authentication token. Set to null to clear. */ /** Sets the authentication token. Set to null to clear. */
public void setToken(String setting) { public void setToken(String setting) {
preferences.setString(getIdentifier() + PREF_TOKEN, setting); preferences.setString(IDENTIFIER + PREF_TOKEN, setting);
} }
/** @return Last Successful Sync Date, or 0 */ /** @return Last Successful Sync Date, or 0 */
public long getLastSyncDate() { public long getLastSyncDate() {
return preferences.getLong(getIdentifier() + PREF_LAST_SYNC, 0); return preferences.getLong(IDENTIFIER + PREF_LAST_SYNC, 0);
}
/** @return Last Attempted Sync Date, or 0 if it was successful */
public long getLastAttemptedSyncDate() {
return preferences.getLong(getIdentifier() + PREF_LAST_ATTEMPTED_SYNC, 0);
}
/** @return Last Error, or null if no last error */
public String getLastError() {
return preferences.getStringValue(getIdentifier() + PREF_LAST_ERROR);
} }
/** @return Last Error, or null if no last error */ /** @return Last Error, or null if no last error */
public boolean isOngoing() { public boolean isOngoing() {
return preferences.getBoolean(getIdentifier() + PREF_ONGOING, false); return preferences.getBoolean(IDENTIFIER + PREF_ONGOING, false);
} }
/** Deletes Last Successful Sync Date */ /** Deletes Last Successful Sync Date */
public void clearLastSyncDate() { public void clearLastSyncDate() {
preferences.clear(getIdentifier() + PREF_LAST_SYNC); preferences.clear(IDENTIFIER + PREF_LAST_SYNC);
}
/** Set Last Error */
public void setLastError(String error) {
preferences.setString(getIdentifier() + PREF_LAST_ERROR, error);
} }
/** Set Ongoing */ /** Set Ongoing */
public void stopOngoing() { public void stopOngoing() {
preferences.setBoolean(getIdentifier() + PREF_ONGOING, false); preferences.setBoolean(IDENTIFIER + PREF_ONGOING, false);
} }
/** Set Last Successful Sync Date */ /** Set Last Successful Sync Date */
public void recordSuccessfulSync() { public void recordSuccessfulSync() {
preferences.setLong(getIdentifier() + PREF_LAST_SYNC, DateUtilities.now() + 1000); preferences.setLong(IDENTIFIER + PREF_LAST_SYNC, DateUtilities.now() + 1000);
preferences.setLong(getIdentifier() + PREF_LAST_ATTEMPTED_SYNC, 0);
} }
/** Set Last Attempted Sync Date */ /** Set Last Attempted Sync Date */
public void recordSyncStart() { public void recordSyncStart() {
preferences.setLong(getIdentifier() + PREF_LAST_ATTEMPTED_SYNC, DateUtilities.now()); preferences.setBoolean(IDENTIFIER + PREF_ONGOING, true);
preferences.clear(getIdentifier() + PREF_LAST_ERROR);
preferences.setBoolean(getIdentifier() + PREF_ONGOING, true);
} }
} }

@ -22,7 +22,7 @@ abstract public class OrderedMetadataListUpdater<LIST> {
private MetadataDao metadataDao; private MetadataDao metadataDao;
public interface OrderedListIterator { public interface OrderedListIterator {
public void processTask(long taskId, Metadata metadata); void processTask(long taskId, Metadata metadata);
} }
// --- abstract and empty // --- abstract and empty
@ -297,7 +297,7 @@ abstract public class OrderedMetadataListUpdater<LIST> {
// --- task cascading operations // --- task cascading operations
public interface OrderedListNodeVisitor { public interface OrderedListNodeVisitor {
public void visitNode(Node node); void visitNode(Node node);
} }
/** /**

@ -56,7 +56,6 @@ public class GtasksSyncV2Provider {
public class SyncExceptionHandler { public class SyncExceptionHandler {
public void handleException(String tag, Exception e) { public void handleException(String tag, Exception e) {
getUtilities().setLastError(e.toString());
log.error("{}: {}", tag, e.getMessage(), e); log.error("{}: {}", tag, e.getMessage(), e);
} }
} }
@ -64,7 +63,7 @@ public class GtasksSyncV2Provider {
private final SyncExceptionHandler handler = new SyncExceptionHandler(); private final SyncExceptionHandler handler = new SyncExceptionHandler();
private void finishSync(SyncResultCallback callback) { private void finishSync(SyncResultCallback callback) {
getUtilities().recordSuccessfulSync(); gtasksPreferenceService.recordSuccessfulSync();
callback.finished(); callback.finished();
} }
@ -111,10 +110,6 @@ public class GtasksSyncV2Provider {
return context.getString(R.string.gtasks_GPr_header); return context.getString(R.string.gtasks_GPr_header);
} }
public GtasksPreferenceService getUtilities() {
return gtasksPreferenceService;
}
public void signOut() { public void signOut() {
gtasksPreferenceService.clearLastSyncDate(); gtasksPreferenceService.clearLastSyncDate();
gtasksPreferenceService.setToken(null); gtasksPreferenceService.setToken(null);

@ -91,8 +91,8 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
private final List<UpdatesChangedListener> listeners = new LinkedList<>(); private final List<UpdatesChangedListener> listeners = new LinkedList<>();
public interface UpdatesChangedListener { public interface UpdatesChangedListener {
public void updatesChanged(); void updatesChanged();
public void commentAdded(); void commentAdded();
} }
public EditNoteActivity( public EditNoteActivity(

@ -384,7 +384,7 @@ public final class ReminderService {
* Interface for testing * Interface for testing
*/ */
public interface AlarmScheduler { public interface AlarmScheduler {
public void createAlarm(Context context, Task task, long time, int type); void createAlarm(Context context, Task task, long time, int type);
} }
public void setScheduler(AlarmScheduler scheduler) { public void setScheduler(AlarmScheduler scheduler) {

@ -7,6 +7,6 @@ package com.todoroo.astrid.reminders;
public interface SnoozeCallback { public interface SnoozeCallback {
public void snoozeForTime(long time); void snoozeForTime(long time);
} }

@ -17,7 +17,6 @@ import com.todoroo.andlib.data.DatabaseDao.ModelUpdateListener;
import com.todoroo.andlib.sql.Criterion; import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.astrid.backup.BackupConstants;
import com.todoroo.astrid.backup.TasksXmlImporter; import com.todoroo.astrid.backup.TasksXmlImporter;
import com.todoroo.astrid.dao.Database; import com.todoroo.astrid.dao.Database;
import com.todoroo.astrid.dao.DatabaseUpdateListener; import com.todoroo.astrid.dao.DatabaseUpdateListener;

@ -3,5 +3,5 @@ package com.todoroo.astrid.service;
import com.todoroo.astrid.data.Metadata; import com.todoroo.astrid.data.Metadata;
public interface SynchronizeMetadataCallback { public interface SynchronizeMetadataCallback {
public void beforeDeleteMetadata(Metadata m); void beforeDeleteMetadata(Metadata m);
} }

@ -236,8 +236,8 @@ public class TaskService {
* Parse quick add markup for the given task * Parse quick add markup for the given task
* @param tags an empty array to apply tags to * @param tags an empty array to apply tags to
*/ */
boolean parseQuickAddMarkup(Task task, ArrayList<String> tags) { void parseQuickAddMarkup(Task task, ArrayList<String> tags) {
return TitleParser.parse(tagService, task, tags); TitleParser.parse(tagService, task, tags);
} }
/** /**

@ -29,7 +29,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
} }
public interface OrderedListNodeVisitor { public interface OrderedListNodeVisitor {
public void visitNode(Node node); void visitNode(Node node);
} }
public static class Node { public static class Node {

@ -148,8 +148,8 @@ public class SubtasksHelper {
return AstridOrderedListUpdater.serializeTree(tree); return AstridOrderedListUpdater.serializeTree(tree);
} }
public static interface TreeRemapHelper<T> { public interface TreeRemapHelper<T> {
public T getKeyFromOldUuid(String uuid); T getKeyFromOldUuid(String uuid);
} }
public static <T> void remapTree(Node root, HashMap<T, String> idMap, TreeRemapHelper<T> helper) { public static <T> void remapTree(Node root, HashMap<T, String> idMap, TreeRemapHelper<T> helper) {

@ -9,10 +9,10 @@ public interface SyncResultCallback {
/** /**
* Provider started sync * Provider started sync
*/ */
public void started(); void started();
/** /**
* Provider finished sync * Provider finished sync
*/ */
public void finished(); void finished();
} }

@ -37,7 +37,7 @@ public class AstridTimePicker extends LinearLayout {
private boolean lastSelectionWasPm; // false for AM, true for PM private boolean lastSelectionWasPm; // false for AM, true for PM
public interface TimePickerEnabledChangedListener { public interface TimePickerEnabledChangedListener {
public void timePickerEnabledChanged(boolean hasTime); void timePickerEnabledChanged(boolean hasTime);
} }
public AstridTimePicker(Context context, AttributeSet attrs) { public AstridTimePicker(Context context, AttributeSet attrs) {

@ -73,7 +73,7 @@ public class CalendarView extends View {
private int currentHighlightDay = -1; private int currentHighlightDay = -1;
public interface OnSelectedDateListener { public interface OnSelectedDateListener {
public void onSelectedDate(Date date); void onSelectedDate(Date date);
} }
private OnSelectedDateListener onSelectedDateListener; private OnSelectedDateListener onSelectedDateListener;

@ -19,7 +19,7 @@ import org.tasks.preferences.ActivityPreferences;
public class DateAndTimeDialog extends Dialog { public class DateAndTimeDialog extends Dialog {
public interface DateAndTimeDialogListener { public interface DateAndTimeDialogListener {
public void onDateAndTimeSelected(long date); void onDateAndTimeSelected(long date);
} }
private final DateAndTimePicker dateAndTimePicker; private final DateAndTimePicker dateAndTimePicker;

@ -36,7 +36,8 @@ public abstract class PopupControlSet extends TaskEditControlSetBase {
final PopupDialogClickListener okListener = new PopupDialogClickListener() { final PopupDialogClickListener okListener = new PopupDialogClickListener() {
@Override @Override
public boolean onClick(DialogInterface d, int which) { public boolean onClick(DialogInterface d, int which) {
return onOkClick(); onOkClick();
return true;
} }
}; };
@ -133,13 +134,8 @@ public abstract class PopupControlSet extends TaskEditControlSetBase {
// Subclasses can override // Subclasses can override
} }
/** protected void onOkClick() {
* @return true if the dialog should be dismissed as the result of
* the click. Default is true.
*/
protected boolean onOkClick() {
refreshDisplayView(); refreshDisplayView();
return true;
} }
protected void onCancelClick() { protected void onCancelClick() {

@ -141,7 +141,7 @@ public class ReminderControlSet extends TaskEditControlSetBase implements Adapte
return alertItem; return alertItem;
} }
private View addAlarmRow(final View alertItem, String text, Long timestamp, final View.OnClickListener onRemove) { private void addAlarmRow(final View alertItem, String text, Long timestamp, final View.OnClickListener onRemove) {
alertItem.setTag(timestamp); alertItem.setTag(timestamp);
TextView display = (TextView) alertItem.findViewById(R.id.alarm_string); TextView display = (TextView) alertItem.findViewById(R.id.alarm_string);
display.setText(text); display.setText(text);
@ -156,7 +156,6 @@ public class ReminderControlSet extends TaskEditControlSetBase implements Adapte
} }
}); });
updateSpinner(); updateSpinner();
return alertItem;
} }
private void updateSpinner() { private void updateSpinner() {

@ -19,7 +19,7 @@ public class AACRecorder {
private AACRecorderCallbacks listener; private AACRecorderCallbacks listener;
public interface AACRecorderCallbacks { public interface AACRecorderCallbacks {
public void encodingFinished(); void encodingFinished();
} }
@TargetApi(Build.VERSION_CODES.GINGERBREAD_MR1) @TargetApi(Build.VERSION_CODES.GINGERBREAD_MR1)

@ -5,7 +5,7 @@ import android.os.Bundle;
import dagger.ObjectGraph; import dagger.ObjectGraph;
public class InjectingActivity extends Activity implements Injector { public abstract class InjectingActivity extends Activity implements Injector {
private ObjectGraph objectGraph; private ObjectGraph objectGraph;
@Override @Override

@ -5,7 +5,7 @@ import android.support.v7.app.AppCompatActivity;
import dagger.ObjectGraph; import dagger.ObjectGraph;
public class InjectingAppCompatActivity extends AppCompatActivity implements Injector { public abstract class InjectingAppCompatActivity extends AppCompatActivity implements Injector {
private ObjectGraph objectGraph; private ObjectGraph objectGraph;
@Override @Override

@ -3,7 +3,7 @@ package org.tasks.injection;
import android.app.IntentService; import android.app.IntentService;
import android.content.Intent; import android.content.Intent;
public class InjectingIntentService extends IntentService { public abstract class InjectingIntentService extends IntentService {
public InjectingIntentService(String name) { public InjectingIntentService(String name) {
super(name); super(name);

@ -5,7 +5,7 @@ import android.os.Bundle;
import dagger.ObjectGraph; import dagger.ObjectGraph;
public class InjectingListActivity extends ListActivity implements Injector { public abstract class InjectingListActivity extends ListActivity implements Injector {
private ObjectGraph objectGraph; private ObjectGraph objectGraph;
@Override @Override

@ -45,7 +45,6 @@ import org.tasks.injection.ForApplication;
import org.tasks.injection.InjectingFragment; import org.tasks.injection.InjectingFragment;
import org.tasks.preferences.AppearancePreferences; import org.tasks.preferences.AppearancePreferences;
import org.tasks.preferences.BasicPreferences; import org.tasks.preferences.BasicPreferences;
import org.tasks.preferences.Preferences;
import javax.inject.Inject; import javax.inject.Inject;
@ -85,7 +84,6 @@ public class NavigationDrawerFragment extends InjectingFragment {
private int mCurrentSelectedPosition = 0; private int mCurrentSelectedPosition = 0;
@Inject FilterCounter filterCounter; @Inject FilterCounter filterCounter;
@Inject Preferences preferences;
@Inject FilterProvider filterProvider; @Inject FilterProvider filterProvider;
@Inject @ForApplication Context context; @Inject @ForApplication Context context;
@ -383,7 +381,7 @@ public class NavigationDrawerFragment extends InjectingFragment {
} }
public interface OnFilterItemClickedListener { public interface OnFilterItemClickedListener {
public boolean onFilterItemClicked(FilterListItem item); boolean onFilterItemClicked(FilterListItem item);
} }
public void clear() { public void clear() {
@ -429,10 +427,6 @@ public class NavigationDrawerFragment extends InjectingFragment {
new IntentFilter(AstridApiConstants.BROADCAST_EVENT_REFRESH)); new IntentFilter(AstridApiConstants.BROADCAST_EVENT_REFRESH));
} }
public void restoreLastSelected() {
selectItem(mCurrentSelectedPosition);
}
/** /**
* Receiver which receives refresh intents * Receiver which receives refresh intents
* *

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

@ -204,10 +204,4 @@
<item name="android:textSize">18sp</item> <item name="android:textSize">18sp</item>
</style> </style>
<style name="Widget"/>
<style name="Widget.Holo"/>
<style name="Widget.Holo.Light"/>
<style name="Widget.Holo.Light.CompoundButton"/>
<style name="Widget.Holo.Light.CompoundButton.Switch"/>
</resources> </resources>

Loading…
Cancel
Save