Code Monkey home page Code Monkey logo

routersdk's Introduction

#RouterSDK RouterSDK is an excellent Router Framwork ,it is easy to integrate in your project. You can start an application through the web page by the custom parameters. In addition, it can also provides a number of useful features such as dynamic routing configuration, jump animation, task station, jump pretreatment, etc.

Screenshot

route

Build

Step 1. Add the JitPack repository to your build file

add the JitPack maven to your project in root build.gradle

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add module dependency build.gradle

 dependencies {
     compile 'com.github.Jomes:routerSDK:v1.0.3-alpha'
 } 

That's it!

How to use

init RouteTable in application

 Router.initRouteTable(new IRouteTableMapping() {
       @Override
       public void operaRouterTable(Map<String, Class<? extends Activity>> map) {
           map.put("jomeslu://www", OneActivity.class);
           map.put("jomeslu://loginactivity", LoginActivity.class);
       }
 });

Router Jump page

 Router.build("http://androidblog.cn/index.php/Source").start(MainActivity.this);

Definition Of type

  • Scheme:suggest to define application name which router to use
  • Host: suggest to define page where to go, such activity
  • path : Transfer parameter,customer type
key format {i:ikey} {f:key} {l:key} {d:key} {s:key} {b:key}
type integer float long double string boolean

eg :From A page to B page use url :jomeslu://www?{i:id}=168&{s:jomeslu}=jomeslu

A page

 Router.build("jomeslu://www?{i:id}=168&{s:jomeslu}=jomeslu").setIRouteInterceptor(new IRouteInterceptor() {
        @Override
        public boolean interceptor() {
           Router.build("jomeslu://loginactivity?{i:id}=168&{s:jomeslu}=jomeslu").start(MainActivity.this);
           Toast.makeText(MainActivity.this, "login...", Toast.LENGTH_LONG).show();
            return true;
        }
 }).start(MainActivity.this);;

B Page Receive parameter as normal

  String jomeslu = getIntent().getStringExtra("jomeslu");
  int id = getIntent().getIntExtra("id", -1);

License

routersdk's People

Contributors

jomes avatar

Watchers

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