diff --git a/LICENSE b/LICENSE index 0210352ae2ade0dd7b4c841cb6e8ba08b4780038..18795a48d6b12fcdc1aa7bac9a9cb99f83815267 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ - Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.en.md b/README.en.md index ac5b57accacc6316a08b45c80b6309aeb2db698a..b7030237d1b57ce12d0fee2bd8a6759abf20f30e 100644 --- a/README.en.md +++ b/README.en.md @@ -8,11 +8,11 @@ Learn how to implement file management, including saving and reading app files, ## Concepts -- Files manager: provides APIs for file operations, including accessing and managing files and directories, obtaining file information, and reading and writing data using streams. (**@ohos.file.fs**) -- Picker: encapsulates APIs such as **DocumentViewPicker**, and **AudioViewPicker** for you to pick and save files. (**@ohos.file.picker**) -- Photo manager: provides the photo management capabilities, including creating an album, and accessing and modifying media data in the album, and **PhotoViewPicker**. (**@ohos.file.photoAccessHelper**) -- PhotoViewPicker: allows you to pick and save images and videos. -- DocumentViewPicker: allows you to pick and save documents in different formats. +- [Files manager](https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-file-fs): provides APIs for file operations, including accessing and managing files and directories, obtaining file information, and reading and writing data using streams. (**@ohos.file.fs**) +- [Picker](https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-file-picker): encapsulates APIs such as **DocumentViewPicker**, and **AudioViewPicker** for you to pick and save files. (**@ohos.file.picker**) +- [Photo manager](https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-file-picker): provides the photo management capabilities, including creating an album, and accessing and modifying media data in the album, and **PhotoViewPicker**. (**@ohos.file.photoAccessHelper**) +- [PhotoViewPicker](https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-file-picker#photoviewpickerdeprecated): allows you to pick and save images and videos. +- [DocumentViewPicker](https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-file-picker#documentviewpicker): allows you to pick and save documents in different formats. ## Permissions diff --git a/README.md b/README.md index b88be6e608bbb18c9b516a31fa55fe8c48011be8..53f02590214697a76fc03f77dd4adfa1ecddc2c7 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ ## 相关概念 -- 文件管理能力:该模块为基础文件操作API,提供基础文件操作能力,包括文件基本管理、文件目录管理、文件信息统计、文件流式读写等常用功能。(@ohos.file.fs) -- 选择器: 选择器(Picker)是一个封装DocumentViewPicker、AudioViewPicker等API模块,具有选择与保存的能力。(@ohos.file.picker) -- 相册管理模块:该模块提供相册管理模块能力,包括创建相册以及访问、修改相册中的媒体数据信息以及PhotoViewPicker等。(@ohos.file.photoAccessHelper) -- PhotoViewPicker:图库选择器对象,用来支撑选择图片/视频和保存图片/视频等用户场景。 -- DocumentViewPicker:文件选择器对象,用来支撑选择和保存各种格式文档。 +- [文件管理能力](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/js-apis-file-fs):该模块为基础文件操作API,提供基础文件操作能力,包括文件基本管理、文件目录管理、文件信息统计、文件流式读写等常用功能。(@ohos.file.fs) +- [选择器](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/js-apis-file-picker): 选择器(Picker)是一个封装DocumentViewPicker、AudioViewPicker等API模块,具有选择与保存的能力。(@ohos.file.picker) +- [相册管理模块](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/js-apis-photoaccesshelper):该模块提供相册管理模块能力,包括创建相册以及访问、修改相册中的媒体数据信息以及PhotoViewPicker等。(@ohos.file.photoAccessHelper) +- [PhotoViewPicker](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-apis-photoaccesshelper-photoviewpicker):图库选择器对象,用来支撑选择图片/视频和保存图片/视频等用户场景。 +- [DocumentViewPicker](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/js-apis-file-picker#documentviewpicker):文件选择器对象,用来支撑选择和保存各种格式文档。 ## 相关权限 diff --git a/entry/src/main/ets/common/utils/Logger.ets b/entry/src/main/ets/common/utils/Logger.ets index 8682d2ab830588b6c042f964700940a8a5ad1109..5c58e64f69e763fccc38726c9332a890f82338c5 100644 --- a/entry/src/main/ets/common/utils/Logger.ets +++ b/entry/src/main/ets/common/utils/Logger.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/common/utils/PictureSaving.ets b/entry/src/main/ets/common/utils/PictureSaving.ets index 9ed07316457adb31abb8d3dd699bf560a70360b7..96375b768aebdfc6a58d476fdcf348973c845990 100644 --- a/entry/src/main/ets/common/utils/PictureSaving.ets +++ b/entry/src/main/ets/common/utils/PictureSaving.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License,Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/common/utils/ReadFile.ets b/entry/src/main/ets/common/utils/ReadFile.ets index 5bfa86eb7571a4c892c8dab8dfec78216602c1dc..f67ef147a08bf70570751a858806726c2611da11 100644 --- a/entry/src/main/ets/common/utils/ReadFile.ets +++ b/entry/src/main/ets/common/utils/ReadFile.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License,Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/common/utils/SavingAndSelectUserFile.ets b/entry/src/main/ets/common/utils/SavingAndSelectUserFile.ets index 62b56916dbd2e3b4a45446ea3479cdb9e54d4840..72cdadd606f2232fc6c5a5911b364f545085b0c7 100644 --- a/entry/src/main/ets/common/utils/SavingAndSelectUserFile.ets +++ b/entry/src/main/ets/common/utils/SavingAndSelectUserFile.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License,Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/common/utils/WriteFile.ets b/entry/src/main/ets/common/utils/WriteFile.ets index b1cfd57e5f9f53638a0a87f71e16a809e8fb6007..388a45f7d4757743a1739c62d2883531d1db7ca2 100644 --- a/entry/src/main/ets/common/utils/WriteFile.ets +++ b/entry/src/main/ets/common/utils/WriteFile.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License,Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 9827b546ee821dd7c141a34e939b10a73e9cf803..ddf6cccf120a3e968c9d196490a8069b4eae7744 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License,Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,6 +16,7 @@ import { UIAbility, Want, AbilityConstant } from '@kit.AbilityKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { window } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; export default class EntryAbility extends UIAbility { onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { @@ -29,6 +30,16 @@ export default class EntryAbility extends UIAbility { onWindowStageCreate(windowStage: window.WindowStage): void { // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + windowStage.getMainWindow().then(windowClass => { + hilog.info(0x0000, 'testTag', '%{public}s','Succeeded in obtaining the main window. Data: ' + JSON.stringify(windowClass)); + windowClass.setWindowLayoutFullScreen(true).then(() => { + hilog.info(0x0000, 'testTag', '%{public}s','Succeeded in setting the window layout to full-screen mode.'); + }).catch((e: BusinessError) => { + hilog.error(0x0000, 'testTag', '%{public}s','Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(e)); + }) + }).catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', '%{public}s', 'Failed to obtain the main window. Cause: ' + JSON.stringify(err)); + }) windowStage.loadContent('pages/HomePage', (err, data) => { if (err.code) { diff --git a/entry/src/main/ets/pages/HomePage.ets b/entry/src/main/ets/pages/HomePage.ets index eafdd35a359b667362e333bf3dc2bc74adbdbb0c..9da83dad821b4298936a6a72830388099dd9d581 100644 --- a/entry/src/main/ets/pages/HomePage.ets +++ b/entry/src/main/ets/pages/HomePage.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License,Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -69,5 +69,6 @@ struct HomePage { .backgroundColor($r('app.color.picture_background')) .justifyContent(FlexAlign.Center) .width('100%') + .padding({ top: $r('app.float.default_48') }) } } \ No newline at end of file diff --git a/entry/src/main/ets/view/ApplicationFileTab.ets b/entry/src/main/ets/view/ApplicationFileTab.ets index 3d6057d947143e9b571ee48fc9767446989c4a44..00c2d137aeb8f8c9a7562a4cd15caaeebdf1a01e 100644 --- a/entry/src/main/ets/view/ApplicationFileTab.ets +++ b/entry/src/main/ets/view/ApplicationFileTab.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License,Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/view/PublicFilesTab.ets b/entry/src/main/ets/view/PublicFilesTab.ets index 5dfae59b01b3194a1afdf2692eb1095507d8e708..d4b1326e364e904426822d12563117b590de70b4 100644 --- a/entry/src/main/ets/view/PublicFilesTab.ets +++ b/entry/src/main/ets/view/PublicFilesTab.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License,Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 index 0ce8c1f598ef975b2d64a1079d46e78a22a75cab..c7d349879677bab8b4299490ad78dbd390798774 100644 --- a/hvigor/hvigor-config.json5 +++ b/hvigor/hvigor-config.json5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/screenshots/device/file.en.gif b/screenshots/device/file.en.gif index eb8dcfd5f68a3ee040b0a15a6ea7a87bc1dd61f0..dc23ab6df697c4ddd532fe3648eeaed5b9dbc948 100644 Binary files a/screenshots/device/file.en.gif and b/screenshots/device/file.en.gif differ diff --git a/screenshots/device/file.gif b/screenshots/device/file.gif index 4a30e15e3493d06271205f397be014a786f26211..0af4bf447a04c7d7e25dc907b49eed2a11c9b428 100644 Binary files a/screenshots/device/file.gif and b/screenshots/device/file.gif differ