|
47 | 47 | import static com.alibaba.android.arouter.compiler.utils.Consts.ACTIVITY; |
48 | 48 | import static com.alibaba.android.arouter.compiler.utils.Consts.ANNOTATION_TYPE_AUTOWIRED; |
49 | 49 | import static com.alibaba.android.arouter.compiler.utils.Consts.ANNOTATION_TYPE_ROUTE; |
| 50 | +import static com.alibaba.android.arouter.compiler.utils.Consts.FRAGMENT; |
50 | 51 | import static com.alibaba.android.arouter.compiler.utils.Consts.IPROVIDER_GROUP; |
51 | 52 | import static com.alibaba.android.arouter.compiler.utils.Consts.IROUTE_GROUP; |
52 | 53 | import static com.alibaba.android.arouter.compiler.utils.Consts.ITROUTE_ROOT; |
|
56 | 57 | import static com.alibaba.android.arouter.compiler.utils.Consts.NAME_OF_PROVIDER; |
57 | 58 | import static com.alibaba.android.arouter.compiler.utils.Consts.NAME_OF_ROOT; |
58 | 59 | import static com.alibaba.android.arouter.compiler.utils.Consts.PACKAGE_OF_GENERATE_FILE; |
59 | | -import static com.alibaba.android.arouter.compiler.utils.Consts.PARCELABLE; |
60 | 60 | import static com.alibaba.android.arouter.compiler.utils.Consts.SEPARATOR; |
61 | 61 | import static com.alibaba.android.arouter.compiler.utils.Consts.SERVICE; |
62 | 62 | import static com.alibaba.android.arouter.compiler.utils.Consts.WARNING_TIPS; |
@@ -164,7 +164,8 @@ private void parseRoutes(Set<? extends Element> routeElements) throws IOExceptio |
164 | 164 |
|
165 | 165 | TypeMirror type_Activity = elements.getTypeElement(ACTIVITY).asType(); |
166 | 166 | TypeMirror type_Service = elements.getTypeElement(SERVICE).asType(); |
167 | | - TypeElement type_Parcelable = elements.getTypeElement(PARCELABLE); |
| 167 | + TypeMirror fragmentTm = elements.getTypeElement(FRAGMENT).asType(); |
| 168 | + TypeMirror fragmentTmV4 = elements.getTypeElement(Consts.FRAGMENT_V4).asType(); |
168 | 169 |
|
169 | 170 | // Interface of ARouter |
170 | 171 | TypeElement type_IRouteGroup = elements.getTypeElement(IROUTE_GROUP); |
@@ -236,6 +237,9 @@ private void parseRoutes(Set<? extends Element> routeElements) throws IOExceptio |
236 | 237 | } else if (types.isSubtype(tm, type_Service)) { // Service |
237 | 238 | logger.info(">>> Found service route: " + tm.toString() + " <<<"); |
238 | 239 | routeMete = new RouteMeta(route, element, RouteType.parse(SERVICE), null); |
| 240 | + } else if (types.isSubtype(tm, fragmentTm) || types.isSubtype(tm, fragmentTmV4)) { |
| 241 | + logger.info(">>> Found fragment route: " + tm.toString() + " <<<"); |
| 242 | + routeMete = new RouteMeta(route, element, RouteType.parse(FRAGMENT), null); |
239 | 243 | } |
240 | 244 |
|
241 | 245 | categories(routeMete); |
|
0 commit comments