mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Switched Roboguice/Guice out for Dagger 2
This commit is contained in:
@@ -14,6 +14,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.GridView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -42,9 +43,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import roboguice.RoboGuice;
|
||||
import roboguice.inject.InjectView;
|
||||
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
|
||||
@@ -60,33 +58,23 @@ public class NavDrawerActivity extends BriarFragmentActivity implements
|
||||
private ActionBarDrawerToggle drawerToggle;
|
||||
|
||||
@Inject
|
||||
private ReferenceManager referenceManager;
|
||||
protected ReferenceManager referenceManager;
|
||||
// Fields that are accessed from background threads must be volatile
|
||||
@Inject
|
||||
private volatile IdentityManager identityManager;
|
||||
protected volatile IdentityManager identityManager;
|
||||
@Inject
|
||||
private PluginManager pluginManager;
|
||||
protected PluginManager pluginManager;
|
||||
@Inject
|
||||
protected volatile EventBus eventBus;
|
||||
|
||||
@InjectView(R.id.toolbar)
|
||||
private Toolbar toolbar;
|
||||
@InjectView(R.id.drawer_layout)
|
||||
private DrawerLayout drawerLayout;
|
||||
@InjectView(R.id.nav_btn_contacts)
|
||||
private AppCompatButton contactButton;
|
||||
@InjectView(R.id.nav_btn_contacts)
|
||||
private AppCompatButton forumsButton;
|
||||
@InjectView(R.id.nav_btn_contacts)
|
||||
private AppCompatButton settingsButton;
|
||||
@InjectView(R.id.nav_menu_header)
|
||||
private TextView menuHeader;
|
||||
@InjectView(R.id.title_progress_bar)
|
||||
private TextView progressTitle;
|
||||
@InjectView(R.id.container_progress)
|
||||
ViewGroup progressViewGroup;
|
||||
@InjectView(R.id.transportsView)
|
||||
private Button contactButton;
|
||||
private Button forumsButton;
|
||||
private Button settingsButton;
|
||||
private GridView transportsView;
|
||||
private TextView progressTitle;
|
||||
private ViewGroup progressViewGroup;
|
||||
|
||||
private List<Transport> transports;
|
||||
private BaseAdapter transportsAdapter;
|
||||
@@ -104,6 +92,11 @@ public class NavDrawerActivity extends BriarFragmentActivity implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectActivity(AndroidComponent component) {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
@Override
|
||||
public void onCreate(Bundle state) {
|
||||
@@ -112,9 +105,16 @@ public class NavDrawerActivity extends BriarFragmentActivity implements
|
||||
if (isStartupFailed(getIntent()))
|
||||
return;
|
||||
|
||||
// TODO inflate and inject with @ContentView with RoboGuice 3.0 and later
|
||||
setContentView(R.layout.activity_nav_drawer);
|
||||
RoboGuice.getInjector(this).injectViewMembers(this);
|
||||
|
||||
toolbar = (Toolbar)findViewById(R.id.toolbar);
|
||||
drawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
|
||||
contactButton = (Button)findViewById(R.id.nav_btn_contacts);
|
||||
forumsButton = (Button)findViewById(R.id.nav_btn_forums);
|
||||
settingsButton = (Button)findViewById(R.id.nav_btn_settings);
|
||||
transportsView = (GridView)findViewById(R.id.transportsView);
|
||||
progressTitle = (TextView)findViewById(R.id.title_progress_bar);
|
||||
progressViewGroup = (ViewGroup)findViewById(R.id.container_progress);
|
||||
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
Reference in New Issue
Block a user