From 94ab11b6771b9b00a70cc3a5a3cfefa4002602af Mon Sep 17 00:00:00 2001 From: libohaoh <9691080+libohaoh@user.noreply.gitee.com> Date: Mon, 26 Sep 2022 02:16:08 +0000 Subject: [PATCH 1/3] add LICENSE. Signed-off-by: libohaoh <9691080+libohaoh@user.noreply.gitee.com> --- LICENSE | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..0f192839 --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2022, libohaoh + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- Gitee From 0403bc69d4163c501103bd4239aab89665cdb2b9 Mon Sep 17 00:00:00 2001 From: libohao Date: Mon, 26 Sep 2022 15:40:03 +0800 Subject: [PATCH 2/3] =?UTF-8?q?size=E5=85=B3=E9=94=AE=E5=AD=97=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=EF=BC=8CsigningConfig=E4=B8=ADdebug=E6=8D=A2default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CommonEventAndNotification/AlarmClock/README.md | 10 +++++----- .../AlarmClock/build-profile.json5 | 2 +- .../AlarmClock/entry/src/main/ets/pages/index.ets | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CommonEventAndNotification/AlarmClock/README.md b/CommonEventAndNotification/AlarmClock/README.md index 16af8755..48b6f552 100644 --- a/CommonEventAndNotification/AlarmClock/README.md +++ b/CommonEventAndNotification/AlarmClock/README.md @@ -100,9 +100,9 @@ this.screenHeight = data.height // 设置canvas尺寸,竖屏取值为宽高最小值的1/3,横屏取值为宽高最小值的1/4 this.canvasOnScreenRatio = (this.screenWidth < this.screenHeight ? 3 : 4) - this.size = (this.screenWidth < this.screenHeight ? this.screenWidth : this.screenHeight) / this.canvasOnScreenRatio + this.canvasSize = (this.screenWidth < this.screenHeight ? this.screenWidth : this.screenHeight) / this.canvasOnScreenRatio // 重置原点到canvas画布中间 - this.context.translate(this.size, this.size / 2) + this.context.translate(this.canvasSize, this.canvasSize / 2) }); } ``` @@ -111,11 +111,11 @@ ``` Canvas(this.context) - .height(this.size) + .height(this.canvasSize) .aspectRatio(2.0) .onReady(() =>{ // 获取半径 - this.radius = this.size / 2 - 2.5 + this.radius = this.canvasSize / 2 - 2.5 var that = this // 避免时钟闪现,先画一遍 that.draw() @@ -136,7 +136,7 @@ // 开始绘制 private draw(): void{ // 清空绘制 - this.context.clearRect(-this.size, this.size / -2, this.size * 2, this.size) + this.context.clearRect(-this.canvasSize, this.canvasSize / -2, this.canvasSize * 2, this.canvasSize) // 获取当前时间 let date = new Date() if(this.showClock) { diff --git a/CommonEventAndNotification/AlarmClock/build-profile.json5 b/CommonEventAndNotification/AlarmClock/build-profile.json5 index a94f9962..5110f748 100644 --- a/CommonEventAndNotification/AlarmClock/build-profile.json5 +++ b/CommonEventAndNotification/AlarmClock/build-profile.json5 @@ -7,7 +7,7 @@ "products": [ { "name": "default", - "signingConfig": "debug", + "signingConfig": "default", }, ], }, diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/pages/index.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/pages/index.ets index a1ba8e15..3e6926d0 100644 --- a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/pages/index.ets +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/pages/index.ets @@ -1,4 +1,4 @@ -/* + /* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ struct Index { private times: Array = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2] //时间刻度值 private settings: RenderingContextSettings = new RenderingContextSettings(true) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) - @State size: number = 0 // canvas宽高 + @State canvasSize: number = 0 // canvas宽高 @State canvasOnScreenRatio: number = 3 // 时钟画布是屏幕的几分之一,竖屏:宽度的1/3,此值为3。横屏:高度的1/4,此值为4 private radius: number = 0 // 半径 private sixtyParts = Math.PI * 2 / 60 // 60等分 @@ -50,9 +50,9 @@ struct Index { this.screenHeight = data.height // 设置canvas尺寸,竖屏取值为宽高最小值的1/3,横屏取值为宽高最小值的1/4 this.canvasOnScreenRatio = (this.screenWidth < this.screenHeight ? 3 : 4) - this.size = (this.screenWidth < this.screenHeight ? this.screenWidth : this.screenHeight) / this.canvasOnScreenRatio + this.canvasSize = (this.screenWidth < this.screenHeight ? this.screenWidth : this.screenHeight) / this.canvasOnScreenRatio // 重置原点到canvas画布中间 - this.context.translate(this.size, this.size / 2) + this.context.translate(this.canvasSize, this.canvasSize / 2) }); } @@ -65,11 +65,11 @@ struct Index { .margin({left: 20}) }.height(80).width('100%').alignItems(HorizontalAlign.Start) Canvas(this.context) - .height(this.size) + .height(this.canvasSize) .aspectRatio(2.0) .onReady(() =>{ // 获取半径 - this.radius = this.size / 2 - 2.5 + this.radius = this.canvasSize / 2 - 2.5 var that = this // 避免时钟闪现,先画一遍 that.draw() @@ -157,7 +157,7 @@ struct Index { // 开始绘制 private draw(): void{ // 清空绘制 - this.context.clearRect(-this.size, this.size / -2, this.size * 2, this.size) + this.context.clearRect(-this.canvasSize, this.canvasSize / -2, this.canvasSize * 2, this.canvasSize) // 获取当前时间 let date = new Date() if(this.showClock) { -- Gitee From 3068bc39b0971d1795812d0ada144a17da3def9b Mon Sep 17 00:00:00 2001 From: libohaoh <9691080+libohaoh@user.noreply.gitee.com> Date: Mon, 26 Sep 2022 07:49:12 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20LICE?= =?UTF-8?q?NSE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 0f192839..00000000 --- a/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -ISC License - -Copyright (c) 2022, libohaoh - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- Gitee