GithubHelp home page GithubHelp logo

l770468673-lypgit / android-mvp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alex-jerry/android-mvp

1.0 2.0 0.0 223 KB

很好用的android-mvp框架,包含了rxjava+retrofit+okhttp的网络框架、6.0动态授权、以及activity、fragment的基类封装等

License: Apache License 2.0

Java 100.00%

android-mvp's Introduction

Android-MVP

最好用的android-mvp框架,包含了rxjava+retrofit+okhttp的网络框架、6.0动态授权、以及activity、fragment的基类封装等

一、有哪些功能:

1、框架整体基于MVP架构,结合了rxjava+retrofit+okhttp的网络框架,Demo项目结构如下:

项目Demo结构样例

2、框架封装了BaseActivity、BaseFragment等基类
3、框架封装了6.0动态授权在BaseActivity中,动态授权可以一行代码直接调用,如下:

动态授权

4、下面大致截图讲解下如何使项目升级为mvp结构:

MVP 如上图,MainContract主要负责拆分MainActivity中所需要的接口以及MainPresenter层实现之后的回调接口(有点拗口), 举例:如上图中,IMainView接口中主要负责回调给上层activity的一些方法,这里是回调(就是在MainPresenter层实现了IMainPresenter接口中的各种方法之后的回调),那么IMainPresenter接口就是负责MainPresenter层需要实现的各种接口咯。 那么我们再看MainPresenter层的实现,如下图:

Presenter层结构 最后再来看下MainActivity层,如下图:

Activity层结构

二、使用:

1、先依赖mvplib包到主项目中
2、有时间慢慢详细讲解,具体使用方式请先参照Demo样例

android-mvp's People

Contributors

aicareles avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.