Skip to content

Instantly share code, notes, and snippets.

@Diolor
Created March 18, 2017 02:36
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 Diolor/83556a405197b571274a6a47cce2dfb6 to your computer and use it in GitHub Desktop.
Save Diolor/83556a405197b571274a6a47cce2dfb6 to your computer and use it in GitHub Desktop.
FilterButtonActivity
class MyActivity extends Activity implements StateView<FilterButtonState> {
private Button button;
@Inject
FilterButtonPresenter presenter;
@Override
protected void onCreate(Bundle savedInstanceState) {
// set some content views
Component.activity(this).inject(this); // dagger 2 injection
presenter.start(this);
}
@Override
protected void onDestroy() {
presenter.stop();
}
@Override
public void updateState(FilterButtonState state) {
button.setEnabled(state.enabled);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment