diff --git a/AdaptiveGrid/.gitignore b/AdaptiveGrid/.gitignore deleted file mode 100644 index 91d237bb144c7fb1777e50271857ef0f593286fc..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/node_modules -/local.properties -/.idea -**/build -/.hvigor \ No newline at end of file diff --git a/AdaptiveGrid/AppScope/app.json5 b/AdaptiveGrid/AppScope/app.json5 deleted file mode 100644 index f945ab311eac491d7cda7220a8a6ae35232291ca..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/AppScope/app.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - "app": { - "bundleName": "com.example.adaptivegrid", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "distributedNotificationEnabled": true - } -} diff --git a/AdaptiveGrid/AppScope/resources/base/element/string.json b/AdaptiveGrid/AppScope/resources/base/element/string.json deleted file mode 100644 index 3f04c34c6a3f302db92a8180cee81a2270de0967..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AdaptiveGrid" - } - ] -} diff --git a/AdaptiveGrid/AppScope/resources/base/media/app_icon.png b/AdaptiveGrid/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/AdaptiveGrid/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/AdaptiveGrid/build-profile.json5 b/AdaptiveGrid/build-profile.json5 deleted file mode 100644 index d7b1117cdb34aab2983ac65026d9e8dcc91332d1..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/build-profile.json5 +++ /dev/null @@ -1,27 +0,0 @@ -{ - "app": { - "signingConfigs": [], - "compileSdkVersion": 9, - "compatibleSdkVersion": 9, - "products": [ - { - "name": "default", - "signingConfig": "default", - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/AdaptiveGrid/entry/.gitignore b/AdaptiveGrid/entry/.gitignore deleted file mode 100644 index 5a6ba80fa3d9498a23ae8ae7d9518f8743fa8a96..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/node_modules -/.preview -/build -/.cxx \ No newline at end of file diff --git a/AdaptiveGrid/entry/build-profile.json5 b/AdaptiveGrid/entry/build-profile.json5 deleted file mode 100644 index f8f03407f77914b43168aeca6bb0929efd6700b4..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/build-profile.json5 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "apiType": 'stageMode', - "buildOption": { - }, - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/AdaptiveGrid/entry/hvigorfile.js b/AdaptiveGrid/entry/hvigorfile.js deleted file mode 100644 index d7720ee6a7aad5c617d1fd2f6fc8c87067bfa32c..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/hvigorfile.js +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks diff --git a/AdaptiveGrid/entry/package.json b/AdaptiveGrid/entry/package.json deleted file mode 100644 index c4e988f30f2ec9e3430a4d0c8f05e89fabbc2659..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "ohos": { - "org": "huawei", - "buildTool": "hvigor", - "directoryLevel": "module" - }, - "description": "example description", - "repository": {}, - "license": "ISC", - "dependencies": {} -} diff --git a/AdaptiveGrid/entry/src/main/ets/Application/MyAbilityStage.ts b/AdaptiveGrid/entry/src/main/ets/Application/MyAbilityStage.ts deleted file mode 100644 index 32dfe93ccff0375201857794de902cec4d239442..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/main/ets/Application/MyAbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/main/ets/MainAbility/MainAbility.ts b/AdaptiveGrid/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 20429c10ffa5288e86c143ada7463e6c1e2479be..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,40 +0,0 @@ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.loadContent("pages/adaptiveGridPage", (err, data) => { - if (err.code) { - console.error('Failed to load the content. Cause:' + JSON.stringify(err)); - return; - } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) - }); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/AdaptiveGrid/entry/src/main/ets/pages/adaptiveGridPage.ets b/AdaptiveGrid/entry/src/main/ets/pages/adaptiveGridPage.ets deleted file mode 100644 index 72f0bae421b52c7b29d91f4a9aabb392648812f3..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/main/ets/pages/adaptiveGridPage.ets +++ /dev/null @@ -1,391 +0,0 @@ -@Entry -@Component -struct AdaptiveGridPages { - @State items: number[] = [1, 2, 3, 4, 5, 6] - @State isCustomSizeTypes: boolean = false - @State isAutoAdjustRow: boolean = false - @State isAutoAdjustRowAdaptive: boolean = false - @State isAutoGap: boolean = false - @State isAbsoluteTemplate: boolean = false - @State isAutoGapAdaptive: boolean = false - @State counter: number = 6 - @State columnsCounter: number = 2 - @State columnsTemplate: string = '1fr 1fr' - ColumnsWidthFr: string = '1fr' - ColumnsWidthAbsolute: string = '150px' - ColumnsTemplateText: string = 'columnsTemplate =' - RowsTemplateText: string = 'rowsTemplate = ' - ColumnsGapText: string = 'columnsGap = ' - RowsGapText: string = 'rowsGap = 10vp' - AutoAdjustRow: string = 'auto-adjust-row' - AutoColumns: string = 'auto-columns' - AutoGap: string = 'auto-gap' - TemplateAuto: string = 'auto auto auto' - defaultSizeTypes: { - xs?: string - sm?: string - md?: string - lg?: string - } = { xs: "1fr", sm: "1fr 1fr", md: "1fr 1fr 1fr", lg: "1fr 1fr 1fr 1fr" } - defaultSizeTypesStr: string = 'ColumnsSizeTypes = ' + '\n' + 'xs: ' + this.defaultSizeTypes.xs + ',\n' + - 'sm: ' + this.defaultSizeTypes.sm + ',\n' + - 'md: ' + this.defaultSizeTypes.md + ',\n' + - 'lg: ' + this.defaultSizeTypes.lg - customSizeTypes: { - xs?: string - sm?: string - md?: string - lg?: string - } = { xs: "1fr", sm: "", md: "1fr 1fr 1fr 1fr 1fr", lg: "1fr 1fr 1fr 1fr 1fr 1fr" } - customSizeTypesStr: string = 'ColumnsSizeTypes = ' + '\n' + 'xs: ' + this.customSizeTypes.xs + ',\n' + - 'sm: ' + this.customSizeTypes.sm + ',\n' + - 'md: ' + this.customSizeTypes.md + ',\n' + - 'lg: ' + this.customSizeTypes.lg - - aboutToAppear() { - this.updateItems(this.counter) - } - - updateItems(num: number) { - if (num >= 0) { - this.items = [...Array(num).keys()] - } - } - - updateColumnsTemplate(count: number) { - this.columnsTemplate = '' - const columnsWidth: string = (this.isAbsoluteTemplate) ? this.ColumnsWidthAbsolute : this.ColumnsWidthFr; - for (let i = 1; i <= count; i++) { - this.columnsTemplate = this.columnsTemplate + columnsWidth - if (i != count) { - this.columnsTemplate = this.columnsTemplate + ' ' - } - } - } - - @Builder commonSettings() { - Column() { - Row() { - Text('ITEMS COUNT: ') - .fontSize(16) - .fontWeight(FontWeight.Bold) - Counter() { - Text(this.counter.toString()).fontSize(16) - } - .onInc(() => { - this.counter++ - this.aboutToAppear() - }) - .onDec(() => { - this.counter-- - this.aboutToAppear() - }) - } - .align(Alignment.Start) - .width('100%') - } - .width('100%') - .alignItems(HorizontalAlign.Center) - .margin({ top: "0vp", right: "0vp", bottom: "20vp, ", left: "0vp" }) - } - - @Builder autoGapGrid() { - Column() { - Text("GRID + columns auto-gap:") - .fontSize(16) - .fontWeight(FontWeight.Bold) - .align(Alignment.Start) - .width('100%') - .margin({ top: "0vp", right: "0vp", bottom: "5vp, ", left: "0vp" }) - - Row() { - Text('Columns COUNT: ') - .fontSize(16) - Counter() { - Text(this.columnsCounter.toString()).fontSize(16) - } - .onInc(() => { - this.columnsCounter++ - this.updateColumnsTemplate(this.columnsCounter) - }) - .onDec(() => { - if (this.columnsCounter > 0) { - this.columnsCounter-- - this.updateColumnsTemplate(this.columnsCounter) - } - }) - } - .align(Alignment.Start) - .width('100%') - - Column() { - Text(this.ColumnsTemplateText) - .fontSize(16) - .width('100%') - Text(this.columnsTemplate) - .fontSize(16) - .align(Alignment.Start) - .width('100%') - Row() { - Checkbox() { - } - .select(this.isAbsoluteTemplate) - .onChange(() => { - this.isAbsoluteTemplate = !this.isAbsoluteTemplate - this.updateColumnsTemplate(this.columnsCounter) - }) - - Text("use absolute columns template") - .fontSize(16) - .align(Alignment.Start) - .width('100%') - } - .width('100%') - - } - .width('100%') - - Row() { - Text(this.RowsTemplateText).fontSize(16) - Text((this.isAutoAdjustRow ? this.AutoAdjustRow : this.TemplateAuto)) - .fontSize(16) - .align(Alignment.Start) - .fontColor(this.isAutoAdjustRow ? Color.Red : Color.Black) - } - .width('100%') - - Row() { - Text(this.ColumnsGapText).fontSize(16) - Text(this.isAutoGap ? this.AutoGap : '10vp') - .fontSize(16) - .align(Alignment.Start) - .fontColor(this.isAutoGap ? Color.Red : Color.Black) - .fontWeight(this.isAutoGap ? FontWeight.Bold : FontWeight.Normal) - } - .width('100%') - - Row() { - Text(this.RowsGapText) - .fontSize(16) - .align(Alignment.Start) - } - .width('100%') - - Grid() { - ForEach(this.items, (item: number) => { - GridItem() { - Flex({ wrap: FlexWrap.Wrap, - justifyContent: FlexAlign.SpaceAround, - alignContent: FlexAlign.SpaceAround }) { - Text('x ' + (item + 1)) - .fontSize(15) - .textAlign(TextAlign.Center) - .fontColor(Color.White) - .padding(2) - .fontWeight(FontWeight.Bold) - } - } - .width("100%") - .backgroundColor(Color.Blue) - }) - } - .width('100%') - .columnsTemplate(this.columnsTemplate) - .rowsTemplate(this.isAutoAdjustRow ? this.AutoAdjustRow : this.TemplateAuto) - .rowsGap('10vp') - .columnsGap(this.isAutoGap ? this.AutoGap : '10vp') - .backgroundColor(Color.Black) - } - .width('100%') - } - - @Builder autoGapGridSettings() { - Column() { - Row() { - Checkbox() { - } - .select(this.isAutoGap) - .onChange(() => { - this.isAutoGap = !this.isAutoGap - this.updateColumnsTemplate(this.columnsCounter) - }) - - Text(this.AutoGap + (this.isAutoGap ? ': true' : ': false')) - .fontSize(16) - .align(Alignment.Start) - .width('100%') - .fontColor(Color.Red) - } - .width('100%') - - Row() { - Checkbox() { - } - .select(this.isAutoAdjustRow) - .onChange(() => { - this.isAutoAdjustRow = !this.isAutoAdjustRow - }) - - Text(this.AutoAdjustRow + (this.isAutoAdjustRow ? ': true' : ': false')) - .fontSize(16) - .align(Alignment.Start) - .width('100%') - .fontColor(Color.Red) - } - .width('100%') - } - .width('100%') - .margin({ top: "0vp", right: "0vp", bottom: "20vp, ", left: "0vp" }) - } - - @Builder adaptiveGrid() { - Column() { - Text("GRID + auto-columns template") - .fontSize(16) - .fontWeight(FontWeight.Bold) - .align(Alignment.Start) - .width('100%') - .margin({ top: "0vp", right: "0vp", bottom: "5vp, ", left: "0vp" }) - - Row() { - Text(this.ColumnsTemplateText) - .fontSize(16) - Text(this.AutoColumns) - .fontSize(16) - .align(Alignment.Start) - .fontColor(Color.Red) - .fontWeight(FontWeight.Bold) - } - .width('100%') - - Row() { - Text(this.RowsTemplateText) - .fontSize(16) - Text(this.isAutoAdjustRowAdaptive ? this.AutoAdjustRow : this.TemplateAuto) - .fontSize(16) - .align(Alignment.Start) - .fontColor(this.isAutoAdjustRowAdaptive ? Color.Red : Color.Black) - } - .width('100%') - - Text(this.isCustomSizeTypes ? this.customSizeTypesStr : this.defaultSizeTypesStr) - .fontSize(16) - .align(Alignment.Start) - .width('100%') - .fontColor(Color.Red) - - Row() { - Text(this.ColumnsGapText).fontSize(16) - Text(this.isAutoGapAdaptive ? this.AutoGap : '10vp') - .fontSize(16) - .align(Alignment.Start) - .fontColor(this.isAutoGapAdaptive ? Color.Red : Color.Black) - } - .width('100%') - - Row() { - Text(this.RowsGapText) - .fontSize(16) - .align(Alignment.Start) - } - .width('100%') - - Grid() { - ForEach(this.items, (item: number) => { - GridItem() { - Flex({ wrap: FlexWrap.Wrap, - justifyContent: FlexAlign.SpaceAround, - alignContent: FlexAlign.SpaceAround }) { - Text('x ' + (item + 1)) - .fontSize(15) - .textAlign(TextAlign.Center) - .fontColor(Color.White) - .padding(2) - .fontWeight(FontWeight.Bold) - } - } - .width("100%") - .backgroundColor(Color.Green) - }) - } - .width('100%') - .columnsTemplate(this.AutoColumns) - .rowsTemplate(this.isAutoAdjustRowAdaptive ? this.AutoAdjustRow : this.TemplateAuto) - .rowsGap('10vp') - .columnsGap(this.isAutoGapAdaptive ? this.AutoGap : '10vp') - .backgroundColor(Color.Black) - // calling new API for ADAPTIVE GRID feature. Comment next line if you have build problem. - .setColumnsSizeTypes(this.isCustomSizeTypes ? this.customSizeTypes : this.defaultSizeTypes) - } - .width('100%') - } - - @Builder adaptiveGridSettings() { - Column() { - Row() { - Checkbox() { - } - .select(this.isCustomSizeTypes) - .onChange(() => { - this.isCustomSizeTypes = !this.isCustomSizeTypes - }) - - Text('ColumnsSizeTypes: ').fontSize(16).fontColor(Color.Red) - Text(this.isCustomSizeTypes ? 'custom' : 'default') - .fontSize(16) - .align(Alignment.Start) - .fontColor(this.isCustomSizeTypes ? Color.Red : Color.Black) - - } - .width('100%') - - Row() { - Checkbox() { - } - .select(this.isAutoGapAdaptive) - .onChange(() => { - this.isAutoGapAdaptive = !this.isAutoGapAdaptive - }) - - Text(this.AutoGap + (this.isAutoGapAdaptive ? ': true' : ': false')) - .fontSize(16).align(Alignment.Start).width('100%').fontColor(Color.Red) - } - .width('100%') - - Row() { - Checkbox() { - } - .select(this.isAutoAdjustRowAdaptive) - .onChange(() => { - this.isAutoAdjustRowAdaptive = !this.isAutoAdjustRowAdaptive - }) - - Text(this.AutoAdjustRow + (this.isAutoAdjustRowAdaptive ? ': true' : ': false')) - .fontSize(16) - .align(Alignment.Start) - .width('100%') - .fontColor(Color.Red) - } - .width('100%') - } - .width('100%') - .alignItems(HorizontalAlign.Start) - .margin({ top: "0vp", right: "0vp", bottom: "20vp, ", left: "0vp" }) - } - - build() { - Scroll() { - Column() { - this.commonSettings() - this.autoGapGrid() - this.autoGapGridSettings() - this.adaptiveGrid() - this.adaptiveGridSettings() - } - .width('100%') - .constraintSize({ minHeight: '100%' }) - .padding('5vp') - } - .width('100%').height('100%') - } -} \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/main/module.json5 b/AdaptiveGrid/entry/src/main/module.json5 deleted file mode 100644 index fea5678b5adf579a4d7af87cd6beac10e9f329a6..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/main/module.json5 +++ /dev/null @@ -1,39 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "srcEntrance": "./ets/Application/MyAbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:icon", - "label": "$string:MainAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:white", - "visible": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/main/resources/base/element/color.json b/AdaptiveGrid/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 1bbc9aa9617e97c45440e1d3d66afc1154837012..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "white", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/main/resources/base/element/string.json b/AdaptiveGrid/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 490210a3908f47722dc942d49dacc98b97669a5f..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/main/resources/base/media/icon.png b/AdaptiveGrid/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/AdaptiveGrid/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/AdaptiveGrid/entry/src/main/resources/base/profile/main_pages.json b/AdaptiveGrid/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index feec276e105eeb8d621c20aaf838f318b0a94150..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index" - ] -} diff --git a/AdaptiveGrid/entry/src/ohosTest/ets/Application/TestAbilityStage.ts b/AdaptiveGrid/entry/src/ohosTest/ets/Application/TestAbilityStage.ts deleted file mode 100644 index 2e8d46539605384ae2d7c63067495ceb3003c0d9..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/ohosTest/ets/Application/TestAbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class TestAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] TestAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/ohosTest/ets/TestAbility/TestAbility.ts b/AdaptiveGrid/entry/src/ohosTest/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 301aaf6099dd794d856d2ab13bf3ef6f13e3ba78..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/ohosTest/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,45 +0,0 @@ -import Ability from '@ohos.application.Ability' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onDestroy() { - console.log('TestAbility onDestroy') - } - - onWindowStageCreate(windowStage) { - console.log('TestAbility onWindowStageCreate') - windowStage.loadContent("TestAbility/pages/index", (err, data) => { - if (err.code) { - console.error('Failed to load the content. Cause:' + JSON.stringify(err)); - return; - } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) - }); - - globalThis.abilityContext = this.context; - } - - onWindowStageDestroy() { - console.log('TestAbility onWindowStageDestroy') - } - - onForeground() { - console.log('TestAbility onForeground') - } - - onBackground() { - console.log('TestAbility onBackground') - } -}; \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/ohosTest/ets/TestAbility/pages/index.ets b/AdaptiveGrid/entry/src/ohosTest/ets/TestAbility/pages/index.ets deleted file mode 100644 index 733600abc03d7e777ef1a55eaddd77f4d1d7d66d..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/ohosTest/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,34 +0,0 @@ -import router from '@ohos.router'; - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info('TestAbility index aboutToAppear') - } - @State message: string = 'Hello World' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(()=>{ - }) - } - .width('100%') - } - .height('100%') - } - } \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/AdaptiveGrid/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index bdbe7cf017a787a625bbf23cc62e825821b16d6b..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,64 +0,0 @@ -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout', - '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log("onAbilityCreateCallback"); -} - -async function addAbilityMonitorCallback(err: any) { - console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info("OpenHarmonyTestRunner OnPrepare ") - } - - async onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/ohosTest/ets/test/Ability.test.ets b/AdaptiveGrid/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index df49ed0fbb519c98ce90324b482aabaa8745cf6a..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,13 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' - -export default function abilityTest() { - describe('ActsAbilityTest', function () { - it('assertContain',0, function () { - console.info("it begin") - let a = 'abc' - let b = 'b' - expect(a).assertContain(b) - expect(a).assertEqual(a) - }) - }) -} \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/ohosTest/ets/test/List.test.ets b/AdaptiveGrid/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index d766fe249dfc3ada636f27e64d9b64451ce32c93..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/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/AdaptiveGrid/entry/src/ohosTest/module.json5 b/AdaptiveGrid/entry/src/ohosTest/module.json5 deleted file mode 100644 index 4567d5e8f8037de313a090573095f2c2e480eb6f..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,39 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "srcEntrance": "./ets/Application/TestAbilityStage.ts", - "description": "$string:entry_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "TestAbility", - "srcEntrance": "./ets/TestAbility/TestAbility.ts", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:white", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/AdaptiveGrid/entry/src/ohosTest/resources/base/element/color.json b/AdaptiveGrid/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 1bbc9aa9617e97c45440e1d3d66afc1154837012..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "white", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/ohosTest/resources/base/element/string.json b/AdaptiveGrid/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 36d4230c53e9f5a07ae343ad8dc9808341975e3b..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - } - ] -} \ No newline at end of file diff --git a/AdaptiveGrid/entry/src/ohosTest/resources/base/media/icon.png b/AdaptiveGrid/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/AdaptiveGrid/entry/src/ohosTest/resources/base/media/icon.png and /dev/null differ diff --git a/AdaptiveGrid/entry/src/ohosTest/resources/base/profile/test_pages.json b/AdaptiveGrid/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index fcef82b4dfc18e28106ff9ecd1c8b48ec74d18a4..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "TestAbility/pages/index" - ] -} diff --git a/AdaptiveGrid/hvigorfile.js b/AdaptiveGrid/hvigorfile.js deleted file mode 100644 index 5f2735e3deeaf655828407544bbed9365c258278..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/hvigorfile.js +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').appTasks \ No newline at end of file diff --git a/AdaptiveGrid/package.json b/AdaptiveGrid/package.json deleted file mode 100644 index 202d8ff68efbc4d58a0a770aa93902cab0bd1f5a..0000000000000000000000000000000000000000 --- a/AdaptiveGrid/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "adaptivegrid", - "version": "1.0.0", - "ohos": { - "org": "huawei", - "buildTool": "hvigor", - "directoryLevel": "project" - }, - "description": "example description", - "repository": {}, - "license": "ISC", - "dependencies": { - "@ohos/hypium": "1.0.1", - "@ohos/hvigor": "1.1.6", - "@ohos/hvigor-ohos-plugin": "1.1.6" - } -}