Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // его можно положить в ../presentation/contract
- public interface PhotosContract {
- interface Model {
- // Presenter -> Model
- void loadPhotos(Integer page);
- }
- interface View {
- // Presenter -> View
- void displayPhotos(List<Photo> photos);
- void displayError();
- }
- interface Presenter {
- // View -> Presenter
- void onViewCreated();
- void loadNextPhotos();
- void onViewDestroyed();
- // Model -> Presenter
- void onPhotosLoaded(List<Photo> photos);
- void onLoadFailure();
- }
- }
- ...
- class UnsplashService implements PhotosContract.Model {
- private PhotosContract.Presenter presenter;
- ...
- }
- class WPFragment extends Fragment implements PhotosContract.View {
- private PhotosContract.Presenter presenter;
- ..
- }
- class PhotosPresenter implements PhotosContract.Presenter {
- private PhotosConract.Model model;
- private PhotosContract.View view;
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement