Skip to content

Instantly share code, notes, and snippets.

@mitchtabian
Last active April 5, 2019 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitchtabian/c17289f5940bc2335760fd3b1566119d to your computer and use it in GitHub Desktop.
Save mitchtabian/c17289f5940bc2335760fd3b1566119d to your computer and use it in GitHub Desktop.
creates the "inject" method automatically with AndroidInjector<Class>
// *** Must specify specific TYPE here. 'BaseApplication', not 'Application'. Since it generates an inject(BaseApplication app); method.
public interface AppComponent extends AndroidInjector<BaseApplication> { // no need for inject method. It's generated.
LoginComponent.Builder newLoginComponentBuilder();
// void inject(BaseApplication application);
@Component.Builder
interface Builder {
@BindsInstance
Builder application(Application application);
AppComponent build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment