简介:🚀🚀🚀Simple and flexible router library for Android platform.
更多:作者   æ Bug   

Build Status license [version] ( API PullRequest

A component based router library, featuring simple and flexible.

建议浏览中文 wiki.


Getting started

You should use a version of the Android gradle plugin 2.2 or above to supoort annotation processor.

  • Add dependencies by adding the following lines to your top level project/build.gradle:
buildscript {
    repositories {
    dependencies {
        classpath ' ↑'
        classpath 'com.chenenyu.router:gradle-plugin:latest.integration'

// Optional. Specify the dependencies version, default to the latest version.
ext {
    routerVersion = "x.y.z"
    compilerVersion = "x.y.z"
  • Apply router plugin in your app/build.gradle or lib/build.gradle:
apply plugin: ''
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.

public class TestActivity extends AppCompatActivity {

Then you can just call"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

The whole api looks like this:
    .anim(enter, exit)
    .callback(new RouteCallBack() {
        public void succeed(Uri uri) {
            Log.i(TAG, "succeed: " + uri.toString());

        public void error(Uri uri, String message) {
            Log.w(TAG, "error: " + uri + ", " + message);

Please refer to the wiki for more informations.


QQ group: 271849001

Other Libraries

SuperAdater: Adapter knife(万能的 Adapter).

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


Apache 2.0

Android 开发经验分享
Android 开发经验分享