
回复
// 添加maven仓库
repositories {
maven {
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}
}
// 添加依赖库
dependencies {
implementation 'com.gitee.chinasoft_ohos:proteus-core:1.0.0'
implementation 'com.gitee.chinasoft_ohos:proteus-support-v4:1.0.0'
implementation 'com.gitee.chinasoft_ohos:proteus-recyclerview-v7:1.0.0'
implementation 'com.gitee.chinasoft_ohos:proteus-cardview-v7:1.0.0'
implementation 'com.gitee.chinasoft_ohos:proteus-gson-adapter:1.0.0'
}
在sdk5,DevEco Studio2.2 beta1下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下
Sample layout
{
“ type”:“ DirectionalLayout” ,
“ orientation”:“ vertical” ,
“ padding”:“ 16vp” ,
“ children”:[ {
“ type”:“ Text” ,
“ width”:“ 200vp” ,
“ gravity”:“ center” ,
“ text”:“ @ {user.profile.name}”
} , {
“ type”:“ ProgressBar” ,
“ width“ :” 200vp“ ,
” layout_marginTop“:” 8vp“,
“ max”:6000 ,
“ progress”:“ @ {user.profile.experience}”
} ]
}
Sample data
{
“ user”:{
“ profile”:{
“ name”:“ John Doe” ,
“ experience”:4192
}
}
}
Sample Java code
ProteusView view = proteusLayoutInflater.inflate(<layout>, <data>);
container.addView(view.getAsView());
Output
Setting up the Demo App
The demo app will let you play around with proteus as well as help you understand the internals better.
npm start
Ready to tinker
CodeCheck代码测试无异常
CloudTest代码测试无异常
病毒安全检测通过
当前版本demo功能与原组件基本无差异
Apache v2.0
If you are using proteus check out the can, cannot and must