当前位置: 首页>>代码示例>>Java>>正文


Java RoboInjector类代码示例

本文整理汇总了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);
}
 
开发者ID:sourceallies,项目名称:zonebeacon,代码行数:9,代码来源:RoboAppCompatActivity.java

示例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));
}
 
开发者ID:AMOS-2015,项目名称:amos-ss15-proj2,代码行数:9,代码来源:AbstractRoboDrawerActivity.java

示例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));
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:9,代码来源:RoboAppCompatActivity.java

示例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;
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:35,代码来源:CacheManager.java

示例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));
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:9,代码来源:RoboSherlockAccountAuthenticatorActivity.java

示例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));
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:10,代码来源:RoboSherlockPreferenceActivity.java

示例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");
	}
}
 
开发者ID:Ecchilon,项目名称:SadPanda,代码行数:15,代码来源:HeaderView.java

示例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);
}
 
开发者ID:clintonhealthaccess,项目名称:chailmis-android,代码行数:11,代码来源:TestInjectionUtil.java

示例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);
}
 
开发者ID:CyberEagle,项目名称:AndroidTestLibrary,代码行数:8,代码来源:TestGuiceModule.java

示例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 ) );
}
 
开发者ID:metova,项目名称:roboguice-appcompat,代码行数:10,代码来源:RoboActionBarActivity.java

示例11: init

import roboguice.inject.RoboInjector; //导入依赖的package包/类
private void init() {
	if(!isInEditMode()) {
		RoboInjector injector = RoboGuice.getInjector(getContext());
		injector.injectMembersWithoutViews(this);
	}
}
 
开发者ID:Ecchilon,项目名称:SadPanda,代码行数:7,代码来源:HeaderView.java


注:本文中的roboguice.inject.RoboInjector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。