Skip to content

Instantly share code, notes, and snippets.

@lukaspili
Created March 6, 2015 23:02
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 lukaspili/2c9fac50d409280721a5 to your computer and use it in GitHub Desktop.
Save lukaspili/2c9fac50d409280721a5 to your computer and use it in GitHub Desktop.
public class SimpleView extends LinearLayout {
@Inject
SimpleScreen.Presenter presenter;
public SimpleView(Context context, AttributeSet attrs) {
super(context, attrs);
DaggerService.<SimpleScreen.Component>getDaggerComponent(context)
.inject(this);
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
presenter.takeView(this);
}
@Override
protected void onDetachedFromWindow() {
presenter.dropView(this);
super.onDetachedFromWindow();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
ButterKnife.inject(this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment