本文整理汇总了Java中roboguice.inject.RoboInjector类的典型用法代码示例。如果您正苦于以下问题:Java RoboInjector类的具体用法?Java RoboInjector怎么用?Java RoboInjector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RoboInjector类属于roboguice.inject包,在下文中一共展示了RoboInjector类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import roboguice.inject.RoboInjector; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
getDelegate().installViewFactory();
getDelegate().onCreate(savedInstanceState);
final RoboInjector injector = RoboGuice.getInjector(this);
injector.injectViewMembers(this);
super.onCreate(savedInstanceState);
}
示例2: onCreate
import roboguice.inject.RoboInjector; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
final RoboInjector injector = RoboGuice.getInjector(this);
eventManager = injector.getInstance(EventManager.class);
injector.injectMembersWithoutViews(this);
super.onCreate(savedInstanceState);
eventManager.fire(new OnCreateEvent<Activity>(this, savedInstanceState));
}
示例3: onCreate
import roboguice.inject.RoboInjector; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
final RoboInjector injector = RoboGuice.getInjector(this);
eventManager = injector.getInstance(EventManager.class);
injector.injectMembersWithoutViews(this);
super.onCreate(savedInstanceState);
eventManager.fire(new OnCreateEvent<Activity>(this, savedInstanceState));
}
示例4: convert
import roboguice.inject.RoboInjector; //导入依赖的package包/类
/**
* Convert the response URL from the new formats used in the Retrofit implementation, to the
* previous formats used in the original Apache HTTP client implementation, which was what
* populated this cache.
*
* @param url The URL to convert.
* @return The converted URL.
*/
@NonNull
private String convert(@NonNull final String url) {
/* The course structure URL was stripped of it's non-definitive query parameters before
* being stored in the cache, to prevent it not becoming non-accessible after internal API
* changes on the query parameters. The course ID parameter was retained, but not URL-
* escaped.
*/
if (courseStructureGetUrlConversionPattern == null) {
final RoboInjector injector = RoboGuice.getInjector(context);
final Config config = injector.getInstance(Config.class);
String baseUrl = config.getApiHostURL();
if (!baseUrl.endsWith("/")) {
baseUrl += '/';
}
courseStructureGetUrlConversionPattern = Pattern.compile("^(" + baseUrl +
"api/courses/v1/blocks/\\?)(?:[^=&;]+?=[^=&;]+?[&;])*?(course_id=)([^=&;]+)");
}
final Matcher urlMatcher = courseStructureGetUrlConversionPattern.matcher(url);
if (urlMatcher.matches()) {
final StringBuffer urlConversionBuffer = new StringBuffer(url.length());
urlMatcher.appendReplacement(urlConversionBuffer,
"$1$2" + Uri.decode(urlMatcher.group(3)));
return urlConversionBuffer.toString();
}
return url;
}
示例5: onCreate
import roboguice.inject.RoboInjector; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
final RoboInjector injector = RoboGuice.getInjector(this);
eventManager = injector.getInstance(EventManager.class);
injector.injectMembersWithoutViews(this);
super.onCreate(savedInstanceState);
eventManager.fire(new OnCreateEvent(savedInstanceState));
}
示例6: onCreate
import roboguice.inject.RoboInjector; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
final RoboInjector injector = RoboGuice.getInjector(this);
eventManager = injector.getInstance(EventManager.class);
preferenceListener = injector.getInstance(PreferenceListener.class);
injector.injectMembersWithoutViews(this);
super.onCreate(savedInstanceState);
eventManager.fire(new OnCreateEvent(savedInstanceState));
}
示例7: onFinishInflate
import roboguice.inject.RoboInjector; //导入依赖的package包/类
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if(!isInEditMode()) {
RoboInjector injector = RoboGuice.getInjector(getContext());
injector.injectViewMembers(this);
userName.setText(auth.getUserName());
}
else {
userName = (TextView) findViewById(R.id.username);
userName.setText("SadPanda user");
}
}
示例8: setUpInjection
import roboguice.inject.RoboInjector; //导入依赖的package包/类
public static void setUpInjection(Object testCase, Module mockedModule) {
Module customisedModule = override(newDefaultRoboModule(application)).with(new GuiceConfigurationModule());
if (mockedModule != null) {
customisedModule = override(customisedModule).with(mockedModule);
}
setBaseApplicationInjector(application, DEFAULT_STAGE, customisedModule);
RoboInjector injector = getInjector(application);
injector.injectMembersWithoutViews(testCase);
}
示例9: setUp
import roboguice.inject.RoboInjector; //导入依赖的package包/类
public static void setUp(Object testObject, TestGuiceModule module, Module productionModule) {
Module roboGuiceModule = RoboGuice.newDefaultRoboModule(Robolectric.application);
Module testModule = productionModule != null ? Modules.override(roboGuiceModule, productionModule, new RobolectricModule()).with(module) : Modules.override(roboGuiceModule, new RobolectricModule()).with(module);
RoboGuice.setBaseApplicationInjector(Robolectric.application, RoboGuice.DEFAULT_STAGE, testModule);
RoboInjector injector = RoboGuice.getInjector(Robolectric.application);
injector.injectMembers(testObject);
}
示例10: onCreate
import roboguice.inject.RoboInjector; //导入依赖的package包/类
@Override
protected void onCreate( Bundle savedInstanceState ) {
final RoboInjector injector = RoboGuice.getInjector( this );
eventManager = injector.getInstance( EventManager.class );
injector.injectMembersWithoutViews( this );
super.onCreate( savedInstanceState );
eventManager.fire( new OnCreateEvent( savedInstanceState ) );
}
示例11: init
import roboguice.inject.RoboInjector; //导入依赖的package包/类
private void init() {
if(!isInEditMode()) {
RoboInjector injector = RoboGuice.getInjector(getContext());
injector.injectMembersWithoutViews(this);
}
}