2 Star 1 Fork 0

CHINASOFT3_OHOS / Proteus

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Proteus

项目介绍

  • 项目名称:Proteus
  • 所属系列:openharmony 第三方组件适配移植
  • 功能:一个可从后台动态变更页面的组件
  • 项目移植状态:主功能完成
  • 调用差异:有(json数据中将布局名称等更换为openharmony 布局名称)
  • 开发版本:sdk6,DevEco Studio2.2 beta1
  • 基线版本:Release 5.0.1

效果演示

demonstration

安装教程

  1. 在项目根目录下的build.gradle文件中,
// 添加maven仓库
repositories {
    maven {
        url 'https://s01.oss.sonatype.org/content/repositories/releases/'
    }
}
  1. 在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

ProteusView view = proteusLayoutInflater.inflate(<layout>, <data>);
container.addView(view.getAsView());

Output

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.

    • Install NodeJS here
    • 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

Repository Comments ( 0 )

Sign in to post a comment

About

一个可从后台动态变更页面的组件 expand collapse
Java and 2 more languages
Apache-2.0
Cancel

Proteus

Contributors

All

Activities

Load More
can not load any more
1
https://gitee.com/chinasoft3_ohos/proteus.git
git@gitee.com:chinasoft3_ohos/proteus.git
chinasoft3_ohos
proteus
Proteus
master

Search