Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of interface for MVP architecture
interface MessageView {
// View methods should be directives, as the View is just executing orders from the
// Presenter.
// Methods for updating the view
void setMessageBody(String body);
void setAuthorName(String name);
void showTranslationButton(boolean shouldShow);
// Navigation methods
void goToUserProfile(User user);
}
interface MessagePresenter {
// Presenter methods should mostly be callbacks, as the View is reporting events for the
// Presenter to evaluate
// Lifecycle events methods
void onStart();
// Input events methods
void onAuthorClicked();
void onThreeFingersSwipe();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.