一款小而美的路由框架。网页动态添加自定义参数启动应用

网友投稿 670 2022-10-18

一款小而美的路由框架。网页动态添加自定义参数启动应用

一款小而美的路由框架。网页动态添加自定义参数启动应用

#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

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> map) { map.put("jomeslu://www", OneActivity.class); map.put("jomeslu://loginactivity", LoginActivity.class); } });

Router Jump page

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

Definition Of type

Scheme:suggest to define application name which router to useHost: suggest to define page where to go, such activitypath : Transfer parameter,customer type

key format{i:ikey}{f:key}{l:key}{d:key}{s:key}{b:key}
typeintegerfloatlongdoublestringboolean

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

Apache Version 2.0

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Jenkins Git构建基本远程代码库
下一篇:Kubernetes 控制器 DaemonSet
相关文章

 发表评论

暂时没有评论,来抢沙发吧~