Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
8ff00512
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
8ff00512
编写于
8月 28, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 28, 2023
浏览文件
操作
浏览文件
下载
差异文件
!23235 文档告警处理
Merge pull request !23235 from 牛雨欣/master
上级
3261b6d5
9f0a53d9
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
385 addition
and
279 deletion
+385
-279
en/application-dev/file-management/photoAccessHelper-notify-guidelines.md
...ev/file-management/photoAccessHelper-notify-guidelines.md
+2
-2
en/application-dev/file-management/photoAccessHelper-userAlbum-guidelines.md
...file-management/photoAccessHelper-userAlbum-guidelines.md
+6
-6
en/application-dev/reference/apis/js-apis-photoAccessHelper.md
...plication-dev/reference/apis/js-apis-photoAccessHelper.md
+369
-263
zh-cn/application-dev/file-management/photoAccessHelper-userAlbum-guidelines.md
...file-management/photoAccessHelper-userAlbum-guidelines.md
+8
-8
未找到文件。
en/application-dev/file-management/photoAccessHelper-notify-guidelines.md
浏览文件 @
8ff00512
...
...
@@ -47,7 +47,7 @@ try {
let
fileAsset
:
photoAccessHelper
.
PhotoAsset
=
await
fetchResult
.
getFirstObject
();
console
.
info
(
'
getAssets fileAsset.uri :
'
+
fileAsset
.
uri
);
let
onCallback
=
(
changeData
:
dataSharePredicates
.
ChangeData
)
=>
{
let
onCallback
=
(
changeData
:
photoAccessHelper
.
ChangeData
)
=>
{
console
.
info
(
'
onCallback successfully, changData:
'
+
JSON
.
stringify
(
changeData
));
}
phAccessHelper
.
registerChange
(
fileAsset
.
uri
,
false
,
onCallback
);
...
...
@@ -137,7 +137,7 @@ Example: Register a listener for all file assets. When an observed file asset is
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
import
photoAccessHelper
from
'
@ohos.file.photoAccessHelper
'
;
let
onCallback
=
(
changeData
:
dataSharePredicates
.
ChangeData
)
=>
{
let
onCallback
=
(
changeData
:
photoAccessHelper
.
ChangeData
)
=>
{
console
.
info
(
'
onCallback successfully, changData:
'
+
JSON
.
stringify
(
changeData
));
}
phAccessHelper
.
registerChange
(
photoAccessHelper
.
DefaultChangeUri
.
DEFAULT_PHOTO_URI
,
true
,
onCallback
);
...
...
en/application-dev/file-management/photoAccessHelper-userAlbum-guidelines.md
浏览文件 @
8ff00512
...
...
@@ -38,7 +38,7 @@ import photoAccessHelper from '@ohos.file.photoAccessHelper';
try {
let albumName = 'albumName';
let album = await phAccessHelper.createAlbum(albumName);
let album
: photoAccessHelper.Album
= await phAccessHelper.createAlbum(albumName);
console.info('createAlbum successfully, album: ' + album.albumName + ' album uri: ' + album.albumUri);
} catch (err) {
console.error('createAlbum failed with err: ' + err);
...
...
@@ -67,7 +67,7 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumName: photoAccessHelper.AlbumKeys = photoAccessHelper.AlbumKey.ALBUM_NAME;
let albumName: photoAccessHelper.AlbumKeys
.ALBUM_NAME
= photoAccessHelper.AlbumKey.ALBUM_NAME;
predicates.equalTo(albumName, 'albumName');
let fetchOptions: photoAccessHelper.FetchOptions = {
fetchColumns: [],
...
...
@@ -112,7 +112,7 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumName: photoAccessHelper..AlbumKeys = photoAccessHelper.AlbumKey.ALBUM_NAME;
let albumName: photoAccessHelper..AlbumKeys
.ALBUM_NAME
= photoAccessHelper.AlbumKey.ALBUM_NAME;
predicates.equalTo(albumName, 'albumName');
let fetchOptions: photoAccessHelper.FetchOptions = {
fetchColumns: [],
...
...
@@ -157,7 +157,7 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
let albumPredicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumName: photoAccessHelper..AlbumKeys = photoAccessHelper.AlbumKey.ALBUM_NAME;
let albumName: photoAccessHelper..AlbumKeys
.ALBUM_NAME
= photoAccessHelper.AlbumKey.ALBUM_NAME;
albumPredicates.equalTo(albumName, 'albumName');
let albumFetchOptions: dataSharePredicates.FetchOptions = {
fetchColumns: [],
...
...
@@ -265,7 +265,7 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
let albumPredicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumName: photoAccessHelper.AlbumKeys = photoAccessHelper.AlbumKey.ALBUM_NAME;
let albumName: photoAccessHelper.AlbumKeys
.ALBUM_NAME
= photoAccessHelper.AlbumKey.ALBUM_NAME;
albumPredicates.equalTo(albumName, 'albumName');
let albumFetchOptions: photoAccessHelper.FetchOptions = {
fetchColumns: [],
...
...
@@ -316,7 +316,7 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumName: photoAccessHelper.AlbumKeys = photoAccessHelper.AlbumKey.ALBUM_NAME;
let albumName: photoAccessHelper.AlbumKeys
..ALBUM_NAME
= photoAccessHelper.AlbumKey.ALBUM_NAME;
predicates.equalTo(albumName, '%albumName%');
let fetchOptions: photoAccessHelper.FetchOptions = {
fetchColumns: [],
...
...
en/application-dev/reference/apis/js-apis-photoAccessHelper.md
浏览文件 @
8ff00512
此差异已折叠。
点击以展开。
zh-cn/application-dev/file-management/photoAccessHelper-userAlbum-guidelines.md
浏览文件 @
8ff00512
...
...
@@ -37,7 +37,7 @@ photoAccessHelper提供用户相册相关的接口,供开发者创建、删除
import photoAccessHelper from '@ohos.file.photoAccessHelper';
try {
let albumName
: photoAccessHelper.AlbumName
= 'albumName';
let albumName = 'albumName';
let album: photoAccessHelper.Album = await phAccessHelper.createAlbum(albumName);
console.info('createAlbum successfully, album: ' + album.albumName + ' album uri: ' + album.albumUri);
} catch (err) {
...
...
@@ -67,7 +67,7 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumName: photoAccessHelper = photoAccessHelper.AlbumKey.ALBUM_NAME;
let albumName: photoAccessHelper
.ALBUM_NAME
= photoAccessHelper.AlbumKey.ALBUM_NAME;
predicates.equalTo(albumName, 'albumName');
let fetchOptions: photoAccessHelper.FetchOptions = {
fetchColumns: [],
...
...
@@ -114,7 +114,7 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumName: photoAccessHelper = photoAccessHelper.AlbumKey.ALBUM_NAME;
let albumName: photoAccessHelper
.AlbumKey.ALBUM_NAME
= photoAccessHelper.AlbumKey.ALBUM_NAME;
predicates.equalTo(albumName, 'albumName');
let fetchOptions: photoAccessHelper.FetchOptions = {
fetchColumns: [],
...
...
@@ -159,7 +159,7 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
let albumPredicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumName: photoAccessHelper = photoAccessHelper.AlbumKey.ALBUM_NAME;
let albumName: photoAccessHelper
.AlbumKey.ALBUM_NAME
= photoAccessHelper.AlbumKey.ALBUM_NAME;
albumPredicates.equalTo(albumName, 'albumName');
let albumFetchOptions: dataSharePredicates.FetchOptions = {
fetchColumns: [],
...
...
@@ -176,8 +176,8 @@ try {
let albumFetchResult: photoAccessHelper.FetchResult<photoAccessHelper.Album> = await phAccessHelper.getAlbums(photoAccessHelper.AlbumType.USER, photoAccessHelper.AlbumSubtype.USER_GENERIC, albumFetchOptions);
let album: photoAccessHelper.Album = await albumFetchResult.getFirstObject();
console.info('getAlbums successfully, albumName: ' + album.albumName);
let photoFetchResult = await phAccessHelper.getAssets(photoFetchOptions);
let fileAsset = await photoFetchResult.getFirstObject();
let photoFetchResult
: photoAccessHelper.FetchResult<photoAccessHelper.PhotoAsset>
= await phAccessHelper.getAssets(photoFetchOptions);
let fileAsset
: photoAccessHelper.PhotoAsset
= await photoFetchResult.getFirstObject();
console.info('getAssets successfully, albumName: ' + fileAsset.displayName);
await album.addAssets([fileAsset]);
albumFetchResult.close();
...
...
@@ -267,7 +267,7 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
let albumPredicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumName = photoAccessHelper.AlbumKey.ALBUM_NAME;
let albumName
: photoAccessHelper.AlbumKey.ALBUM_NAME
= photoAccessHelper.AlbumKey.ALBUM_NAME;
albumPredicates.equalTo(albumName, 'albumName');
let albumFetchOptions: photoAccessHelper.FetchOptions = {
fetchColumns: [],
...
...
@@ -318,7 +318,7 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumName = photoAccessHelper.AlbumKey.ALBUM_NAME;
let albumName
: photoAccessHelper.AlbumKey.ALBUM_NAME
= photoAccessHelper.AlbumKey.ALBUM_NAME;
predicates.equalTo(albumName, '%albumName%');
let fetchOptions: photoAccessHelper.FetchOptions = {
fetchColumns: [],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录