Giter Site home page Giter Site logo

module2module's Introduction

Module2Module

Android模块化开发小demo

内置Android路由, 支持注解设置路由

如果你只想使用内置的Android路由模块,可以按照以下步骤完成。

  1. 在你的项目的build.gradle文件中添加一下代码
 dependencies {
        // 默认配置
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
  1. 在你的lib的build.gradle中添加
apply plugin: 'com.neenbedankt.android-apt'

并且在dependencies中添加

compile 'org.loader:annotation:1.0.0'
compile 'org.loader:router:1.0.0'
apt 'org.loader:router-helper:1.0.0'
  1. 在lib项目中添加一个空类,并使用
@Component("libName")

表示该lib的名称。

  1. 在需要注册路由的地方使用
@AutoRouter

或者

@StaticRouter(Scheme + "routerName")

进行路由注册

  1. 在壳工程的中添加如下配置
apply plugin: 'com.neenbedankt.android-apt'

并在dependencies中添加

compile 'org.loader:annotation:1.0.0'
compile 'org.loader:router-helper:1.0.0'
apt 'org.loader:router-helper:1.0.0'
  1. 自定义Application,并且添加一下代码
@Components({"components", "name"})

将上面定义的component的配置到这里。

  1. 在Application中调用如下代码,进行路由安装
RouterHelper.install();

具体使用方式可以见该项目。

module2module's People

Contributors

qibin0506 avatar

Watchers

眩粟 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.