
回复
1.在项目根目录下的build.gradle文件中,
allprojects {
repositories {
maven {
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}
}
}
2.在entry模块的build.gradle文件中,
dependencies {
implementation('com.gitee.chinasoft_ohos:PixImagePicker:1.2.5')
......
}
在sdk6,DevEco Studio2.2 Beta1下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下
Options options = Options.init()
.setRequestCode(100) //Request code for ability results
.setCount(3) //Number of images to restict selection count
.setFrontfacing(false) //Front Facing camera on start
.setPreSelectedUrls(returnValue) //Pre selected Image Urls
.setSpanCount(4) //Span count for gallery min 1 & max 5
.setMode(Options.Mode.All) //Option to select only pictures or videos or both
.setVideoDurationLimitinSeconds(30) //Duration for video recording
.setScreenOrientation(AbilityInfo.DisplayOrientation.PORTRAIT) //Orientaion
.setPath("/pix/images"); //Custom Path For media Storage
Pix.start(MainAbility.this, options);
或者直接使用最小配置去获取图片
Pix.start(MainAbility.this, Options.init().setRequestCode(100));
在onAbilityResult方法里获取返回的结果
@Override
protected void onAbilityResult(int requestCode, int resultCode, Intent resultData) {
super.onAbilityResult(requestCode, resultCode, resultData);
if (requestCode == options.getRequestCode()) {
ArrayList<String> returnValue = resultData.getSequenceableArrayListParam(Pix.IMAGE_RESULTS);
}
}
CodeCheck代码测试无异常
CloudTest代码测试无异常
病毒安全检测通过
当前版本demo功能与原组件基本无差异
1.2.5
0.0.1-SNAPSHOT
Licensed under the Apache License, Version 2.0, click here for the full license.