Giter VIP home page Giter VIP logo

router-android's Introduction

AndroidRouter

It's an Android Route Library. You can just add some Annotation to add you router path.

Usage

Add this line to your build.gradle file under your module directory.

buildscript {
    repositories {
        maven {
            url 'https://dl.bintray.com/leifzhang/maven'
        }
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.kronos.plugin:AutoRegister:0.4.9'
    }
}
apply plugin: 'router-register'
dependencies {
    compile 'com.github.leifzhang:routerLib:0.4.1'
    kapt "com.github.leifzhang:compiler:0.4.1"
}

First Step

You should create you activity which need add router.Then just add like this.

@BindRouter(urls = {"https://wwww.github.com"})
public class TestActivity extends Activity {

}

If you need just urls and add some params.You can just add like this.

 @BindRouter(urls = { "https://github.com/leifzhang"}, weight=10)
 public class TestActivity extends Activity {

 }

Also maybe some callback not an activity. You can do like this.

@BindRouter(urls = {"https://wwww.baidu.com"}, isRunnable = true)
public class SimpleCallBack implements RouterCallback {
    @Override
    public void run(RouterContext context) {
        Toast.makeText(context.getContext(), "testing", Toast.LENGTH_SHORT).show();
    }
}

Second Step

Each module need a Annotation just call BindModule

@BindModule("app")
public class Module {

}

Last Step

You just should easy use you code just like this.

    Router.sharedRouter().open("https://github.com/leifzhang", this);

router-android's People

Contributors

leifzhang 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.