Remove unused code

pull/189/head
Alex Baker 11 years ago
parent d700a61555
commit 81d95d92b6

@ -6,7 +6,6 @@
package com.todoroo.astrid.api; package com.todoroo.astrid.api;
import android.app.Activity;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.Intent; import android.content.Intent;
@ -53,10 +52,6 @@ public class FilterWithCustomIntent extends Filter {
return intent; return intent;
} }
public void start(Activity activity, int resultCode) {
activity.startActivityForResult(getCustomIntent(), resultCode);
}
// --- parcelable // --- parcelable
/** /**

@ -206,10 +206,6 @@ public final class TagData extends RemoteModel {
} }
} }
public Long getCreationDate() {
return getValue(CREATION_DATE);
}
public String getName() { public String getName() {
return getValue(NAME); return getValue(NAME);
} }

@ -10,8 +10,6 @@ import com.todoroo.andlib.data.Table;
import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.api.AstridApiConstants;
import java.io.File;
public class UserActivity extends RemoteModel { public class UserActivity extends RemoteModel {
// --- table // --- table
@ -71,7 +69,6 @@ public class UserActivity extends RemoteModel {
// --- Action codes // --- Action codes
public static final String ACTION_TASK_COMMENT = "task_comment"; public static final String ACTION_TASK_COMMENT = "task_comment";
public static final String ACTION_TAG_COMMENT = "tag_comment";
public UserActivity(TodorooCursor<UserActivity> cursor) { public UserActivity(TodorooCursor<UserActivity> cursor) {
this(); this();

@ -9,20 +9,15 @@ import org.tasks.preferences.Preferences;
public class GtasksTestPreferenceService extends GtasksPreferenceService { public class GtasksTestPreferenceService extends GtasksPreferenceService {
private boolean loggedIn = false;
private long syncDate = 0; private long syncDate = 0;
public GtasksTestPreferenceService(Preferences preferences) { public GtasksTestPreferenceService(Preferences preferences) {
super(preferences); super(preferences);
} }
public void setLoggedIn(boolean loggedIn) {
this.loggedIn = loggedIn;
}
@Override @Override
public boolean isLoggedIn() { public boolean isLoggedIn() {
return loggedIn; return false;
} }
public void setSyncDate(long date) { public void setSyncDate(long date) {

@ -397,9 +397,6 @@
</intent-filter> </intent-filter>
</receiver> </receiver>
<activity
android:name="com.todoroo.astrid.gtasks.GtasksListAdder"
android:theme="@android:style/Theme.Dialog" />
<receiver android:name="com.todoroo.astrid.gtasks.GtasksDetailExposer"> <receiver android:name="com.todoroo.astrid.gtasks.GtasksDetailExposer">
<intent-filter> <intent-filter>
<action android:name="org.tasks.REQUEST_DETAILS" /> <action android:name="org.tasks.REQUEST_DETAILS" />

@ -87,7 +87,7 @@ public class TagViewFragment extends TaskListFragment {
*/ */
@Override @Override
protected View getListBody(ViewGroup root) { protected View getListBody(ViewGroup root) {
ViewGroup parent = (ViewGroup) getActivity().getLayoutInflater().inflate(getTaskListBodyLayout(), root, false); ViewGroup parent = (ViewGroup) getActivity().getLayoutInflater().inflate(R.layout.task_list_body_tag, root, false);
taskListView = super.getListBody(parent); taskListView = super.getListBody(parent);
parent.addView(taskListView); parent.addView(taskListView);
@ -95,10 +95,6 @@ public class TagViewFragment extends TaskListFragment {
return parent; return parent;
} }
protected int getTaskListBodyLayout() {
return R.layout.task_list_body_tag;
}
// --- data loading // --- data loading
@Override @Override

@ -74,7 +74,6 @@ public class FilterListFragment extends InjectingListFragment {
private static final int CONTEXT_MENU_INTENT = Menu.FIRST + 4; private static final int CONTEXT_MENU_INTENT = Menu.FIRST + 4;
public static final int REQUEST_CUSTOM_INTENT = 10; public static final int REQUEST_CUSTOM_INTENT = 10;
public static final int REQUEST_NEW_BUTTON = 3;
public static final int REQUEST_NEW_LIST = 4; public static final int REQUEST_NEW_LIST = 4;
// --- instance variables // --- instance variables
@ -119,14 +118,10 @@ public class FilterListFragment extends InjectingListFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
Activity activity = getActivity(); Activity activity = getActivity();
int layout = getLayout(); int layout = R.layout.filter_list_activity;
return activity.getLayoutInflater().inflate(layout, container, false); return activity.getLayoutInflater().inflate(layout, container, false);
} }
protected int getLayout() {
return R.layout.filter_list_activity;
}
@Override @Override
public void onActivityCreated(Bundle savedInstanceState) { public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);

@ -51,7 +51,6 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
// --- style constants // --- style constants
public int filterStyle = R.style.TextAppearance_FLA_Filter; public int filterStyle = R.style.TextAppearance_FLA_Filter;
public int headerStyle = R.style.TextAppearance_FLA_Header;
// --- instance variables // --- instance variables

@ -117,36 +117,6 @@ public class GtasksListService {
} }
} }
public StoreObject addNewList(com.google.api.services.tasks.model.TaskList newList) {
readLists();
if (lists != null) {
for (StoreObject list : lists) {
if (list.getValue(GtasksList.REMOTE_ID).equals(newList.getId())) //Sanity check--make sure it's actually a new list
{
return null;
}
}
}
StoreObject local = new StoreObject();
local.setType(GtasksList.TYPE);
local.setValue(GtasksList.REMOTE_ID, newList.getId());
local.setValue(GtasksList.NAME, newList.getTitle());
int order = lists == null ? 0 : lists.length;
local.setValue(GtasksList.ORDER, order);
storeObjectDao.persist(local);
clearListCache();
return local;
}
private void clearListCache() {
lists = null;
}
public StoreObject getList(String listId) { public StoreObject getList(String listId) {
readLists(); readLists();
for(StoreObject list : lists) { for(StoreObject list : lists) {
@ -156,5 +126,4 @@ public class GtasksListService {
} }
return LIST_NOT_FOUND_OBJECT; return LIST_NOT_FOUND_OBJECT;
} }
} }

@ -5,23 +5,10 @@
*/ */
package com.todoroo.astrid.gtasks.api; package com.todoroo.astrid.gtasks.api;
import android.text.TextUtils;
import java.io.IOException; import java.io.IOException;
public class GoogleTasksException extends IOException { public class GoogleTasksException extends IOException {
public GoogleTasksException(String message) {
private String type;
public GoogleTasksException(String message, String type) {
super(message); super(message);
this.type = type;
}
public String getType() {
if (!TextUtils.isEmpty(type)) {
return type;
}
return getMessage();
} }
} }

@ -99,14 +99,6 @@ public class GtasksInvoker {
.get(id)); .get(id));
} }
public TaskList createGtaskList(String title) throws IOException {
TaskList newList = new TaskList();
newList.setTitle(title);
return execute(service
.tasklists()
.insert(newList));
}
public com.google.api.services.tasks.model.Tasks getAllGtasksFromListId(String listId, boolean includeDeleted, boolean includeHidden, long lastSyncDate) throws IOException { public com.google.api.services.tasks.model.Tasks getAllGtasksFromListId(String listId, boolean includeDeleted, boolean includeHidden, long lastSyncDate) throws IOException {
return execute(service return execute(service
.tasks() .tasks()

@ -19,8 +19,6 @@ import com.todoroo.astrid.gtasks.GtasksPreferenceService;
import com.todoroo.astrid.gtasks.api.GoogleTasksException; import com.todoroo.astrid.gtasks.api.GoogleTasksException;
import com.todoroo.astrid.gtasks.api.GtasksInvoker; import com.todoroo.astrid.gtasks.api.GtasksInvoker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tasks.R; import org.tasks.R;
import java.io.IOException; import java.io.IOException;
@ -31,8 +29,6 @@ import javax.inject.Singleton;
@Singleton @Singleton
public class GtasksTokenValidator { public class GtasksTokenValidator {
private static final Logger log = LoggerFactory.getLogger(GtasksTokenValidator.class);
private static final String TOKEN_INTENT_RECEIVED = "intent!"; //$NON-NLS-1$ private static final String TOKEN_INTENT_RECEIVED = "intent!"; //$NON-NLS-1$
private static final int REVALIDATION_TRIES = 4; private static final int REVALIDATION_TRIES = 4;
@ -59,7 +55,7 @@ public class GtasksTokenValidator {
String accountName = preferences.getUserName(); String accountName = preferences.getUserName();
Account a = accountManager.getAccountByName(accountName); Account a = accountManager.getAccountByName(accountName);
if (a == null) { if (a == null) {
throw new GoogleTasksException(c.getString(R.string.gtasks_error_accountNotFound, accountName), "account-not-found"); throw new GoogleTasksException(c.getString(R.string.gtasks_error_accountNotFound, accountName));
} }
for (int i = 0; i < REVALIDATION_TRIES; i++) { for (int i = 0; i < REVALIDATION_TRIES; i++) {
@ -76,7 +72,7 @@ public class GtasksTokenValidator {
} }
} }
throw new GoogleTasksException(c.getString(R.string.gtasks_error_authRefresh), "auth-token-refresh"); throw new GoogleTasksException(c.getString(R.string.gtasks_error_authRefresh));
} }
private boolean testToken(String token) { private boolean testToken(String token) {
@ -98,7 +94,7 @@ public class GtasksTokenValidator {
throw new NullPointerException("Future result was null."); //$NON-NLS-1$ throw new NullPointerException("Future result was null."); //$NON-NLS-1$
} }
} catch (Exception e) { } catch (Exception e) {
throw new GoogleTasksException(e.getLocalizedMessage(), "future-error"); throw new GoogleTasksException(e.getLocalizedMessage());
} }
// check what kind of result was returned // check what kind of result was returned
@ -110,11 +106,11 @@ public class GtasksTokenValidator {
if (c instanceof Activity) { if (c instanceof Activity) {
c.startActivity(intent); c.startActivity(intent);
} else { } else {
throw new GoogleTasksException(c.getString(R.string.gtasks_error_background_sync_auth), "background-auth-error"); throw new GoogleTasksException(c.getString(R.string.gtasks_error_background_sync_auth));
} }
return TOKEN_INTENT_RECEIVED; return TOKEN_INTENT_RECEIVED;
} else { } else {
throw new GoogleTasksException(c.getString(R.string.gtasks_error_accountManager), "account-manager-error"); throw new GoogleTasksException(c.getString(R.string.gtasks_error_accountManager));
} }
return token; return token;
} }

@ -73,10 +73,6 @@ public class Preferences {
setDefaults(); setDefaults();
} }
public boolean isSet(String key) {
return prefs.contains(key);
}
public String getStringValue(String key) { public String getStringValue(String key) {
return prefs.getString(key, null); return prefs.getString(key, null);
} }
@ -100,10 +96,6 @@ public class Preferences {
} }
} }
public void setString(int resourceId, String value) {
setString(context.getString(resourceId), value);
}
public void setString(String key, String newValue) { public void setString(String key, String newValue) {
Editor editor = prefs.edit(); Editor editor = prefs.edit();
editor.putString(key, newValue); editor.putString(key, newValue);

@ -16,7 +16,6 @@
<attr name="asDueDateColor" format="color"/> <attr name="asDueDateColor" format="color"/>
<attr name="asDueDateOverdueColor" format="color"/> <attr name="asDueDateOverdueColor" format="color"/>
<attr name="asDueDateCompletedColor" format="color"/> <attr name="asDueDateCompletedColor" format="color"/>
<attr name="asFilterHeaderColor" format="color"/>
<attr name="asSeparatorBackground" format="color"/> <attr name="asSeparatorBackground" format="color"/>
<attr name="asListDividerColor" format="color"/> <attr name="asListDividerColor" format="color"/>
<attr name="asThemeTextColor" format="color"/> <attr name="asThemeTextColor" format="color"/>

@ -17,7 +17,6 @@
<item name="asDueDateColor">#878787</item> <item name="asDueDateColor">#878787</item>
<item name="asDueDateOverdueColor">#ee5555</item> <item name="asDueDateOverdueColor">#ee5555</item>
<item name="asDueDateCompletedColor">#ff777777</item> <item name="asDueDateCompletedColor">#ff777777</item>
<item name="asFilterHeaderColor">#cccccc</item>
<item name="asSeparatorBackground">#888888</item> <item name="asSeparatorBackground">#888888</item>
<item name="asListDividerColor">#555555</item> <item name="asListDividerColor">#555555</item>
<item name="asEditTextBackground">@null</item> <item name="asEditTextBackground">@null</item>
@ -78,7 +77,6 @@
<item name="asTextColorInverse">#ffffff</item> <item name="asTextColorInverse">#ffffff</item>
<item name="asDetailsColor">#6666aa</item> <item name="asDetailsColor">#6666aa</item>
<item name="asDueDateColor">#878787</item> <item name="asDueDateColor">#878787</item>
<item name="asFilterHeaderColor">#ffffff</item>
<item name="asListDividerColor">#dddddd</item> <item name="asListDividerColor">#dddddd</item>
<item name="asEditRowBackground">@drawable/task_edit_background_white</item> <item name="asEditRowBackground">@drawable/task_edit_background_white</item>
<item name="asFilterSelectedIcon">@drawable/filter_selected_icon_black</item> <item name="asFilterSelectedIcon">@drawable/filter_selected_icon_black</item>
@ -145,7 +143,6 @@
<item name="asDueDateColor">#ff7777aa</item> <item name="asDueDateColor">#ff7777aa</item>
<item name="asDueDateOverdueColor">#ffee5555</item> <item name="asDueDateOverdueColor">#ffee5555</item>
<item name="asDueDateCompletedColor">#ff777777</item> <item name="asDueDateCompletedColor">#ff777777</item>
<item name="asFilterHeaderColor">#ffcccccc</item>
<item name="asSeparatorBackground">#888888</item> <item name="asSeparatorBackground">#888888</item>
<!-- actionbar-styling --> <!-- actionbar-styling -->
<item name="android:actionBarStyle">@style/AstridV11ActionBarStyle.Dialog</item> <item name="android:actionBarStyle">@style/AstridV11ActionBarStyle.Dialog</item>
@ -183,7 +180,6 @@
<item name="asTextColor">#ff000000</item> <item name="asTextColor">#ff000000</item>
<item name="asDetailsColor">#ff6666aa</item> <item name="asDetailsColor">#ff6666aa</item>
<item name="asDueDateColor">#878787</item> <item name="asDueDateColor">#878787</item>
<item name="asFilterHeaderColor">#ffffff</item>
<!-- actionbar-styling --> <!-- actionbar-styling -->
<item name="android:actionBarStyle">@style/AstridV11ActionBarStyle.Dialog.Light</item> <item name="android:actionBarStyle">@style/AstridV11ActionBarStyle.Dialog.Light</item>
<item name="actionBarStyle">@style/AstridActionBarStyle.Dialog.Light</item> <item name="actionBarStyle">@style/AstridActionBarStyle.Dialog.Light</item>
@ -355,10 +351,6 @@
<item name="android:textColor">?attr/asTextColor</item> <item name="android:textColor">?attr/asTextColor</item>
</style> </style>
<style name="TextAppearance.FLA_Header" parent="TextAppearance.FLA_Filter">
<item name="android:textColor">?attr/asFilterHeaderColor</item>
</style>
<!-- ========================================================= Widget == --> <!-- ========================================================= Widget == -->
<style name="TextAppearance.Widget"> <style name="TextAppearance.Widget">

Loading…
Cancel
Save