# Proteus **Repository Path**: chinasoft3_ohos/proteus ## Basic Information - **Project Name**: Proteus - **Description**: 一个可从后台动态变更页面的组件 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-05-20 - **Last Updated**: 2022-03-14 ## Categories & Tags **Categories**: harmonyos-advanced **Tags**: None ## README # Proteus #### 项目介绍 - 项目名称:Proteus - 所属系列:openharmony 第三方组件适配移植 - 功能:一个可从后台动态变更页面的组件 - 项目移植状态:主功能完成 - 调用差异:有(json数据中将布局名称等更换为openharmony 布局名称) - 开发版本:sdk6,DevEco Studio2.2 beta1 - 基线版本:Release 5.0.1 #### 效果演示 ![demonstration](https://i.loli.net/2021/05/31/ImsVfpK6ZjucLFd.gif) #### 安装教程 1. 在项目根目录下的build.gradle文件中, ``` // 添加maven仓库 repositories { maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' } } ``` 2. 在entry模块的build.gradle文件中, ``` // 添加依赖库 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 ```java ProteusView view = proteusLayoutInflater.inflate(, ); container.addView(view.getAsView()); ``` Output ![OutPut](screenshot/OutPut.png) - Setting up the Demo App The demo app will let you play around with proteus as well as help you understand the internals better. - Install NodeJS [here](https://nodejs.org/en/download/) - open a terminal - cd into the project directory - run `npm start` - Start an AVD emulator - Install the Demo App **Ready to tinker** - Tinker around with the layout and data - Hit the FAB to refresh the app. #### 测试信息 CodeCheck代码测试无异常 CloudTest代码测试无异常 病毒安全检测通过 当前版本demo功能与原组件基本无差异 #### 版本迭代 - 1.0.0 #### 版权和许可信息 ``` Apache v2.0 If you are using proteus check out the can, cannot and must ```