/Router

🍭灵活的组件化路由框架.

Primary LanguageJavaApache License 2.0Apache-2.0

Build Status license PullRequest

Router

建议浏览中文wiki, 也可体验demo.apk .

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.0'
    }
}

// 可选. 指定版本号.
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

Features

See here .

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! ​👏​​👏​​👏​

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

# Router
-keep class com.chenenyu.router.** {*;}
-keep class * implements com.chenenyu.router.RouteInterceptor {*;}

Contact

QQ group: 271849001

Other Libraries

SuperAdater : 实用的Adapter.

img-optimizer-gradle-plugin : 一款用于优化png图片的gradle插件.

License

Apache 2.0