yifei8 / aretrofit Goto Github PK
View Code? Open in Web Editor NEWAndroid组件化最佳路由,为简单而生。
Home Page: https://www.jianshu.com/p/4210234cf0a0
License: Apache License 2.0
Android组件化最佳路由,为简单而生。
Home Page: https://www.jianshu.com/p/4210234cf0a0
License: Apache License 2.0
Callback
其实都是需要在主线程的retrofit
原理去自定义返回值,甚至支持 RxJava
sorry
,没看清楚具体情况. 如果你愿意有更多的讨论,可以加我好友Routerfit.register(AppRouter.class).skipActivity1("参数1", new ActivityCallback() {
@Override
public void onActivityResult(int result, Object data) {
Toast.makeText(MainActivity.this, data.toString(), Toast.LENGTH_SHORT).show();
Routerfit.register(AppRouter.class).skipActivity2(new ActivityCallback() {
@Override
public void onActivityResult(int result, Object data) {
Toast.makeText(MainActivity.this, data.toString(), Toast.LENGTH_SHORT).show();
}
});
}
});
第二次的回调一定不会成功。
而且我还发现一个问题,比如 Routerfit.setResult(Routerfit.RESULT_OK),但是
void setResult(String key, @IntRange(from = -1, to = 0) int result, Object data) {
ActivityCallback callback = map.get(key);
if (callback != null) {
callback.onActivityResult(result, data);
map.remove(key);
}
}
这个方法总会回调两次,我不知道这个是否是正常的。下面我会贴上调试的图片。
这是我先跳转Activity1,上面方法被回调两次,
接着我在跳Activity1的回调里面再跳转Activity2,调试如下:
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.sjtu.yifei.route.RouteService"
why do i click the textview with the demo, it happen bug. are you sure it is ok?can the project run?
高阶用法中的服务,可跨模块获取对象,请问如果这个对象需要异步生成之后才能获取到,这个有什么好的实现方式吗
如果使用windows10+android studio开发,库中如果使用了jdk中的ClassLoader,则会出现rebuild的时候删除不了build文件夹中的一些生成的jar包。
这个是我在和AppInit这个库的作者一起调试发现的,该库作者使用GroovyClassLoader替换Java的ClassLoader解决了这个问题,现在我司项目还有这个问题,我现在在所有使用到的第三方库下都提了这个issures,如果库中没有使用,请自动忽略。。。
AppInit的修复
这个问题只在windows上有出现,macOS上是没有的。并且我只测试了JDK1.8+windows10这一种情况,其他没有测试过。
应该是楼主直接发了build下面的apk,不是release版本的。望更新一下
我司项目现在使用的是CC这个框架,这个框架有个最大的优点是可以实现代码隔离,缺点是不能很好管理所有跳转,开发人员多了就比较混乱,而作者的这个框架则很好的解决了这个问题。希望作者能吸取各大库的优点,解决更多的问题。当然希望作者不要误会我,我只是提个建议,完全没有义务去做这些事情。最后祝新年快乐!!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.