Commit b8124cc0 authored by lujie's avatar lujie
Browse files

feat(app): init

parents
/node_modules
/oh_modules
/local.properties
/.idea
**/build
/.hvigor
.cxx
/.clangd
/.clang-format
/.clang-tidy
**/.test
/.appanalyzer
\ No newline at end of file
registry=https://repo.huaweicloud.com/repository/npm/
@ohos:registry = "https://repo.harmonyos.com/npm/"
\ No newline at end of file
{
"app": {
"bundleName": "com.wanda.sf3hm.huawei",
"vendor": "DefaultCompany",
"versionCode": 1,
"versionName": "0.1",
"icon": "$media:app_icon",
"label": "$string:app_name",
"distributedNotificationEnabled": true,
"asanEnabled": false
}
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "HonmonyBridge"
}
]
}
\ No newline at end of file
{
"app": {
"signingConfigs": [
{
"name": "default",
"type": "HarmonyOS",
"material": {
"certpath": "C:\\Users\\Lenovo\\.ohos\\config\\default_unity_export_pZb86HCdN_y5RrSRZrEeHk2IfsLO1asidj-7O0ny8nA=.cer",
"keyAlias": "debugKey",
"keyPassword": "0000001BAD781B05ED35092E7E9544ED757892286C80E693F8C14E25FE9CE5496627F2CAB1CD2397FE0BFD",
"profile": "C:\\Users\\Lenovo\\.ohos\\config\\default_unity_export_pZb86HCdN_y5RrSRZrEeHk2IfsLO1asidj-7O0ny8nA=.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "C:\\Users\\Lenovo\\.ohos\\config\\default_unity_export_pZb86HCdN_y5RrSRZrEeHk2IfsLO1asidj-7O0ny8nA=.p12",
"storePassword": "0000001B0638A918D8AA7EF077466F1D2FD46262C68D8146E6036411EDB26949B3287DCD64475D3E830115"
}
}
],
"products": [
{
"name": "default",
"signingConfig": "default",
"compatibleSdkVersion": "5.0.3(15)",
"runtimeOS": "HarmonyOS",
"buildOption": {
"strictMode": {
"useNormalizedOHMUrl": true
}
}
}
]
},
"modules": [
{
"name": "entry",
"srcPath": "./entry",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
},
{
"name": "tuanjieLib",
"srcPath": "./tuanjieLib",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
}
]
}
\ No newline at end of file
/node_modules
/oh_modules
/.preview
/build
/.cxx
/.test
\ No newline at end of file
{
"apiType": "stageMode",
"buildOption": {
"nativeLib": {
"debugSymbol": {
"strip": false
}
}
},
"targets": [
{
"name": "default"
}
]
}
\ No newline at end of file
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export { hapTasks } from '@ohos/hvigor-ohos-plugin';
{
"meta": {
"stableOrder": true,
"enableUnifiedLockfile": false
},
"lockfileVersion": 3,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"tuanjieLib@../tuanjieLib": "tuanjieLib@../tuanjieLib"
},
"packages": {
"tuanjieLib@../tuanjieLib": {
"name": "tuanjieLib",
"version": "1.0.0",
"resolved": "../tuanjieLib",
"registryType": "local"
}
}
}
\ No newline at end of file
{
"license": "ISC",
"devDependencies": {},
"name": "entry",
"description": "example description",
// "repository": {},
"version": "1.0.0",
"dependencies": {
"tuanjieLib": "file:../tuanjieLib"
}
}
\ No newline at end of file
import window from '@ohos.window';
import { AbilityConstant, Want } from '@kit.AbilityKit';
import { SetToGlobalThis } from 'tuanjieLib';
import { TuanjiePlayerAbilityBase } from 'tuanjieLib';
export default class TuanjiePlayerAbility extends TuanjiePlayerAbilityBase {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
this.setConfig();
super.onCreate(want, launchParam);
}
onDestroy(): void {
super.onDestroy();
}
onWindowStageCreate(windowStage: window.WindowStage): void {
super.setPageUri('pages/Index');
super.onWindowStageCreate(windowStage);
}
onWindowStageDestroy(): void {
super.onWindowStageDestroy();
}
onForeground(): void {
super.onForeground();
}
onBackground(): void {
super.onBackground();
}
setConfig(): void {
SetToGlobalThis("staticSplashScreenFit", $r('app.integer.StaticSplashScreenFit'));
SetToGlobalThis("appSplash", $r('app.media.app_splash'));
SetToGlobalThis("showStaticSplash",$r('app.integer.ShowStaticSplashScreen'));
}
}
import { APP_KEY_SAFEAREA_RECT } from 'tuanjieLib';
import { TuanjiePlayerView } from 'tuanjieLib';
import { window } from '@kit.ArkUI';
@Entry
@Component
struct TuanjiePlayer {
@State displayIndex0: number = 0;
@State displayIndex1: number = 0;
@State displayIndex2: number = 2;
@State btnText: string = "TurnOffDisplay2";
private multiView: boolean = false;
@StorageProp(APP_KEY_SAFEAREA_RECT) safeAreaRect: window.Rect = { top:0,left:0,width:0,height:0};
build() {
Column() {
Row() {
if (!this.multiView) {
TuanjiePlayerView({displayIndex: this.displayIndex0});
} else {
Button(this.btnText)
.onClick(() => {
// switch on/off display2
if (this.displayIndex2 == -1) {
this.btnText = "TurnOffDisplay2";
this.displayIndex2 = 2;
} else {
this.btnText = "TurnOnDisplay2";
this.displayIndex2 = -1;
}
// // navigate to page 2
// this.getUIContext().getRouter()
// .pushUrl({
// url: "pages/Index2",
// params: {
// data: "message",
// }
// })
// .then(() => {
// console.info("Page transition succeed");
// })
// .catch((error: BusinessError) => {
// console.error(`pushUrl failed, code is ${error.code}, message is ${error.message}`);
// })
})
TuanjiePlayerView({ displayIndex: this.displayIndex1 }).width('50%');
Column({ space: "3" }) {
TuanjiePlayerView({ displayIndex: this.displayIndex2 }).width('80%');//.height('580px').width('580px');
}.width('40%');
}
}
.margin({ left: `${this.safeAreaRect.left}px`, top: `${this.safeAreaRect.top}px` })
.width(`${this.safeAreaRect.width}px`)
.height(`${this.safeAreaRect.height}px`)
.alignItems(VerticalAlign.Center)
}
.alignItems(HorizontalAlign.Start)
.backgroundColor(Color.Black)
.height('100%')
.width('100%')
}
onBackPress() {
return !AppStorage.get("backButtonLeavesApp") as boolean;
}
}
{
"module": {
"name": "entry",
"type": "entry",
"srcEntry": '',
"description": "$string:module_desc",
"mainElement": "TuanjiePlayerAbility",
"deviceTypes": [
"phone",
"tablet",
"2in1"
],
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "true"
},
{
"name": "partialUpdateStrictCheck",
"value": "warn"
}
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"abilities": [
{
"name": "TuanjiePlayerAbility",
"srcEntry": "./ets/ability/TuanjiePlayerAbility.ets",
"launchType": "singleton",
"description": "$string:EntryAbility_desc",
"icon": "$media:icon",
"label": "$string:EntryAbility_label",
"startWindowIcon": "$media:start_icon",
"startWindowBackground": "$color:start_window_background",
"orientation": "auto_rotation_restricted",
"exported": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"supportWindowMode": [
"fullscreen"
]
}
],
"metadata": [
{
"name": "client_id",
"value": "应用client_id"
},
{
"name": "app_id",
"value": "应用app_id"
}
],
"requestPermissions": [
{
"name": "ohos.permission.INTERNET",
"usedScene": {
"abilities": [
"TuanjiePlayerAbility"
],
"when": "always"
},
"reason": "$string:default_reason"
},
{
"name": "ohos.permission.ACCELEROMETER",
"usedScene": {
"abilities": [
"TuanjiePlayerAbility"
],
"when": "always"
},
"reason": "$string:default_reason"
}
]
}
}
\ No newline at end of file
{
"color": [
{
"name": "start_window_background",
"value": "#FF231F20"
}
]
}
\ No newline at end of file
{
"integer": [
{
"name": "ShowStaticSplashScreen",
"value": 0
},
{
"name": "StaticSplashScreenFit",
"value": 0
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "module_desc",
"value": "module description"
},
{
"name": "default_reason",
"value": "permission request"
},
{
"name": "EntryAbility_desc",
"value": "description"
},
{
"name": "EntryAbility_label",
"value": "HonmonyBridge"
},
{
"name": "permission_microphone_reason_desc",
"value": "request microphone permission"
}
]
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment