Skip to content

Instantly share code, notes, and snippets.

@mladenrakonjac
Created September 15, 2016 06:58
Show Gist options
  • Save mladenrakonjac/58c1a01f3bc9f335479d8f5edf1c8f1c to your computer and use it in GitHub Desktop.
Save mladenrakonjac/58c1a01f3bc9f335479d8f5edf1c8f1c to your computer and use it in GitHub Desktop.
Example of Contract interface in MVP pattern
package me.fleka.deltacity.presentation.shopping;
import java.util.List;
import me.fleka.deltacity.domain.models.Category;
import me.fleka.deltacity.domain.models.Shop;
import me.fleka.deltacity.presentation.BasePresenter;
import me.fleka.deltacity.presentation.BaseView;
/**
* Created by mladenrakonjac on 14/09/16.
*/
public interface ShoppingContract {
interface View extends BaseView<Presenter> {
void setLoadingIndicator(boolean active);
void showCategories(List<Category> categoryList);
void showNoInternetConnection();
void showLoadingCategoriesError();
void showListOfFoundedShopForSearch(List<Shop> shopList);
void showNoShopsFound();
}
interface Presenter extends BasePresenter {
void loadCategories();
void openCategory(int categoryId);
void searchShop(String searchText);
void openShop(int shopId);
void cleanSearch();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment