a router plugin for android
- simple config,easy to use
- without reflection,batter performance
- simple callback without onActivityResult in activity
module | router-api | router-plugin |
---|---|---|
version |
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'
@Route(path = "/test/activity")
class YourActivity : AppCompatActivity(){
...
}
ARouter.getInstance()
.build("/test/test")
.navigation(this) { _, resultCode, data ->
val title = data?.getStringExtra("title")//data can be null,so mark it with ?
}
ARouter.getInstance()
.build("/test/test")
.navigation(this, new Callback() {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
}
});
add rules in proguard-rules.pro
-keep public class io.github.iamyours.router.**{*;}