Router

项目地址:chenenyu/Router
简介:🚀🚀🚀Simple and flexible router library for Android platform.
更多:作者   æ Bug   
标签:

Build Status license PullRequest

建议浏览中文 wiki.

screenshot

Getting started

  • Add dependencies by adding the following lines to your top level project/build.gradle:
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        ...
        classpath 'com.chenenyu.router:gradle-plugin:1.2.4'
    }
}

// 可选配置.
ext {
    ...
    routerVersion = "x.y.z" // 指定特定的 router 版本
    compilerVersion = "x.y.z" // 指定特定的 router-compiler 版本
}
  • Apply router plugin in your module/build.gradle:
apply plugin: 'com.android.application'
...
apply plugin: 'com.chenenyu.router'

current router-gradle-plugin version: Download

current router version: Download

current router-compiler version: compiler

Simple usage

Router uses annotation to specify the mapping relationship.

@Route("test")
public class TestActivity extends AppCompatActivity {
    ...
}

Then you can just call Router.build("test").go(context) to open TestActivity, so cool! ​:clap:​​:clap:​​:clap:​

If you configured multiple route @Route({"test","wtf"}), both test and wtf can lead to TestActivity.

Advanced usage

Please refer to the wiki for more informations.

ProGuard

See wiki.

Contact

QQ group: 271849001

License

Apache 2.0

Android 开发经验分享
用了一年多的理财推荐
Android 开发经验分享
用了一年多的理财推荐