├── jet_router ├── .gitignore ├── src │ ├── main │ │ ├── assets │ │ │ └── router.json │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── meiyou │ │ │ │ └── router │ │ │ │ ├── routable │ │ │ │ ├── RouterCallback.java │ │ │ │ ├── ContextNotProvided.java │ │ │ │ ├── RouteNotFoundException.java │ │ │ │ ├── RouteContext.java │ │ │ │ ├── RouterOptions.java │ │ │ │ └── RouterPatter.java │ │ │ │ ├── RouterConstant.java │ │ │ │ ├── data │ │ │ │ ├── RouterTable.java │ │ │ │ └── RouterTableSample.java │ │ │ │ ├── action │ │ │ │ └── Action.java │ │ │ │ ├── intercept │ │ │ │ ├── InterceptorData.java │ │ │ │ └── UriInterceptor.java │ │ │ │ ├── RouterCenterActivity.java │ │ │ │ ├── meiyou │ │ │ │ └── UriMeiyou.java │ │ │ │ ├── util │ │ │ │ └── AssetUtil.java │ │ │ │ ├── model │ │ │ │ └── RouterBean.java │ │ │ │ └── Router.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── meiyou │ │ │ └── jet │ │ │ └── jet_router │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── meiyou │ │ └── jet │ │ └── jet_router │ │ └── ExampleInstrumentedTest.java ├── gradle.properties ├── proguard-rules.pro └── build.gradle ├── module_b ├── .gitignore ├── src │ ├── main │ │ ├── assets │ │ │ └── bmodule.json │ │ ├── java │ │ │ └── com │ │ │ │ └── meiyou │ │ │ │ └── jet │ │ │ │ └── module_b │ │ │ │ ├── test1.json │ │ │ │ ├── TestActivity.java │ │ │ │ └── action │ │ │ │ └── TestModuleAction.java │ │ ├── res │ │ │ ├── values │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ └── activity_test.xml │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── meiyou │ │ │ └── jet │ │ │ └── module_b │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── meiyou │ │ └── jet │ │ └── module_b │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── _config.yml ├── jet_annotation ├── .gitignore ├── gradle.properties ├── src │ └── main │ │ └── java │ │ └── com.meiyou.annotation │ │ ├── Test.java │ │ ├── AutoParcel.java │ │ ├── Print.java │ │ ├── JUriAction.java │ │ ├── MethodInfo.java │ │ └── JUri.java └── build.gradle ├── jet_compiler ├── .gitignore ├── gradle.properties ├── src │ └── main │ │ └── java │ │ └── com │ │ └── meiyou │ │ ├── temp │ │ └── RouterTableSample.java │ │ └── compiler │ │ ├── MethodInfoProcessor.java │ │ ├── PrintProcessor.java │ │ ├── AutoParcelProcessor.java │ │ ├── TestProcessor.java │ │ └── RouterProcessor.java └── build.gradle ├── app ├── src │ ├── main │ │ ├── assets │ │ │ └── assetApp.json │ │ ├── java │ │ │ └── com │ │ │ │ └── seeker │ │ │ │ └── tony │ │ │ │ └── myapplication │ │ │ │ ├── route │ │ │ │ └── test2.json │ │ │ │ ├── Foo.java │ │ │ │ ├── model │ │ │ │ └── TestBean.java │ │ │ │ ├── MyApplication.java │ │ │ │ ├── action │ │ │ │ └── TestAction.java │ │ │ │ ├── IntentActivity.java │ │ │ │ ├── common │ │ │ │ └── Mock.java │ │ │ │ ├── BlankFragment.java │ │ │ │ └── MainActivity.java │ │ ├── res │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ └── layout │ │ │ │ ├── item_fragment_blank.xml │ │ │ │ ├── content_main.xml │ │ │ │ ├── fragment_blank.xml │ │ │ │ ├── activity_intent.xml │ │ │ │ └── activity_main.xml │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── seeker │ │ │ └── tony │ │ │ └── myapplication │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── seeker │ │ └── tony │ │ └── myapplication │ │ └── ExampleInstrumentedTest.java ├── key.jks ├── .gitignore ├── proguard-rules.pro └── build.gradle ├── image └── jetback.jpg ├── settings.gradle ├── .gitignore ├── mvn_java.gradle ├── mvn.gradle ├── gradle.properties ├── Readme_en.md └── Readme.md /jet_router/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /module_b/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-merlot -------------------------------------------------------------------------------- /jet_annotation/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /jet_compiler/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/src/main/assets/assetApp.json: -------------------------------------------------------------------------------- 1 | this is Main -------------------------------------------------------------------------------- /jet_router/src/main/assets/router.json: -------------------------------------------------------------------------------- 1 | {"tst":"sdfsdf"} -------------------------------------------------------------------------------- /module_b/src/main/assets/bmodule.json: -------------------------------------------------------------------------------- 1 | this is Module b; -------------------------------------------------------------------------------- /app/key.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/app/key.jks -------------------------------------------------------------------------------- /jet_router/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=router 2 | GROUP_ID=com.jet.framework -------------------------------------------------------------------------------- /image/jetback.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/image/jetback.jpg -------------------------------------------------------------------------------- /module_b/src/main/java/com/meiyou/jet/module_b/test1.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "hello" 3 | } -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | gradlew 3 | gradlew.bat 4 | local.properties 5 | /.idea 6 | /gradle -------------------------------------------------------------------------------- /app/src/main/java/com/seeker/tony/myapplication/route/test2.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "hello" 3 | } -------------------------------------------------------------------------------- /jet_compiler/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=router-compiler 2 | GROUP_ID=com.jet.framework -------------------------------------------------------------------------------- /jet_annotation/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=router-annotation 2 | GROUP_ID=com.jet.framework -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':jet_compiler', ':jet_annotation', ':jet_router', ':module_b' 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /module_b/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | module_b 3 | 4 | -------------------------------------------------------------------------------- /jet_router/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | jet_router 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/java/com/seeker/tony/myapplication/Foo.java: -------------------------------------------------------------------------------- 1 | package com.seeker.tony.myapplication; 2 | 3 | 4 | public class Foo{ 5 | 6 | } 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gybin02/RouterKit/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | /.idea 11 | /gradle 12 | gradlew.bat 13 | gradlew 14 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RouterKit Sample 3 | Settings 4 | 5 | 6 | Hello blank fragment 7 | 8 | -------------------------------------------------------------------------------- /jet_router/src/main/java/com/meiyou/router/routable/RouterCallback.java: -------------------------------------------------------------------------------- 1 | package com.jet.router.routable; 2 | 3 | /** 4 | * The class used when you want to map a function (given in `run`) 5 | * to a Router URL. 6 | */ 7 | public abstract class RouterCallback { 8 | public abstract void run(RouteContext context); 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/seeker/tony/myapplication/model/TestBean.java: -------------------------------------------------------------------------------- 1 | package com.seeker.tony.myapplication.model; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * @author zhengxiaobin 7 | * @since 17/5/22 8 | */ 9 | 10 | public class TestBean implements Serializable { 11 | public String key; 12 | public int keyInt = 0; 13 | } 14 | -------------------------------------------------------------------------------- /jet_router/src/main/java/com/meiyou/router/RouterConstant.java: -------------------------------------------------------------------------------- 1 | package com.jet.router; 2 | 3 | /** 4 | * 默认变量 5 | * 6 | * @author zhengxiaobin 7 | * @since 17/7/14 8 | */ 9 | 10 | public class RouterConstant { 11 | 12 | public static final String PkgName = "com.jet.router.data"; 13 | public static final String ClassName = "RouterTable"; 14 | } 15 | -------------------------------------------------------------------------------- /jet_router/src/main/java/com/meiyou/router/routable/ContextNotProvided.java: -------------------------------------------------------------------------------- 1 | package com.jet.router.routable; 2 | 3 | /** 4 | * Thrown if no context has been found. 5 | */ 6 | public class ContextNotProvided extends RuntimeException { 7 | private static final long serialVersionUID = -1381427067387547157L; 8 | 9 | public ContextNotProvided(String message) { 10 | super(message); 11 | } 12 | } -------------------------------------------------------------------------------- /jet_annotation/src/main/java/com.meiyou.annotation/Test.java: -------------------------------------------------------------------------------- 1 | package com.jet.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | import static java.lang.annotation.ElementType.METHOD; 7 | import static java.lang.annotation.RetentionPolicy.CLASS; 8 | @Deprecated 9 | @Retention(CLASS) 10 | @Target(METHOD) 11 | public @interface Test { 12 | String value(); 13 | } -------------------------------------------------------------------------------- /jet_router/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /jet_annotation/src/main/java/com.meiyou.annotation/AutoParcel.java: -------------------------------------------------------------------------------- 1 | package com.jet.annotation; 2 | import java.lang.annotation.ElementType; 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | import java.lang.annotation.Target; 6 | 7 | @Deprecated 8 | @Target(ElementType.TYPE) // 代表在类级别上才能使用该注解 9 | @Retention(RetentionPolicy.SOURCE) // 代表该注解只存在源代码中,编译后的字节码中不存在 10 | public @interface AutoParcel {} -------------------------------------------------------------------------------- /jet_router/src/main/java/com/meiyou/router/routable/RouteNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.jet.router.routable; 2 | 3 | /** 4 | * Thrown if a given route is not found. 5 | */ 6 | public class RouteNotFoundException extends RuntimeException { 7 | private static final long serialVersionUID = -2278644339983544651L; 8 | 9 | public RouteNotFoundException(String message) { 10 | super(message); 11 | } 12 | } -------------------------------------------------------------------------------- /module_b/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /jet_annotation/src/main/java/com.meiyou.annotation/Print.java: -------------------------------------------------------------------------------- 1 | package com.jet.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Deprecated 9 | @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) 10 | @Retention(RetentionPolicy.CLASS) 11 | public @interface Print { 12 | } -------------------------------------------------------------------------------- /jet_router/src/main/java/com/meiyou/router/data/RouterTable.java: -------------------------------------------------------------------------------- 1 | package com.jet.router.data; 2 | 3 | import com.jet.router.model.RouterBean; 4 | 5 | import java.util.HashMap; 6 | 7 | /** 8 | * 路由表 9 | * 10 | * @author zhengxiaobin 11 | * @since 17/7/14 12 | */ 13 | 14 | public class RouterTable { 15 | public static HashMap map = new HashMap<>(); 16 | 17 | public static void registerRouter(String uri, RouterBean bean) { 18 | map.put(uri, bean); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jet_annotation/src/main/java/com.meiyou.annotation/JUriAction.java: -------------------------------------------------------------------------------- 1 | package com.jet.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * @author zhengxiaobin 10 | * @since 17/7/13 11 | */ 12 | @Deprecated 13 | @Target(ElementType.TYPE) // 代表在类级别上才能使用该注解 14 | @Retention(RetentionPolicy.SOURCE) 15 | public @interface JUriAction { 16 | String[] value(); 17 | } 18 | -------------------------------------------------------------------------------- /module_b/src/test/java/com/meiyou/jet/module_b/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.jet.jet.module_b; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /jet_router/src/test/java/com/meiyou/jet/jet_router/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.jet.jet.jet_router; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/test/java/com/seeker/tony/myapplication/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.seeker.tony.myapplication; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /module_b/src/main/java/com/meiyou/jet/module_b/TestActivity.java: -------------------------------------------------------------------------------- 1 | package com.jet.jet.module_b; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | 6 | import com.jet.annotation.JUri; 7 | 8 | @JUri("/moduleb") 9 | public class TestActivity extends AppCompatActivity { 10 | 11 | @Override 12 | protected void onCreate(Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | setContentView(R.layout.activity_test); 15 | 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /jet_annotation/src/main/java/com.meiyou.annotation/MethodInfo.java: -------------------------------------------------------------------------------- 1 | package com.jet.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * @author zhengxiaobin 10 | * @since 17/5/18 11 | */ 12 | @Deprecated 13 | @Target(ElementType.TYPE) // 代表在类级别上才能使用该注解 14 | @Retention(RetentionPolicy.SOURCE) // 代表该注解只存在源代码中,编译后的字节码中不存在 15 | public @interface MethodInfo { 16 | 17 | String author(); 18 | } 19 | -------------------------------------------------------------------------------- /jet_router/src/main/java/com/meiyou/router/action/Action.java: -------------------------------------------------------------------------------- 1 | package com.jet.router.action; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * Uri对应的执行基类方法 7 | * 8 | * @author zhengxiaobin 9 | * @since 17/7/13 10 | */ 11 | 12 | public class Action { 13 | // 14 | 15 | 16 | // public void run(String uri) { 17 | // 18 | // } 19 | 20 | // public void run(Intent intent) { 21 | // 22 | // } 23 | 24 | /** 25 | * 参数,解析出成Map传入 26 | * @param queryMap 27 | */ 28 | public void run(Map queryMap) { 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /jet_router/src/main/java/com/meiyou/router/intercept/InterceptorData.java: -------------------------------------------------------------------------------- 1 | package com.jet.router.intercept; 2 | 3 | import android.net.Uri; 4 | 5 | import java.util.HashMap; 6 | 7 | /** 8 | * 拦截器 9 | * 10 | * @author zhengxiaobin 11 | * @since 17/7/21 12 | */ 13 | 14 | public class InterceptorData { 15 | /** 16 | * 执行的URI 17 | */ 18 | public Uri mUri; 19 | /** 20 | * 可以带额外的信息 21 | */ 22 | public String mExtra; 23 | /** 24 | * 额外的参数信息 25 | */ 26 | public HashMap hashMap = new HashMap<>(); 27 | } 28 | -------------------------------------------------------------------------------- /module_b/src/main/java/com/meiyou/jet/module_b/action/TestModuleAction.java: -------------------------------------------------------------------------------- 1 | package com.jet.jet.module_b.action; 2 | 3 | import android.util.Log; 4 | 5 | import com.jet.annotation.JUri; 6 | import com.jet.router.action.Action; 7 | 8 | import java.util.Map; 9 | 10 | /** 11 | * @author zhengxiaobin 12 | * @since 17/7/17 13 | */ 14 | 15 | @JUri("/moduleb/action") 16 | public class TestModuleAction extends Action { 17 | @Override 18 | public void run(Map queryMap) { 19 | super.run(queryMap); 20 | Log.e("Router", "TestModuleAction Run:"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /jet_compiler/src/main/java/com/meiyou/temp/RouterTableSample.java: -------------------------------------------------------------------------------- 1 | package com.jet.temp; 2 | 3 | /** 4 | * 生成的Java文件 5 | * 6 | * @author zhengxiaobin 7 | * @since 17/7/13 8 | */ 9 | //@Deprecated 10 | //public class RouterTableSample { 11 | // 12 | // public static final HashMap map = new HashMap<>(); 13 | // 14 | // static { 15 | // RouteBean.createBean(map, "/home", "com.seeker.tony.myapplication.IntentActivity"); 16 | // RouteBean.createBean(map, "/home/action", "com.seeker.tony.myapplication.action.TestAction"); 17 | // } 18 | // 19 | // 20 | //} 21 | -------------------------------------------------------------------------------- /jet_router/src/main/java/com/meiyou/router/data/RouterTableSample.java: -------------------------------------------------------------------------------- 1 | package com.jet.router.data; 2 | 3 | /** 4 | * 生成的代码 5 | * 6 | * @author zhengxiaobin 7 | * @since 17/7/14 8 | */ 9 | 10 | //public class RouterTableSample { 11 | // 12 | // public static void register() { 13 | // RouterBean bean = new RouterBean("/action", "com.seeker.tony.myapplication.action.TestAction"); 14 | // RouterTable.registerRouter(bean.uri, bean); 15 | // 16 | // RouterBean.createBean("/home", "com.seeker.tony.myapplication.IntentActivity"); 17 | // RouterTable.registerRouter(bean.uri, bean); 18 | // } 19 | //} 20 | -------------------------------------------------------------------------------- /jet_router/src/main/java/com/meiyou/router/RouterCenterActivity.java: -------------------------------------------------------------------------------- 1 | package com.jet.router; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.os.PersistableBundle; 6 | 7 | /** 8 | * 路由中心页面 9 | * 10 | * @author zhengxiaobin 11 | * @since 17/7/17 12 | */ 13 | public class RouterCenterActivity extends Activity { 14 | @Override 15 | public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) { 16 | super.onCreate(savedInstanceState, persistentState); 17 | } 18 | 19 | @Override 20 | protected void onPause() { 21 | super.onPause(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/seeker/tony/myapplication/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.seeker.tony.myapplication; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.jet.router.Router; 7 | 8 | 9 | /** 10 | * @author zhengxiaobin 11 | * @since 17/7/13 12 | */ 13 | 14 | public class MyApplication extends Application { 15 | private static Context context; 16 | 17 | @Override 18 | public void onCreate() { 19 | super.onCreate(); 20 | context = this.getApplicationContext(); 21 | Router.getInstance().init(this); 22 | } 23 | 24 | public static Context getContext() { 25 | return context; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /module_b/src/main/res/layout/activity_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /jet_annotation/src/main/java/com.meiyou.annotation/JUri.java: -------------------------------------------------------------------------------- 1 | package com.jet.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | 9 | /** 10 | * URI实现: 11 | *

12 | * http://git.meiyou.im/Android/Route 13 | * 14 | * @author zhengxiaobin 15 | * @since 17/5/18 16 | */ 17 | @Target(ElementType.TYPE) // 代表在类级别上才能使用该注解 18 | @Retention(RetentionPolicy.SOURCE) // 代表该注解只存在源代码中,编译后的字节码中不存在 19 | public @interface JUri { 20 | 21 | String value() default ""; 22 | 23 | /** 24 | * 设置Default, 就可以不用初始化 25 | * 26 | * @return 27 | */ 28 | String[] array() default {}; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /jet_router/src/main/java/com/meiyou/router/meiyou/UriMeiyou.java: -------------------------------------------------------------------------------- 1 | package com.jet.router.meiyou; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | /** 6 | * 美柚特定的Path; 7 | * 8 | * @author zhengxiaobin 9 | * @since 17/7/25 10 | */ 11 | 12 | public class UriMeiyou { 13 | 14 | public static UriMeiyou HOME = new UriMeiyou("/home"); 15 | 16 | 17 | String path = ""; 18 | 19 | /** 20 | * 构造方法,传入Path: "/home" 21 | * 22 | * @param path 23 | */ 24 | public UriMeiyou(@NonNull String path) { 25 | this.path = path; 26 | } 27 | 28 | /** 29 | * 获取Meiyou Path; 30 | * 31 | * @return 32 | */ 33 | public String getPath() { 34 | return "meiyou://" + path; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |