Giter VIP home page Giter VIP logo

edgemvp's Introduction

EdgeMvp

一个MVP架构利器。自动生成接口文件,且不需要实现接口。

  • View层使用@MvpView注解,标注为view。
  • Presenter层使用@MvpView注解,标注为presenter。
  • 使用@ExtractItf注解标注方法,此方法将会被抽取到接口中。
jcenter下载
dependencies {
    implementation 'com.linuxpara:edgemvp:1.0.4'
    annotationProcessor 'com.linuxpara:edgemvp-complier:1.0.4'
}
使用方法:
  1. @MvpView使用

    EdgeMvp框架view层使用

  2. @MvpPresenter使用

    EdgeMvp框架presenter层使用

  3. 点击编译按钮,自动生成代码。(PS:同步按钮不会生成代码)

  4. view层中创建presenter对象。

    private ILoginPresenter mPresenter;
    
    .....
    
    mPresenter = EdgeMvp.createPresenter(this);
    mPresenter.login("test", "12345");
  5. presenter层中获取view对象。

    ((ILoginView) EdgeMvp.getViewProxy(LoginPresenter.this));
不足的地方:
  • 注解标注完,需要编译才能生成生成需要的文件。
  • createPresenter()、getViewProxy()需要生成代码后,调用才会有效,并且需要强转。
结束:

该项目还存在不足的地方,各位大神有什么好的想法或者建议,望不吝赐教。

最后,都看这里了,给点个星呗。(^∀^)

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

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.