[关闭]
@linux1s1s 2016-06-14T10:11:03.000000Z 字数 1322 阅读 1809

Android设计架构MVP应用实践

Android_Architecture 2016-06


MVX Android设计架构浅析-MVP 基本解释清楚了MVP的结构,这里给出具体的项目实践。

结构图

此处输入图片的描述

简单给出上面图示的类功能

协议部分

  1. public interface FLBaseViewContract<T> {
  2. void fillPresenter(T presenter);
  3. void pullDownEndUpdate();
  4. void showErrorToast(int code, String msg);
  5. void showProgressBar();
  6. void hideProgressBar();
  7. }
  1. public interface FLBasePresenterContract {
  2. void onStart();
  3. }
  1. public interface SFRemindContract {
  2. public interface View extends FLBaseViewContract<Presenter> {
  3. void updateFooterView();
  4. void showBindPhone();
  5. void showViewStub();
  6. void hideViewStub();
  7. void updateViewWithData(List<SuperfanProductBean> products, ProductStyle style, boolean fromStart);
  8. }
  9. public interface Presenter extends FLBasePresenterContract {
  10. void initExtra(Bundle bundle);
  11. void itemClick(final SuperfanProductBean product);
  12. void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount, int browseDepth);
  13. String getBrowseDepth();
  14. void doAction();
  15. void onBindPhoneClick();
  16. }
  17. }

下面三个省略,详细的可以参考Github源码

  • SFRemindFragment
  • SFRemindPresenter
  • SFRemindDataProvider
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注