free46000 / hybridfoundation Goto Github PK
View Code? Open in Web Editor NEW混合应用基础架构 跨平台热更新方案 Js双向通信 基础WebView
混合应用基础架构 跨平台热更新方案 Js双向通信 基础WebView
其实很早就下了代码了,最近也有时间看了下
首先呢,我现在做的项目也有很多动态更新的,跳转到Activity界面,这中间大概有2秒的白屏时间
我自己实际测试,解压代码并不需要多少时间,反而是webview的渲染,这里才是大头,所以我觉得只要监听webview加载完就隐藏Fragment即可,不需要那么复杂的设置延时,什么的吧。
监听:
mWebview.setWebChromeClient(new WebChromeClient(){
@Override public void onProgressChanged(WebView mWebView, int num) {
super.onProgressChanged(mWebView, num);
if (100==num){
hideTranstion();
}
}
});
PS:我很久没用RXjava了,所以不知道理解你代码中的Splash处理有不有错
当然楼主的使用fragment显示页面这个ideal很赞.
当然其实你可以看看Cordova中的处理,很健全,因为我现在项目用的是ionic,所以基本使用他来加载的
最后,谢谢你的分享,对于H5的差异化区别,然后下载新编写即可,我也准备研究,不知道能不能分享一下
我已经重新设计了新的交互库,10分钟就能完成接入,也许可以帮助你.
Java:
https://github.com/SDBridge/SDBridgeJava
Kotlin:
https://github.com/SDBridge/SDBridgeKotlin
1.例如图片的请求。或者是css的请求。通过加载本地HTML只能解决部分问题。所以应该好需要h5页面中请求的拦截。
不能implements吗,你的demo我run的时候报错解决不了
Unable to find method 'org.gradle.api.tasks.compile.CompileOptions.getBootClasspath()Ljava/lang/String;'.
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.