This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SampleActivity Extends BaseActivity | |
@Inject ScreenOnePresenter firstScreen | |
@Inject ScreenTwoPresenter secondScreen | |
@Inject SampleActivityModel model | |
onCreate() | |
{ | |
//put anything in model that needs to be shared between views | |
//things that normally get passed in intent between activities | |
firstScreen.inflateView() | |
} | |
@Onclick(R.id.button) | |
public void goToNextScreen() | |
{ | |
secondScreen.inflateView() | |
} | |
Public class ScreenOnePresenter implements Presenter | |
{ | |
@Inject Endpoints endpoints; | |
@Inject Activity activity; | |
@Inject Store store; | |
@Inject SampleActivityModel model; | |
@InjectView(R.id.view) | |
View view; | |
@InjectView(R.id.button_save) | |
Button saveButton; | |
inflateView() | |
{ | |
ButterKnife.inject(this, activity); | |
inflate the corresponding layout. | |
assignClickActions() | |
bindData() | |
} | |
private void bindData() | |
{ | |
//get data from store and model | |
//bind to views | |
} | |
} | |
Interface Presenter | |
{ | |
inflateView(); | |
bindData(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment