diff --git a/ArkUI/PureTabsExt/entry/src/main/ets/view/InTabComponent.ets b/ArkUI/PureTabsExt/entry/src/main/ets/view/InTabComponent.ets index dc7f7154c2aeb1f625b96d1221def8c888bbfe6b..81999269719c8423601719861109f4c5a6cc2673 100644 --- a/ArkUI/PureTabsExt/entry/src/main/ets/view/InTabComponent.ets +++ b/ArkUI/PureTabsExt/entry/src/main/ets/view/InTabComponent.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AbilityConstant,Configuration } from "@kit.AbilityKit"; +import { AbilityConstant, common,Configuration } from "@kit.AbilityKit"; import { BusinessError } from '@kit.BasicServicesKit'; import { hilog } from "@kit.PerformanceAnalysisKit"; @@ -40,7 +40,7 @@ export default struct InTabComponent { } private async updateTabItems(){ - await this.getUIContext().getHostContext()?.resourceManager.getStringArrayValue($r('app.strarray.in_tabs_items')) + await this.getUIContext().getHostContext()?.resourceManager.getStringArrayValue($r('app.strarray.in_tabs_items').id) .then((strarray: string[]) => { this.tabItems = strarray; }) diff --git a/ArkUI/PureTabsExt/entry/src/main/ets/view/SwitchTabComponent.ets b/ArkUI/PureTabsExt/entry/src/main/ets/view/SwitchTabComponent.ets index 3169907446554cceadb3ad3810d5e0a71bce2e2b..e2528a293becb424feb6926c7ecbd0dfba35af70 100644 --- a/ArkUI/PureTabsExt/entry/src/main/ets/view/SwitchTabComponent.ets +++ b/ArkUI/PureTabsExt/entry/src/main/ets/view/SwitchTabComponent.ets @@ -33,7 +33,7 @@ export default struct SwitchTabComponent { private async updateTabItems() { await this.getUIContext() - .getHostContext()?.resourceManager.getStringArrayValue($r('app.strarray.switch_tabs_items')) + .getHostContext()?.resourceManager.getStringArrayValue($r('app.strarray.switch_tabs_items').id) .then((strarray: string[]) => { this.tabItems = strarray; }) diff --git a/GesturesConfictPractice/README.md b/GesturesConfictPractice/README.md index ba7cf927ccbb656c01973f4c1756ec4396a039ed..12718ebbe98eb627ce3b131ceed876b9b85a84fa 100644 --- a/GesturesConfictPractice/README.md +++ b/GesturesConfictPractice/README.md @@ -21,7 +21,7 @@ 安装运行应用,进入应用首页,点击不同的按钮跳转到不同的手势场景示例。 -## 工程目录 +### 工程目录 ``` ├──entry/src/main/ets @@ -48,7 +48,7 @@ * 允许使用Internet网络:ohos.permission.INTERNET。 -## 约束与限制 +### 约束与限制 * 本示例仅支持标准系统上运行,支持设备:华为手机。 * HarmonyOS系统:HarmonyOS 5.0.5 Release及以上。 diff --git a/HDRVivid/AVPlayer/MediaService/src/main/ets/controller/AvSessionController.ets b/HDRVivid/AVPlayer/MediaService/src/main/ets/controller/AvSessionController.ets index cbbd01ae3bfcd27039a0d0b51186e366a64db258..693cea3b23da7bea85752b99f90d1ef962ffe5e8 100644 --- a/HDRVivid/AVPlayer/MediaService/src/main/ets/controller/AvSessionController.ets +++ b/HDRVivid/AVPlayer/MediaService/src/main/ets/controller/AvSessionController.ets @@ -80,7 +80,7 @@ export class AvSessionController { try { let metadata: avSession.AVMetadata = { assetId: `${curSource.index}`, - title: this.context?.resourceManager.getStringSync(curSource.name), + title: this.context?.resourceManager.getStringSync(curSource.name.id), mediaImage: imagePixMap, duration: duration }; diff --git a/HDRVivid/AVPlayer/MediaService/src/main/ets/utils/ImageUtil.ets b/HDRVivid/AVPlayer/MediaService/src/main/ets/utils/ImageUtil.ets index b268d3157cbc9332fdbd0845793f83e93bad4194..73e46703890e14761363f4efa0af0023ccfdf8f5 100644 --- a/HDRVivid/AVPlayer/MediaService/src/main/ets/utils/ImageUtil.ets +++ b/HDRVivid/AVPlayer/MediaService/src/main/ets/utils/ImageUtil.ets @@ -22,11 +22,7 @@ export class ImageUtil { public static async getPixmapFromMedia(resource: Resource, UIContext: UIContext) { let unit8Array: Uint8Array | undefined = undefined; try { - unit8Array = await UIContext.getHostContext()?.resourceManager?.getMediaContent({ - bundleName: resource.bundleName, - moduleName: resource.moduleName, - id: resource.id - }); + unit8Array = await UIContext.getHostContext()?.resourceManager?.getMediaContent(resource.id); } catch (error) { Logger.error(`getMediaContent failed Cause: ${JSON.stringify(error)}`); } diff --git a/HDRVivid/AVPlayer/README.md b/HDRVivid/AVPlayer/README.md index 944700acf87cbdeea94eb5a6d1e7228ad0412ebf..b7beb4221486e3e4ff9c59fe319a9aa431545840 100644 --- a/HDRVivid/AVPlayer/README.md +++ b/HDRVivid/AVPlayer/README.md @@ -65,11 +65,11 @@ 1. 本示例仅支持标准系统上运行,支持设备:华为手机。 -2. HarmonyOS系统:HarmonyOS 5.0.5 Release及以上。 +2. HarmonyOS系统:HarmonyOS 6.0.0 Release及以上。 -3. DevEco Studio版本:DevEco Studio 5.0.5 Release及以上。 +3. DevEco Studio版本:DevEco Studio 6.0.0 Release及以上。 -4. HarmonyOS SDK版本:HarmonyOS 5.0.5 Release SDK及以上。 +4. HarmonyOS SDK版本:HarmonyOS 6.0.0 Release SDK及以上。 ### 下载 diff --git a/HDRVivid/AVPlayer/build-profile.json5 b/HDRVivid/AVPlayer/build-profile.json5 index c564392d7258e0a701e1ecb01c37f017e03c6ed1..748ebf8f1077803a01f75a983f9fc453fb31ca09 100644 --- a/HDRVivid/AVPlayer/build-profile.json5 +++ b/HDRVivid/AVPlayer/build-profile.json5 @@ -5,8 +5,8 @@ { "name": "default", "signingConfig": "default", - "compatibleSdkVersion": "5.0.5(17)", - "targetSdkVersion": "5.0.5(17)", + "compatibleSdkVersion": "6.0.0(20)", + "targetSdkVersion": "6.0.0(20)", "runtimeOS": "HarmonyOS", } ], diff --git a/HDRVivid/AVPlayer/entry/src/main/ets/view/AVPlayer.ets b/HDRVivid/AVPlayer/entry/src/main/ets/view/AVPlayer.ets index 5d1a6ab0541c41a31fa3eccd6f41043266767e38..79d52674cd9a820d9e20e457ca2cd946a99af9dd 100644 --- a/HDRVivid/AVPlayer/entry/src/main/ets/view/AVPlayer.ets +++ b/HDRVivid/AVPlayer/entry/src/main/ets/view/AVPlayer.ets @@ -96,38 +96,25 @@ export struct VideoPlayer { let audioManager = audio.getAudioManager(); let audioVolumeManger: audio.AudioVolumeManager = audioManager.getVolumeManager(); + try { + this.volume = audioVolumeManger.getVolumeByStream(audio.StreamUsage.STREAM_USAGE_MOVIE); + + let maxNum = audioVolumeManger.getMaxVolumeByStream(audio.StreamUsage.STREAM_USAGE_MUSIC); + hilog.info(0x0000, 'AVPlayer', `Callback invoked to indicate that the maximum volume is obtained. ${maxNum}`); + + let minNum = audioVolumeManger.getMinVolumeByStream(audio.StreamUsage.STREAM_USAGE_MUSIC); + hilog.info(0x0000, 'AVPlayer', `Callback invoked to indicate that the maximum volume is obtained. ${minNum}`); + } catch (err) { + let error = err as BusinessError; + hilog.error(0x0000, 'AVPlayer', `code=${error.code}, message=${error.message}`); + } + audioVolumeManger.getVolumeGroupManager(groupId, (err: BusinessError, value: audio.AudioVolumeGroupManager) => { if (err) { hilog.error(0x0000, 'AVPlayer', `Failed to obtain the colume group infos list. ${err}`); return; } - let audioVolumeGroupManager = value; hilog.info(0x0000, 'AVPlayer', `Callback invoked to indicate that the volume group infos list is obtained.`); - - audioVolumeGroupManager.getVolume(audio.AudioVolumeType.MEDIA, (err: BusinessError, value: number) => { - if (err) { - hilog.error(0x0000, 'AVPlayer', `Failed to obtain the volume. ${err}`); - return; - } - this.volume = value; - hilog.info(0x0000, 'AVPlayer', `Callback invoked to indicate that the volume is obtained. ${value}`); - }); - - audioVolumeGroupManager.getMaxVolume(audio.AudioVolumeType.MEDIA, (err: BusinessError, value: number) => { - if (err) { - hilog.error(0x0000, 'AVPlayer', `Failed to obtain the maximum volume. ${err}`); - return; - } - hilog.info(0x0000, 'AVPlayer', `Callback invoked to indicate that the maximum volume is obtained. ${value}`); - }); - - audioVolumeGroupManager.getMinVolume(audio.AudioVolumeType.MEDIA, (err: BusinessError, value: number) => { - if (err) { - hilog.error(0x0000, 'AVPlayer', `Failed to obtain the minimum volume. ${err}`); - return; - } - hilog.info(0x0000, 'AVPlayer', `Callback invoked to indicate that the minimum volume is obtained. ${value}`); - }); }); } @@ -198,7 +185,7 @@ export struct VideoPlayer { .width(this.isFloatWindow ? $r('app.float.size_24') : $r('app.float.icon_size_large')) .aspectRatio(1) .visibility(this.isFullScreen || this.isFullLandscapeScreen || this.isFloatWindow ? - Visibility.Visible : Visibility.Hidden) + Visibility.Visible : Visibility.Hidden) Image($r('app.media.ic_video_menu_forward')) .monopolizeEvents(true) .width(this.isFloatWindow ? $r('app.float.size_24') : $r('app.float.icon_size_large')) @@ -307,7 +294,8 @@ export struct VideoPlayer { .onActionUpdate((event: GestureEvent) => { if (event.fingerList[0].globalX > (820 / 2)) { this.visible = true; - let curBrightness = this.screenBrightness - this.uiContext.vp2px(event.offsetY) / this.uiContext.vp2px(this.screenHeight); + let curBrightness = + this.screenBrightness - this.uiContext.vp2px(event.offsetY) / this.uiContext.vp2px(this.screenHeight); curBrightness = curBrightness >= 1.0 ? 1.0 : curBrightness; curBrightness = curBrightness <= 0.0 ? 0.0 : curBrightness; this.screenBrightness = curBrightness; @@ -458,7 +446,7 @@ export struct VideoPlayer { Column() { Row() { Image(this.avPlayerController.isPlaying ? $r('sys.media.ohos_ic_public_pause') : - $r('app.media.ic_video_menu_play')) + $r('app.media.ic_video_menu_play')) .width($r('app.float.size_24')) .height($r('app.float.size_24')) .fillColor(Color.White) @@ -488,12 +476,13 @@ export struct VideoPlayer { .zIndex(CommonConstants.SLIDER_INDEX) .onAreaChange(() => { try { - let videoSlider: componentUtils.ComponentInfo = this.getUIContext().getComponentUtils().getRectangleById('video_slider'); + let videoSlider: componentUtils.ComponentInfo = + this.getUIContext().getComponentUtils().getRectangleById('video_slider'); this.slideWidth = this.uiContext.px2vp(videoSlider.size.width); this.offsetY = this.uiContext.px2vp(videoSlider.localOffset.y); this.beginX = this.uiContext.px2vp(videoSlider.localOffset.x); } catch (error) { - hilog.error(0x0000, 'testTag',`getRectangleById failed, Code:${error.code}, message:${error.message}`); + hilog.error(0x0000, 'testTag', `getRectangleById failed, Code:${error.code}, message:${error.message}`); } }) .onChange((value: number, mode: SliderChangeMode) => { @@ -571,14 +560,14 @@ export struct VideoPlayer { let context = this.uiContext.getHostContext() as common.UIAbilityContext; await window.getLastWindow(context) .then((windowClass: window.Window) => { - windowClass.setWindowKeepScreenOn(false) + windowClass.setWindowKeepScreenOn(false) .catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag',`setWindowKeepScreenOn failed, Code:${err.code}, message:${err.message}`); + hilog.error(0x0000, 'testTag', `setWindowKeepScreenOn failed, Code:${err.code}, message:${err.message}`); }) }) - .catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag',`getLastWindow failed, Code:${err.code}, message:${err.message}`); - }) + .catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `getLastWindow failed, Code:${err.code}, message:${err.message}`); + }) return; } if (this.avPlayerController.isReady === true) { @@ -601,12 +590,12 @@ export struct VideoPlayer { await window.getLastWindow(context) .then((windowClass: window.Window) => { windowClass.setWindowKeepScreenOn(true) - .catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag',`setWindowKeepScreenOn failed, Code:${err.code}, message:${err.message}`); - }) + .catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `setWindowKeepScreenOn failed, Code:${err.code}, message:${err.message}`); + }) }) .catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag',`getLastWindow failed, Code:${err.code}, message:${err.message}`); + hilog.error(0x0000, 'testTag', `getLastWindow failed, Code:${err.code}, message:${err.message}`); }) } diff --git a/MaliangGPU/.gitignore b/MaliangGPU/.gitignore deleted file mode 100644 index d2ff20141ceed86d87c0ea5d99481973005bab2b..0000000000000000000000000000000000000000 --- a/MaliangGPU/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy -**/.test -/.appanalyzer \ No newline at end of file diff --git a/MaliangGPU/README.md b/MaliangGPU/README.md index 92b355346264b72d07252566e812da286c444fd4..b8eb3fd193312d2ff19075d41144a36f24c975bb 100644 --- a/MaliangGPU/README.md +++ b/MaliangGPU/README.md @@ -11,13 +11,16 @@ ## 工程目录 ``` -├──entry/src/main -│ └──ets -│ └──pages -│ ├──field.glsl // GLSL样例代码 -│ ├──Index.ets // 首页 -│ └──shader.frag // GLSL样例代码 -└──entry/src/main/resources // 资源文件目录 +├──entry/src/main/ets // 代码区 +│ ├──entryability +│ │ └──EntryAbility.ets // 程序入口类 +│ ├──entrybackupability +│ │ └──EntryBackupAbility.ets // 应用数据备份和恢复 +│ └──pages +│ ├──field.glsl // GLSL样例代码 +│ ├──Index.ets // 首页 +│ └──shader.frag // GLSL样例代码 +└──entry/src/main/resources // 资源文件目录 ``` ## 具体实现 diff --git a/MaliangGPU/entry/.gitignore b/MaliangGPU/entry/.gitignore deleted file mode 100644 index e2713a2779c5a3e0eb879efe6115455592caeea5..0000000000000000000000000000000000000000 --- a/MaliangGPU/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/MaliangGPU/entry/src/mock/mock-config.json5 b/MaliangGPU/entry/src/mock/mock-config.json5 deleted file mode 100644 index 7a73a41bfdf76d6f793007240d80983a52f15f97..0000000000000000000000000000000000000000 --- a/MaliangGPU/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/MaliangGPU/entry/src/ohosTest/ets/test/Ability.test.ets b/MaliangGPU/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 85c78f67579d6e31b5f5aeea463e216b9b141048..0000000000000000000000000000000000000000 --- a/MaliangGPU/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/MaliangGPU/entry/src/ohosTest/ets/test/List.test.ets b/MaliangGPU/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc4ed66bd98fa3865e07922906e2fcef545..0000000000000000000000000000000000000000 --- a/MaliangGPU/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/MaliangGPU/entry/src/ohosTest/module.json5 b/MaliangGPU/entry/src/ohosTest/module.json5 deleted file mode 100644 index 55725a929993a8a18b3808d41ef037759440488b..0000000000000000000000000000000000000000 --- a/MaliangGPU/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "deviceTypes": [ - "phone", - "tablet", - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/MaliangGPU/entry/src/test/List.test.ets b/MaliangGPU/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3731e283dd507c847560ee59bde477bbc7..0000000000000000000000000000000000000000 --- a/MaliangGPU/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/MaliangGPU/entry/src/test/LocalUnit.test.ets b/MaliangGPU/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc1615ee8618b4cb6a622f144a9a707eee99f..0000000000000000000000000000000000000000 --- a/MaliangGPU/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file diff --git a/XiaoyiAgentDemo/entry/src/main/ets/utils/audioplayer/MediaTools.ets b/XiaoyiAgentDemo/entry/src/main/ets/utils/audioplayer/MediaTools.ets index bfe8d50988854e5af9a70e7c2ab6a106e6f0e32d..3a9bc05c337f51e4b7d64ddb30341bfa75408e77 100644 --- a/XiaoyiAgentDemo/entry/src/main/ets/utils/audioplayer/MediaTools.ets +++ b/XiaoyiAgentDemo/entry/src/main/ets/utils/audioplayer/MediaTools.ets @@ -24,7 +24,7 @@ export class MediaTools { name: resourceManager.Resource): Promise { let resourceMgr = context.resourceManager; let fileData: Uint8Array | null = null; - resourceMgr.getMediaContent(name) + resourceMgr.getMediaContent(name.id) .then((data: Uint8Array) => { fileData = data; })