-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
774 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/node_modules | ||
/oh_modules | ||
/local.properties | ||
/.idea | ||
**/build | ||
/.hvigor | ||
.cxx | ||
/.clangd | ||
/.clang-format | ||
/.clang-tidy | ||
**/.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"app": { | ||
"bundleName": "com.alibaba.gaiax.demo", | ||
"vendor": "example", | ||
"versionCode": 1000000, | ||
"versionName": "1.0.0", | ||
"icon": "$media:app_icon", | ||
"label": "$string:app_name" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"string": [ | ||
{ | ||
"name": "app_name", | ||
"value": "GaiaXDemo" | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/node_modules | ||
/oh_modules | ||
/.preview | ||
/build | ||
/.cxx | ||
/.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { gaiax } from "./src/main/ets/utils/GaiaX" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"apiType": "stageMode", | ||
"buildOption": { | ||
}, | ||
"targets": [ | ||
{ | ||
"name": "default", | ||
"runtimeOS": "HarmonyOS" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { hspTasks } from '@ohos/hvigor-ohos-plugin'; | ||
|
||
export default { | ||
system: hspTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ | ||
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "gaiax", | ||
"version": "1.0.0", | ||
"description": "Please describe the basic information.", | ||
"main": "Index.ets", | ||
"author": "", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@Entry | ||
@Component | ||
struct Index { | ||
@State message: string = 'Hello World' | ||
|
||
build() { | ||
Row() { | ||
Column() { | ||
Text(this.message) | ||
.fontSize(50) | ||
.fontWeight(FontWeight.Bold) | ||
} | ||
.width('100%') | ||
} | ||
.height('100%') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function gaiax(a:number, b:number) { | ||
return a + b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"module": { | ||
"name": "GaiaX", | ||
"type": "shared", | ||
"description": "$string:shared_desc", | ||
"deviceTypes": [ | ||
"phone", | ||
"tablet" | ||
], | ||
"deliveryWithInstall": true, | ||
"pages": "$profile:main_pages" | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
GaiaXHarmony/GaiaX/src/main/resources/base/element/color.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"color": [ | ||
{ | ||
"name": "white", | ||
"value": "#FFFFFF" | ||
} | ||
] | ||
} |
8 changes: 8 additions & 0 deletions
8
GaiaXHarmony/GaiaX/src/main/resources/base/element/string.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"string": [ | ||
{ | ||
"name": "shared_desc", | ||
"value": "description" | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
GaiaXHarmony/GaiaX/src/main/resources/base/profile/main_pages.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"src": [ | ||
"pages/Index" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/node_modules | ||
/oh_modules | ||
/.preview | ||
/build | ||
/.cxx | ||
/.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"apiType": "stageMode", | ||
"buildOption": { | ||
}, | ||
"targets": [ | ||
{ | ||
"name": "default", | ||
"runtimeOS": "HarmonyOS" | ||
}, | ||
{ | ||
"name": "ohosTest", | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { hapTasks } from '@ohos/hvigor-ohos-plugin'; | ||
|
||
export default { | ||
system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ | ||
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"license": "", | ||
"devDependencies": {}, | ||
"author": "", | ||
"name": "app", | ||
"description": "Please describe the basic information.", | ||
"main": "", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"gaiax": "file:../GaiaX" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import AbilityConstant from '@ohos.app.ability.AbilityConstant'; | ||
import hilog from '@ohos.hilog'; | ||
import UIAbility from '@ohos.app.ability.UIAbility'; | ||
import Want from '@ohos.app.ability.Want'; | ||
import window from '@ohos.window'; | ||
|
||
export default class AppAbility extends UIAbility { | ||
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { | ||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); | ||
} | ||
|
||
onDestroy() { | ||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); | ||
} | ||
|
||
onWindowStageCreate(windowStage: window.WindowStage) { | ||
// Main window is created, set main page for this ability | ||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); | ||
|
||
windowStage.loadContent('pages/Index', (err, data) => { | ||
if (err.code) { | ||
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); | ||
return; | ||
} | ||
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); | ||
}); | ||
} | ||
|
||
onWindowStageDestroy() { | ||
// Main window is destroyed, release UI related resources | ||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); | ||
} | ||
|
||
onForeground() { | ||
// Ability has brought to foreground | ||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); | ||
} | ||
|
||
onBackground() { | ||
// Ability has back to background | ||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { gaiax } from 'gaiax' | ||
|
||
@Entry | ||
@Component | ||
struct Index { | ||
@State message: string = 'Hello GaiaX Demo ' | ||
|
||
build() { | ||
Row() { | ||
Column() { | ||
Text(this.message + gaiax(1, 1)) | ||
.fontSize(28) | ||
.fontWeight(FontWeight.Bold) | ||
} | ||
.width('100%') | ||
} | ||
.height('100%') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"module": { | ||
"name": "app", | ||
"type": "entry", | ||
"description": "$string:module_desc", | ||
"mainElement": "AppAbility", | ||
"deviceTypes": [ | ||
"phone", | ||
"tablet" | ||
], | ||
"deliveryWithInstall": true, | ||
"installationFree": false, | ||
"pages": "$profile:main_pages", | ||
"abilities": [ | ||
{ | ||
"name": "AppAbility", | ||
"srcEntry": "./ets/appability/AppAbility.ts", | ||
"description": "$string:AppAbility_desc", | ||
"icon": "$media:icon", | ||
"label": "$string:AppAbility_label", | ||
"startWindowIcon": "$media:icon", | ||
"startWindowBackground": "$color:start_window_background", | ||
"exported": true, | ||
"skills": [ | ||
{ | ||
"entities": [ | ||
"entity.system.home" | ||
], | ||
"actions": [ | ||
"action.system.home" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"color": [ | ||
{ | ||
"name": "start_window_background", | ||
"value": "#FFFFFF" | ||
} | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
GaiaXHarmony/app/src/main/resources/base/element/string.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"string": [ | ||
{ | ||
"name": "module_desc", | ||
"value": "module description" | ||
}, | ||
{ | ||
"name": "AppAbility_desc", | ||
"value": "description" | ||
}, | ||
{ | ||
"name": "AppAbility_label", | ||
"value": "label" | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
GaiaXHarmony/app/src/main/resources/base/profile/main_pages.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"src": [ | ||
"pages/Index" | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
GaiaXHarmony/app/src/main/resources/en_US/element/string.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"string": [ | ||
{ | ||
"name": "module_desc", | ||
"value": "module description" | ||
}, | ||
{ | ||
"name": "AppAbility_desc", | ||
"value": "description" | ||
}, | ||
{ | ||
"name": "AppAbility_label", | ||
"value": "GaiaXDemo" | ||
} | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
GaiaXHarmony/app/src/main/resources/zh_CN/element/string.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"string": [ | ||
{ | ||
"name": "module_desc", | ||
"value": "模块描述" | ||
}, | ||
{ | ||
"name": "AppAbility_desc", | ||
"value": "description" | ||
}, | ||
{ | ||
"name": "AppAbility_label", | ||
"value": "GaiaXDemo" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import hilog from '@ohos.hilog'; | ||
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' | ||
|
||
export default function abilityTest() { | ||
describe('ActsAbilityTest', function () { | ||
// Defines a test suite. Two parameters are supported: test suite name and test suite function. | ||
beforeAll(function () { | ||
// 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(function () { | ||
// 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(function () { | ||
// 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(function () { | ||
// 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, function () { | ||
// 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) | ||
}) | ||
}) | ||
} |
Oops, something went wrong.