All Projects → iamyours → SimpleRouter

iamyours / SimpleRouter

Licence: other
a rouer plugin with transform api,simple and easy to use.

Programming Languages

groovy
2714 projects
java
68154 projects - #9 most used programming language
kotlin
9241 projects

SimpleRouter

a router plugin for android

Feature

  • simple config,easy to use
  • without reflection,batter performance
  • simple callback without onActivityResult in activity

Lastest version

module router-api router-plugin
version Download Download

Quick start

Configuration

add classpath in yours project build.gradle

classpath 'io.github.iamyours:router-plugin:1.0.1'

apply plugin in app module

apply plugin: 'RouterPlugin'

add dependency in the module that will use @Route annotation,you can add it in common module.

api 'io.github.iamyours:router-api:1.0.1'

add route annotation

@Route(path = "/test/activity")
class YourActivity : AppCompatActivity(){
    ...
}

jump with router

ARouter.getInstance()
       .build("/test/test")
       .navigation(this) { _, resultCode, data ->
            val title = data?.getStringExtra("title")//data can be null,so mark it with ?
       }

for java

ARouter.getInstance()
        .build("/test/test")
        .navigation(this, new Callback() {
            @Override
            public void onActivityResult(int requestCode, int resultCode, Intent data) {

            }
        });

If Proguard is turn on

add rules in proguard-rules.pro

-keep public class io.github.iamyours.router.**{*;}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].