From c7e48fcbfc50baca5d175234d1219f9312ede8ce Mon Sep 17 00:00:00 2001 From: wjt983049539 Date: Thu, 8 Jul 2021 10:56:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9checkstyle=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ohos/speechutilsdemo/MyApplication.java | 6 ++++++ .../ioc/phon/ohos/speechutils/utils/LogUtils.java | 1 - .../ioc/phon/ohos/speechutils/view/MicButton.java | 13 +++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java b/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java index 0a980d7..2ebe76a 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java @@ -12,10 +12,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.ohos.speechutilsdemo; import ohos.aafwk.ability.AbilityPackage; +/** + * MyApplication + * + * @since 2021-04-06 + */ public class MyApplication extends AbilityPackage { @Override public void onInitialize() { diff --git a/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/utils/LogUtils.java b/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/utils/LogUtils.java index 7c0d380..7a868b7 100644 --- a/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/utils/LogUtils.java +++ b/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/utils/LogUtils.java @@ -21,7 +21,6 @@ import ohos.hiviewdfx.HiLogLabel; /** * description 日志类 * - * @author * @since 2021-03-20 */ public class LogUtils { diff --git a/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/view/MicButton.java b/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/view/MicButton.java index 87873e2..eb1c5a8 100644 --- a/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/view/MicButton.java +++ b/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/view/MicButton.java @@ -195,11 +195,12 @@ public class MicButton extends Component implements Component.EstimateSizeListen @Override public void onDraw(Component component, Canvas canvas) { - canvas.drawCircle((float) (width / (double)ER), (float) (height /(double)ER), getRadius(), backgroundPaint); + canvas.drawCircle((float) (width / (double) ER), (float) (height / (double) ER), getRadius(), backgroundPaint); PixelMap pixelMap = getPixelMap(ResourceTable.Media_microphone); - rectSrc = new RectFloat((float) ((width - imageSize) / (double)ER), - (float)((height - imageSize) / (double)ER), - (float)(width - ((width - imageSize) / (double)ER)), (float)(height - ((height - imageSize) / (double)ER))); + rectSrc = new RectFloat((float) ((width - imageSize) / (double) ER), + (float) ((height - imageSize) / (double) ER), + (float) (width - ((width - imageSize) / (double) ER)), + (float) (height - ((height - imageSize) / (double) ER))); pixelMapHolder = new PixelMapHolder(pixelMap); canvas.drawPixelMapHolderRect(pixelMapHolder, rectSrc, wavePaint); } @@ -212,8 +213,8 @@ public class MicButton extends Component implements Component.EstimateSizeListen private float getRadius() { double percent = (rmsdbLevel * Math.log(rmsdbLevel)) * NUM_001; percent = Math.min(Math.max(percent, 0f), YIF); - percent = (double)NUM_055 + (double)NUM_045 * percent; - return (float) (percent * ((float) min) / (double)ERF); + percent = (double) NUM_055 + (double) NUM_045 * percent; + return (float) (percent * ((float) min) / (double) ERF); } /** -- Gitee From 919b6d04652de0e0597ed1f8a50fc199463d3ee4 Mon Sep 17 00:00:00 2001 From: wjt983049539 Date: Thu, 8 Jul 2021 10:58:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?checkstyle=20=E5=8D=8E=E4=B8=BA=E7=89=88?= =?UTF-8?q?=E6=9D=83=20a=20=E6=94=B9=E4=B8=BA=20an?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/java/com/ohos/speechutilsdemo/AttrValue.java | 2 +- entry/src/main/java/com/ohos/speechutilsdemo/ListProvider.java | 2 +- entry/src/main/java/com/ohos/speechutilsdemo/MainAbility.java | 2 +- entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java | 2 +- .../java/com/ohos/speechutilsdemo/slice/AsrAbilitySlice.java | 2 +- .../java/com/ohos/speechutilsdemo/slice/MainAbilitySlice.java | 2 +- .../java/com/ohos/speechutilsdemo/slice/TtsAbilitySlice.java | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/AttrValue.java b/entry/src/main/java/com/ohos/speechutilsdemo/AttrValue.java index 268fcd9..d2a20be 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/AttrValue.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/AttrValue.java @@ -2,7 +2,7 @@ * 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. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/ListProvider.java b/entry/src/main/java/com/ohos/speechutilsdemo/ListProvider.java index 2736e3c..ce62c4e 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/ListProvider.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/ListProvider.java @@ -2,7 +2,7 @@ * 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. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/MainAbility.java b/entry/src/main/java/com/ohos/speechutilsdemo/MainAbility.java index 7ded038..e1cfb03 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/MainAbility.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/MainAbility.java @@ -2,7 +2,7 @@ * 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. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java b/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java index 2ebe76a..fcd3de2 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java @@ -2,7 +2,7 @@ * 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. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/slice/AsrAbilitySlice.java b/entry/src/main/java/com/ohos/speechutilsdemo/slice/AsrAbilitySlice.java index 39aaa69..e6343c4 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/slice/AsrAbilitySlice.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/slice/AsrAbilitySlice.java @@ -2,7 +2,7 @@ * 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. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/slice/MainAbilitySlice.java b/entry/src/main/java/com/ohos/speechutilsdemo/slice/MainAbilitySlice.java index ba46ab7..8d80f31 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/slice/MainAbilitySlice.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/slice/MainAbilitySlice.java @@ -2,7 +2,7 @@ * 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. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/slice/TtsAbilitySlice.java b/entry/src/main/java/com/ohos/speechutilsdemo/slice/TtsAbilitySlice.java index da9d5ea..80061db 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/slice/TtsAbilitySlice.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/slice/TtsAbilitySlice.java @@ -2,7 +2,7 @@ * 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. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * -- Gitee