一個專案的前期準備是非常重要的,程式的框架就是其中一環。一個合適的框架可以大大減少開發以及維護難度等等...在MVVM還沒盛行的時候,MVP仍然是首選框架之一。
下面我寫了一個MVP的Demo,其中有自己對MVP的一些理解及優化,希望能幫助到大家~
溫馨提示:建議先了解下MVP再來食用本Demo更佳!
MVPFrame

一個Android MVP框架演示專案。
目錄介紹
--base
Activity & Fragment Base類--mvp
MVP的Base類都在這裡面--presentation
主要包,其中的Contract類是定義View和Presenter介面的地方--util
共通工具包App
ApplicationAppRouter
app路由,介面跳轉幫助類,所有的介面跳轉通過此類進行跳轉,包括元件互動
程式碼

專案截圖

感謝
Fragment 管理: Fragmentation
下載
DemoAPK: Download