diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 index 9cba5d3b15956ff8aefc6faefb7d03697f690251..e9507fea8bccdb5246d1640f00c7e68fab699285 100644 --- a/entry/build-profile.json5 +++ b/entry/build-profile.json5 @@ -20,14 +20,12 @@ "path": "./src/main/cpp/CMakeLists.txt", "arguments": "", "cppFlags": "", + "abiFilters": ["arm64-v8a", "x86_64"] } }, "targets": [ { "name": "default" - }, - { - "name": "ohosTest", } ] } \ No newline at end of file diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 8ae60d6faffa3324b74881e674cde096c7f59af3..6e92c822bf71f0b07112a7b61c745d3ca2c46886 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -47,8 +47,8 @@ struct Index { .textAlign(TextAlign.Start) .margin({ top: $r('app.float.wh_value_13'), bottom: $r('app.float.wh_value_15') }) - Text('X ' + this.shaftRotation + ':' + this.angleArray[0].toString() - + '°\nY ' + this.shaftRotation + ':' + this.angleArray[1].toString() + '°') + Text('X ' + this.shaftRotation + ':' + this.angleArray[0].toString() + + '°\nY ' + this.shaftRotation + ':' + this.angleArray[1].toString() + '°') .fontSize($r('app.float.head_font_24')) .lineHeight($r('app.float.wh_value_33')) .fontFamily('HarmonyHeiTi-Bold') @@ -59,7 +59,11 @@ struct Index { .margin({ top: $r('app.float.wh_value_13'), bottom: $r('app.float.wh_value_15') }) Column() { - XComponent({ id: this.xComponentId, type: 'surface', libraryname: 'tetrahedron_napi' }) + XComponent({ + id: this.xComponentId, + type: XComponentType.SURFACE, + libraryname: 'tetrahedron_napi' + }) .onLoad(() => { Logger.info('onLoad'); }) @@ -79,31 +83,40 @@ struct Index { .backgroundColor(Color.White) .borderRadius(24) - Row() { - Button(this.enableRotate ? $r('app.string.btn_stop_rotation') : $r('app.string.btn_auto_rotation'), { type: ButtonType.Capsule, stateEffect: true }) + Row({ space: 12 }) { + Button(this.enableRotate ? $r('app.string.btn_stop_rotation') : $r('app.string.btn_auto_rotation'), + { type: ButtonType.Capsule, stateEffect: true }) .fontSize($r('app.float.head_font_24')) - .margin({ top: $r('app.float.wh_value_13'), bottom: $r('app.float.wh_value_15'), - left: $r('app.float.wh_value_13'), right: $r('app.float.wh_value_13') }) + .margin({ + top: $r('app.float.wh_value_13'), + bottom: $r('app.float.wh_value_15'), + left: $r('app.float.wh_value_13'), + right: $r('app.float.wh_value_13') + }) .onClick(() => { if (this.enableRotate) { tetrahedron_napi.setRotate(RotationType.STOP); this.enableRotate = false; - } - else { + } else { tetrahedron_napi.setRotate(RotationType.AUTO); this.enableRotate = true; } - }) + .layoutWeight(1) Button($r('app.string.btn_damping_rotation'), { type: ButtonType.Capsule, stateEffect: true }) .fontSize($r('app.float.head_font_24')) - .margin({ top: $r('app.float.wh_value_13'), bottom: $r('app.float.wh_value_15'), - left: $r('app.float.wh_value_13'), right: $r('app.float.wh_value_13') }) + .margin({ + top: $r('app.float.wh_value_13'), + bottom: $r('app.float.wh_value_15'), + left: $r('app.float.wh_value_13'), + right: $r('app.float.wh_value_13') + }) .onClick(() => { this.enableRotate = false; tetrahedron_napi.setRotate(RotationType.DAMPING); }) + .layoutWeight(1) } } .gesture( @@ -122,7 +135,8 @@ struct Index { }) ) .padding(12) - .backgroundColor('#f1f3f5') + .backgroundColor($r('sys.color.comp_background_focus')) .height('100%') + .justifyContent(FlexAlign.SpaceBetween) } } diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index 183408f95e06803496ee61dbba5a36b25e2d4c2b..3b41e683933d16e86321df0bb8cee01b64ddbd73 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -12,17 +12,21 @@ "name": "EntryAbility_label", "value": "Tetrahedron" }, + { + "name": "shaftRotation", + "value": "Shaft Rotation" + }, { "name": "btn_auto_rotation", - "value": "Auto Rotation" + "value": "Start" }, { "name": "btn_stop_rotation", - "value": "Stop Rotation" + "value": "Stop" }, { "name": "btn_damping_rotation", - "value": "Damping Rotation" + "value": "Damping" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json index b942bbbcd119c2ce1fafb5a0684237ec99a59c67..48b10e599be74d66059041d6de5c90de793a6e68 100644 --- a/entry/src/main/resources/en_US/element/string.json +++ b/entry/src/main/resources/en_US/element/string.json @@ -18,15 +18,15 @@ }, { "name": "btn_auto_rotation", - "value": "Auto Rotation" + "value": "Start" }, { "name": "btn_stop_rotation", - "value": "Stop Rotation" + "value": "Stop" }, { "name": "btn_damping_rotation", - "value": "Damping Rotation" + "value": "Damping" } ] } \ No newline at end of file