Skip to content

Commit

Permalink
README 添加外部链接
Browse files Browse the repository at this point in the history
  • Loading branch information
baoti committed Feb 16, 2015
1 parent fe1b675 commit 3ba4da5
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 7 deletions.
34 changes: 32 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,39 @@ Pioneer
It is a android project which using "Best Practices" with "Dependency Inject", "View Inject" and
"Event Bus".

使用的库有:

- com.jakewharton:butterknife
View 注入
- com.squareup.dagger:dagger
依赖 注入
- com.squareup:otto
使用 Event Bus
- com.squareup.picasso:picasso
图片的加载与缓存
- com.squareup.retrofit:retrofit
封装 REST API

单元测试库使用了 Robolectric_

补充:
该项目的MVP以及代码结构,灵感来自 android10.Android-CleanArchitecture (on github),同时也做了大量改动。
Presenter的设计,借鉴了 square.Flow 与 square.Mortar (on github) 。
该项目的 MVP_ 以及代码结构,灵感来自 Android-CleanArchitecture_ ,同时也做了大量改动。
Presenter的设计,借鉴了 square's Flow_ 与 Mortar_ 。

.. _Robolectric:
https://github.com/robolectric/robolectric

.. _MVP:
https://github.com/baoti/Pioneer/tree/master/libPresenter

.. _Android-CleanArchitecture:
https://github.com/android10/Android-CleanArchitecture

.. _Flow:
https://github.com/square/flow

.. _Mortar:
https://github.com/square/mortar

License
-------
Expand Down
31 changes: 26 additions & 5 deletions libPresenter/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,36 @@ Presenter 拥有自己的生命周期,随着 View 状态的变化,Presenter
只有在 takeView 与 dropView 之间,Presenter 才拥有 view,否则 hasView 返回 false, getView 返回 null。
因此 Presenter 可以被 Thread, AsyncTask 或 异步方法等等 强引用,而不用担心 View 与 Activity 在生命周期结束后被强引用导致的内存占用。

Presenter 的生命周期,由具体的 ActivityView/FragmentView 来驱动;
也可仿照ActivityView/FragmentView来实现其他的View,如 ListFragmentView。
也可直接继承ListView/LinearLayout或自定义控件来实现自己的View,这是 square.Flowsquare.Mortar 的作法。
Presenter 的生命周期,由具体的 ActivityView_ / FragmentView_ 来驱动;
也可仿照 ActivityView_ / FragmentView_ 来实现其他的View,如 ListFragmentView。
也可直接继承ListView/LinearLayout或自定义控件来实现自己的View,这是 Flow_Mortar_ 的作法。

它也支持视图代理,可以通过代理来共用界面部分的代码。
具体可参考app模块中的 LoginDialogFragment/LoginFragment/LoginViewDelegate
具体可参考app模块中的 LoginDialogFragment_ / LoginFragment_ / LoginViewDelegate_

补充:
Presenter的设计,借鉴了 square.Flow 与 square.Mortar 。
Presenter的设计,借鉴了 Flow_ 与 Mortar_ 。

.. _ActivityView:
https://github.com/baoti/Pioneer/blob/master/libPresenter/src/main/java/com/github/baoti/android/presenter/ActivityView.java

.. _FragmentView:
https://github.com/baoti/Pioneer/blob/master/libPresenter/src/main/java/com/github/baoti/android/presenter/FragmentView.java

.. _LoginDialogFragment:
https://github.com/baoti/Pioneer/blob/master/app/src/main/java/com/github/baoti/pioneer/ui/login/LoginDialogFragment.java

.. _LoginFragment:
https://github.com/baoti/Pioneer/blob/master/app/src/main/java/com/github/baoti/pioneer/ui/login/LoginFragment.java

.. _LoginViewDelegate:
https://github.com/baoti/Pioneer/blob/master/app/src/main/java/com/github/baoti/pioneer/ui/login/LoginViewDelegate.java

.. _Flow:
https://github.com/square/flow

.. _Mortar:
https://github.com/square/mortar

License
-------
Expand Down

0 comments on commit 3ba4da5

Please sign in to comment.