Removed warnings, killed dead code

pull/14/head
Tim Su 14 years ago
parent a24f3200f6
commit 243d0de6fc

@ -113,7 +113,7 @@ public class CustomFilterActivity extends ListActivity {
private CustomFilterAdapter adapter;
private final Map<String,CustomFilterCriterion> criteria = Collections.synchronizedMap(new LinkedHashMap<String,CustomFilterCriterion>());
private FilterCriteriaReceiver filterCriteriaReceiver = new FilterCriteriaReceiver();
private final FilterCriteriaReceiver filterCriteriaReceiver = new FilterCriteriaReceiver();
// --- activity
@ -303,7 +303,7 @@ public class CustomFilterActivity extends ListActivity {
menu.add(CustomFilterActivity.MENU_GROUP_FILTER,
i, 0, item.name);
} catch (NullPointerException e) {
throw new NullPointerException("One of the criteria is null. Criteria: " + criteria);
throw new NullPointerException("One of the criteria is null. Criteria: " + criteria); //$NON-NLS-1$
}
i++;
}
@ -448,6 +448,7 @@ public class CustomFilterActivity extends ListActivity {
adapter.notifyDataSetInvalidated();
}
@SuppressWarnings("nls")
private <V> V getNth(int index, Map<?,V> map) {
int i = 0;
for (V v : map.values()) {
@ -506,7 +507,7 @@ public class CustomFilterActivity extends ListActivity {
try {
addon = intent.getStringExtra(AstridApiConstants.EXTRAS_ADDON);
} catch (Exception e1) {
Log.e("receive-custom-filter-criteria-error-retrieving-addon",
Log.e("receive-custom-filter-criteria-error-retrieving-addon", //$NON-NLS-1$
e.toString(), e);
return;
}

@ -14,7 +14,6 @@ import android.widget.ExpandableListView;
import android.widget.LinearLayout;
import android.widget.Spinner;
import com.todoroo.astrid.service.StatisticsService;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.utility.AndroidUtilities;
@ -24,7 +23,7 @@ import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterCategory;
import com.todoroo.astrid.api.FilterListItem;
import com.todoroo.astrid.core.PluginServices;
import com.todoroo.astrid.utility.Constants;
import com.todoroo.astrid.service.StatisticsService;
import com.twofortyfouram.SharedResources;
/**

@ -267,7 +267,7 @@ public class ProducteevControlSet implements TaskEditControlSet {
// Erase PDTV-repeating-info if task itself is repeating with Astrid-repeat
if (task.containsNonNullValue(Task.RECURRENCE) && task.getValue(Task.RECURRENCE).length()>0) {
metadata.setValue(ProducteevTask.REPEATING_SETTING, "");
metadata.setValue(ProducteevTask.REPEATING_SETTING, ""); //$NON-NLS-1$
}
if(metadata.getSetValues().size() > 0) {

@ -31,6 +31,7 @@ public class ProducteevCustomFilterCriteriaExposer extends BroadcastReceiver {
private static final String IDENTIFIER_PRODUCTEEV_WORKSPACE = "producteev_workspace"; //$NON-NLS-1$
private static final String IDENTIFIER_PRODUCTEEV_ASSIGNEE = "producteev_assignee"; //$NON-NLS-1$
@SuppressWarnings("nls")
@Override
public void onReceive(Context context, Intent intent) {
// if we aren't logged in, don't expose features

@ -123,13 +123,10 @@ public class ProducteevFilterExposer extends BroadcastReceiver {
* @param dashboards
* @return people in a map of name => pair(dashboard id, user id)
*/
@SuppressWarnings("nls")
private TreeSet<ProducteevUser> loadResponsiblePeople(StoreObject[] dashboards) {
private TreeSet<ProducteevUser> loadResponsiblePeople(StoreObject[] dashboards) {
TreeSet<ProducteevUser> users = new TreeSet<ProducteevUser>();
for(StoreObject dashboard : dashboards) {
ProducteevDashboard elDashboard = new ProducteevDashboard(dashboard);
if(elDashboard == null)
continue;
users.addAll(elDashboard.getUsers());
}

@ -21,10 +21,10 @@ import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Join;
import com.todoroo.andlib.sql.Query;
import com.todoroo.astrid.core.PluginServices;
import com.todoroo.astrid.dao.StoreObjectDao;
import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.dao.MetadataDao.MetadataCriteria;
import com.todoroo.astrid.dao.StoreObjectDao;
import com.todoroo.astrid.dao.StoreObjectDao.StoreObjectCriteria;
import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.dao.TaskDao.TaskCriteria;
import com.todoroo.astrid.data.Metadata;
import com.todoroo.astrid.data.StoreObject;
@ -218,7 +218,7 @@ public final class ProducteevDataService {
public StoreObject[] readStoreObjects(String type) {
StoreObject[] ret;
TodorooCursor<StoreObject> cursor = storeObjectDao.query(Query.select(StoreObject.PROPERTIES).
where(StoreObjectCriteria.byType(ProducteevDashboard.TYPE)));
where(StoreObjectCriteria.byType(type)));
try {
ret = new StoreObject[cursor.getCount()];
for(int i = 0; i < ret.length; i++) {

@ -6,6 +6,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.BitmapDrawable;
import com.timsu.astrid.R;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Join;
@ -23,6 +24,7 @@ public class TagCustomFilterCriteriaExposer extends BroadcastReceiver {
private static final String IDENTIFIER_TAG_IS = "tag_is"; //$NON-NLS-1$
private static final String IDENTIFIER_TAG_CONTAINS = "tag_contains"; //$NON-NLS-1$
@SuppressWarnings("nls")
@Override
public void onReceive(Context context, Intent intent) {
Resources r = context.getResources();

@ -44,7 +44,7 @@ import com.todoroo.astrid.tags.TagService.Tag;
*/
public class TagFilterExposer extends BroadcastReceiver {
private static final String TAG = "tag";
private static final String TAG = "tag"; //$NON-NLS-1$
private TagService tagService;

@ -13,8 +13,8 @@ import org.weloveastrid.rmilk.MilkUtilities;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
@ -22,9 +22,9 @@ import android.net.Uri;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceCategory;
import android.preference.PreferenceScreen;
import android.preference.Preference.OnPreferenceClickListener;
import android.widget.Toast;
import com.timsu.astrid.R;
@ -58,8 +58,6 @@ public class EditPreferences extends TodorooPreferences {
private static final int POWER_PACK_PREFERENCE = 1;
private static final String METADATA_CATEGORY = "category";//$NON-NLS-1$
// --- instance variables
@Autowired private TaskService taskService; // for debugging

@ -4,9 +4,9 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map.Entry;
import java.util.Timer;
import java.util.TimerTask;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicReference;
import android.app.AlertDialog;
@ -30,28 +30,28 @@ import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnKeyListener;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View.OnClickListener;
import android.view.View.OnKeyListener;
import android.view.inputmethod.EditorInfo;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AbsListView.OnScrollListener;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.TextView.OnEditorActionListener;
import android.widget.Toast;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.Property;
@ -209,9 +209,6 @@ public class TaskListActivity extends ListActivity implements OnScrollListener,
if(database == null)
return;
// TODO: document debug code
//AndroidUtilities.copyDatabases(this, "/sdcard/dump"); // adb pull /sdcard/dump/database database
database.openForWriting();
setUpUiComponents();
onNewIntent(getIntent());
@ -948,6 +945,7 @@ public class TaskListActivity extends ListActivity implements OnScrollListener,
}
@Override
@SuppressWarnings("nls")
public boolean onMenuItemSelected(int featureId, final MenuItem item) {
Intent intent;
long itemId;
@ -972,7 +970,7 @@ public class TaskListActivity extends ListActivity implements OnScrollListener,
return true;
case MENU_HELP_ID:
intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://weloveastrid.com/help-user-guide-astrid-v3/active-tasks/"));
Uri.parse(Constants.HELP_URL));
startActivity(intent);
return true;
case MENU_ADDON_INTENT_ID:

@ -35,7 +35,6 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnCreateContextMenuListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.CheckBox;
import android.widget.CursorAdapter;
import android.widget.Filterable;
@ -728,10 +727,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
*/
public class TaskActionManager extends TaskAdapterAddOnManager<TaskAction> {
private final LinearLayout.LayoutParams params =
new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT, 1f);
private final Intent broadcastIntent = new Intent(AstridApiConstants.BROADCAST_REQUEST_ACTIONS);
public TaskActionManager() {
@ -864,31 +859,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
}
};
/*
private final class ActionClickListener implements View.OnClickListener {
private final TaskAction action;
private final ViewHolder viewHolder;
public ActionClickListener(TaskAction action, ViewHolder viewHolder) {
this.action = action;
this.viewHolder = viewHolder;
}
public void onClick(View v) {
flushSpecific(viewHolder.task.getId());
try {
action.intent.send();
} catch (Exception e) {
exceptionService.displayAndReportError(activity,
"Error launching action", e); //$NON-NLS-1$
}
decorationManager.request(viewHolder);
extendedDetailManager.request(viewHolder);
taskActionManager.request(viewHolder);
}
};
*/
private final class QuickActionListener implements OnQuickActionClickListener {
private final TaskAction action;
private final ViewHolder viewHolder;
@ -932,7 +902,8 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
private void prepareQuickActionBar(ViewHolder viewHolder, Collection<TaskAction> collection){
mBar = new QuickActionBar(viewHolder.view.getContext());
QuickAction editAction = new QuickAction(activity, R.drawable.tango_edit, " Edit ");
QuickAction editAction = new QuickAction(activity, R.drawable.tango_edit,
activity.getString(R.string.TAd_actionEditTask));
mBar.addQuickAction(editAction);
@ -965,10 +936,8 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
Collection<TaskAction> actions = taskActionManager.get(taskId);
prepareQuickActionBar(viewHolder, actions);
//mBarAnchor = v;
System.err.println("view is ID " + v.getId());
if(actions != null)
mBar.show(v);
System.err.println("! Request for " + taskId);
taskActionManager.request(viewHolder);

@ -7,13 +7,14 @@ import android.content.pm.ResolveInfo;
* @author joshuagross
*/
public class MetadataHelper {
private static final String CATEGORY_KEY = "category"; //$NON-NLS-1$
public static String resolveActivityCategoryName (ResolveInfo resolveInfo, PackageManager pm) {
// category - either from metadata, or the application name
String category = null;
String categoryKey = "category";
if (resolveInfo.activityInfo.metaData != null && resolveInfo.activityInfo.metaData.containsKey(categoryKey)) {
if (resolveInfo.activityInfo.metaData != null && resolveInfo.activityInfo.metaData.containsKey(CATEGORY_KEY)) {
int resource = resolveInfo.activityInfo.metaData.getInt(
categoryKey, -1);
CATEGORY_KEY, -1);
if (resource > -1) {
// category stored as integer in Manifest
try {
@ -25,7 +26,7 @@ public class MetadataHelper {
}
} else {
// category stored as String in Manifest
category = resolveInfo.activityInfo.metaData.getString(categoryKey);
category = resolveInfo.activityInfo.metaData.getString(CATEGORY_KEY);
}
}
// If category is null at this point, we use the name of the application this activity is found in

@ -31,6 +31,11 @@ public final class Constants {
*/
public static final boolean DEBUG = false;
/**
* Astrid Help URL
*/
public static final String HELP_URL = "http://weloveastrid.com/help-user-guide-astrid-v3/active-tasks/"; //$NON-NLS-1$
// --- notification id's
/** Notification Manager id for sync notifications */
@ -45,4 +50,5 @@ public final class Constants {
/** Notification Manager id for producteev notifications*/
public static final int NOTIFICATION_PRODUCTEEV_NOTIFICATIONS = -4;
}

Loading…
Cancel
Save