@linux1s1s
2016-06-14T18:11:03.000000Z
字数 1322
阅读 1927
Android_Architecture
2016-06
MVX Android设计架构浅析-MVP 基本解释清楚了MVP的结构,这里给出具体的项目实践。
简单给出上面图示的类功能
public interface FLBaseViewContract<T> {
void fillPresenter(T presenter);
void pullDownEndUpdate();
void showErrorToast(int code, String msg);
void showProgressBar();
void hideProgressBar();
}
public interface FLBasePresenterContract {
void onStart();
}
public interface SFRemindContract {
public interface View extends FLBaseViewContract<Presenter> {
void updateFooterView();
void showBindPhone();
void showViewStub();
void hideViewStub();
void updateViewWithData(List<SuperfanProductBean> products, ProductStyle style, boolean fromStart);
}
public interface Presenter extends FLBasePresenterContract {
void initExtra(Bundle bundle);
void itemClick(final SuperfanProductBean product);
void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount, int browseDepth);
String getBrowseDepth();
void doAction();
void onBindPhoneClick();
}
}
下面三个省略,详细的可以参考Github源码。
- SFRemindFragment
- SFRemindPresenter
- SFRemindDataProvider