Inject remaining action bar activities

pull/143/head
Alex Baker 11 years ago
parent 7786dc89cf
commit 807db20d5a

@ -11,7 +11,6 @@ import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.Menu;
@ -23,8 +22,6 @@ import android.view.Window;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.ActFmCameraModule.CameraResultCallback;
@ -41,10 +38,13 @@ import com.todoroo.astrid.utility.AstridPreferences;
import org.json.JSONArray;
import org.json.JSONObject;
import org.tasks.R;
import org.tasks.injection.InjectingActionBarActivity;
import javax.inject.Inject;
import static android.support.v4.view.MenuItemCompat.setShowAsAction;
public class TagSettingsActivity extends ActionBarActivity {
public class TagSettingsActivity extends InjectingActionBarActivity {
public static final String TOKEN_NEW_FILTER = "newFilter"; //$NON-NLS-1$
@ -59,11 +59,9 @@ public class TagSettingsActivity extends ActionBarActivity {
private TagData tagData;
@Autowired TagService tagService;
@Autowired TagDataService tagDataService;
@Autowired TagMetadataDao tagMetadataDao;
@Inject TagService tagService;
@Inject TagDataService tagDataService;
@Inject TagMetadataDao tagMetadataDao;
private EditText tagName;
private Bitmap setBitmap;
@ -71,10 +69,6 @@ public class TagSettingsActivity extends ActionBarActivity {
private boolean isNewTag = false;
private boolean isDialog;
public TagSettingsActivity() {
DependencyInjectionService.getInstance().inject(this);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
setupForDialogOrFullscreen();

@ -16,7 +16,6 @@ import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
@ -30,9 +29,7 @@ import android.widget.ListView;
import android.widget.TextView;
import com.todoroo.andlib.data.Property.CountProperty;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Field;
import com.todoroo.andlib.sql.Query;
@ -53,6 +50,7 @@ import com.todoroo.astrid.service.ThemeService;
import com.todoroo.astrid.utility.AstridPreferences;
import org.tasks.R;
import org.tasks.injection.InjectingActionBarActivity;
import java.util.ArrayList;
import java.util.Collections;
@ -61,13 +59,15 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.inject.Inject;
/**
* Activity that allows users to build custom filters
*
* @author Tim Su <tim@todoroo.com>
*
*/
public class CustomFilterActivity extends ActionBarActivity {
public class CustomFilterActivity extends InjectingActionBarActivity {
private static final String IDENTIFIER_TITLE = "title"; //$NON-NLS-1$
private static final String IDENTIFIER_IMPORTANCE = "importance"; //$NON-NLS-1$
@ -145,9 +145,8 @@ public class CustomFilterActivity extends ActionBarActivity {
// --- activity
@Autowired Database database;
@Autowired StoreObjectDao storeObjectDao;
@Inject Database database;
@Inject StoreObjectDao storeObjectDao;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -165,7 +164,6 @@ public class CustomFilterActivity extends ActionBarActivity {
listView = (ListView) findViewById(android.R.id.list);
DependencyInjectionService.getInstance().inject(this);
database.openForReading();
populateCriteria();

@ -1,8 +1,10 @@
package org.tasks.injection;
import com.todoroo.astrid.actfm.TagSettingsActivity;
import com.todoroo.astrid.activity.ShareLinkActivity;
import com.todoroo.astrid.activity.TaskEditActivity;
import com.todoroo.astrid.activity.TaskListActivity;
import com.todoroo.astrid.core.CustomFilterActivity;
import dagger.Module;
@ -10,7 +12,9 @@ import dagger.Module;
injects = {
TaskListActivity.class,
TaskEditActivity.class,
ShareLinkActivity.class
ShareLinkActivity.class,
TagSettingsActivity.class,
CustomFilterActivity.class
})
public class ActivityModule {
}

Loading…
Cancel
Save