Created
December 3, 2015 00:45
-
-
Save nbarraille/e9778750174df700dd72 to your computer and use it in GitHub Desktop.
Example of interface for MVP architecture
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
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