Search in sources :

Example 6 with RoboInjector

use of roboguice.inject.RoboInjector in project roboguice by roboguice.

the class RoboMapActivity method onCreate.

@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));
}
Also used : RoboInjector(roboguice.inject.RoboInjector) EventManager(roboguice.event.EventManager) MapActivity(com.google.android.maps.MapActivity) Activity(android.app.Activity)

Example 7 with RoboInjector

use of roboguice.inject.RoboInjector in project PocketHub by pockethub.

the class RoboAccountAuthenticatorAppCompatActivity method onCreate.

@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));
}
Also used : RoboInjector(roboguice.inject.RoboInjector) EventManager(roboguice.event.EventManager) OnCreateEvent(roboguice.activity.event.OnCreateEvent)

Example 8 with RoboInjector

use of roboguice.inject.RoboInjector in project edx-app-android by edx.

the class RoboAppCompatActivity method onCreate.

@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));
}
Also used : RoboInjector(roboguice.inject.RoboInjector) EventManager(roboguice.event.EventManager) AppCompatActivity(android.support.v7.app.AppCompatActivity) Activity(android.app.Activity)

Example 9 with RoboInjector

use of roboguice.inject.RoboInjector in project edx-app-android by edx.

the class CacheManager method convert.

/**
 * 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;
}
Also used : RoboInjector(roboguice.inject.RoboInjector) Matcher(java.util.regex.Matcher) Config(org.edx.mobile.util.Config) NonNull(android.support.annotation.NonNull)

Example 10 with RoboInjector

use of roboguice.inject.RoboInjector in project hubroid by EddieRingle.

the class RoboSherlockFragmentActivity method onCreate.

@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));
}
Also used : RoboInjector(roboguice.inject.RoboInjector) EventManager(roboguice.event.EventManager) OnCreateEvent(roboguice.activity.event.OnCreateEvent)

Aggregations

RoboInjector (roboguice.inject.RoboInjector)22 EventManager (roboguice.event.EventManager)21 Activity (android.app.Activity)17 OnCreateEvent (roboguice.activity.event.OnCreateEvent)3 AccountAuthenticatorActivity (android.accounts.AccountAuthenticatorActivity)2 PreferenceListener (roboguice.inject.PreferenceListener)2 ExpandableListActivity (android.app.ExpandableListActivity)1 LauncherActivity (android.app.LauncherActivity)1 ListActivity (android.app.ListActivity)1 TabActivity (android.app.TabActivity)1 PreferenceActivity (android.preference.PreferenceActivity)1 NonNull (android.support.annotation.NonNull)1 FragmentActivity (android.support.v4.app.FragmentActivity)1 ActionBarActivity (android.support.v7.app.ActionBarActivity)1 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 SherlockActivity (com.actionbarsherlock.app.SherlockActivity)1 SherlockFragmentActivity (com.actionbarsherlock.app.SherlockFragmentActivity)1 SherlockListActivity (com.actionbarsherlock.app.SherlockListActivity)1 SherlockPreferenceActivity (com.actionbarsherlock.app.SherlockPreferenceActivity)1 MapActivity (com.google.android.maps.MapActivity)1