From bfc1b286a014e23fa3fbd980f395850afbf4a6db Mon Sep 17 00:00:00 2001 From: wang zhen Date: Thu, 8 Jul 2021 09:36:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BallClipRotateMultipleIndicator.java | 39 ++++++++++--------- .../common/simple/EasyListProvider.java | 1 - .../common/simple/LoadingIndicatorView.java | 14 +++---- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/entry/src/main/java/com/classic/common/simple/BallClipRotateMultipleIndicator.java b/entry/src/main/java/com/classic/common/simple/BallClipRotateMultipleIndicator.java index 27f9811..e1e129f 100644 --- a/entry/src/main/java/com/classic/common/simple/BallClipRotateMultipleIndicator.java +++ b/entry/src/main/java/com/classic/common/simple/BallClipRotateMultipleIndicator.java @@ -24,6 +24,7 @@ import ohos.agp.render.Paint; import ohos.agp.utils.RectFloat; import ohos.app.Context; +import java.math.BigDecimal; import java.util.ArrayList; /** @@ -32,21 +33,21 @@ import java.util.ArrayList; * @since 2021-05-13 */ public class BallClipRotateMultipleIndicator extends LoadingIndicatorView { - private final int num = 2; - private final int num90 = 90; - private float scaleFloat = 1; - private float degrees; - private final int num12 = 2; - private final int num360 = 360; - private final float f18 = 1.8f; - private final float f08 = 0.8f; - private final float f05 = 0.5f; - private final float f02 = 0.2f; - private final int num1000 = 1000; - private final int num135 = 135; - private final int num45 = 1000; - private final int num720 = 720; - private final int num225 = 225; + private static final int num = 2; + private static final int num90 = 90; + private static float scaleFloat = 1; + private static float degrees; + private static final int num12 = 2; + private static final int num360 = 360; + private static final float f18 = 1.8f; + private static final float f08 = 0.8f; + private static final float f05 = 0.5f; + private static final float f02 = 0.2f; + private static final int num1000 = 1000; + private static final int num135 = 135; + private static final int num45 = 1000; + private static final int num720 = 720; + private static final int num225 = 225; /** * BallClipRotateMultipleIndicator @@ -86,13 +87,13 @@ public class BallClipRotateMultipleIndicator extends LoadingIndicatorView { @Override public void draw(Canvas canvas, Paint paint) { - canvas.rotate(degrees * num360, getWidth() / num, getHeight() / num); + float x1 = (float) getWidth()/num; + float y1 =(float)getHeight()/num; + canvas.rotate(degrees * num360, x1,y1); paint.setStrokeWidth(num); paint.setStyle(Paint.Style.STROKE_STYLE); float circleSpacing = num12; - float x1 = getWidth() / num; - float y1 = getHeight() / num; canvas.save(); canvas.translate(x1, y1); @@ -108,7 +109,7 @@ public class BallClipRotateMultipleIndicator extends LoadingIndicatorView { canvas.restore(); - canvas.rotate(-degrees * num720, getWidth() / num, getHeight() / num); + canvas.rotate(-degrees * num720, (float) getWidth() / num, (float)getHeight() / num); canvas.translate(x1, y1); canvas.scale(scaleFloat, scaleFloat); diff --git a/entry/src/main/java/com/classic/common/simple/EasyListProvider.java b/entry/src/main/java/com/classic/common/simple/EasyListProvider.java index 00b0ff6..0c10328 100644 --- a/entry/src/main/java/com/classic/common/simple/EasyListProvider.java +++ b/entry/src/main/java/com/classic/common/simple/EasyListProvider.java @@ -67,7 +67,6 @@ public class EasyListProvider extends BaseItemProvider { cpt.setTag(holder); } else { cpt = component; - holder = (SettingHolder) cpt.getTag(); } return cpt; diff --git a/entry/src/main/java/com/classic/common/simple/LoadingIndicatorView.java b/entry/src/main/java/com/classic/common/simple/LoadingIndicatorView.java index 500488c..ae030af 100644 --- a/entry/src/main/java/com/classic/common/simple/LoadingIndicatorView.java +++ b/entry/src/main/java/com/classic/common/simple/LoadingIndicatorView.java @@ -36,16 +36,16 @@ import java.util.HashMap; public abstract class LoadingIndicatorView extends Component { private static final String TAG = "AVLoadingIndicatorView"; - private final int mMinWidth = 200; + private static final int mMinWidth = 200; - private final int mMaxWidth = 400; + private static final int mMaxWidth = 400; - private final int mMinHeight = 200; + private static final int mMinHeight = 200; - private final int mMaxHeight = 400; - private final int num231 = 231; - private final int num87 = 87; - private final int num100 = 100; + private static final int mMaxHeight = 400; + private static final int num231 = 231; + private static final int num87 = 87; + private static final int num100 = 100; private Paint mPaint = new Paint(); private Rect drawBounds = new Rect(); -- Gitee From d88e58c71cd181aed04666b72b5609086d89b0f6 Mon Sep 17 00:00:00 2001 From: wang zhen Date: Mon, 12 Jul 2021 10:28:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=80=82=E9=85=8DSDK6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classic/common/simple/BallClipRotateMultipleIndicator.java | 2 +- .../main/java/com/classic/common/simple/EasyListProvider.java | 2 +- .../java/com/classic/common/simple/LoadingIndicatorView.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/entry/src/main/java/com/classic/common/simple/BallClipRotateMultipleIndicator.java b/entry/src/main/java/com/classic/common/simple/BallClipRotateMultipleIndicator.java index e1e129f..6772bd8 100644 --- a/entry/src/main/java/com/classic/common/simple/BallClipRotateMultipleIndicator.java +++ b/entry/src/main/java/com/classic/common/simple/BallClipRotateMultipleIndicator.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 an copy of the License at + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/classic/common/simple/EasyListProvider.java b/entry/src/main/java/com/classic/common/simple/EasyListProvider.java index 0c10328..cb62e1b 100644 --- a/entry/src/main/java/com/classic/common/simple/EasyListProvider.java +++ b/entry/src/main/java/com/classic/common/simple/EasyListProvider.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 an copy of the License at + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/classic/common/simple/LoadingIndicatorView.java b/entry/src/main/java/com/classic/common/simple/LoadingIndicatorView.java index ae030af..b20ba42 100644 --- a/entry/src/main/java/com/classic/common/simple/LoadingIndicatorView.java +++ b/entry/src/main/java/com/classic/common/simple/LoadingIndicatorView.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 an copy of the License at + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * -- Gitee From ecbdc1a25774e99b6c56baa6dada0f586a9c64e8 Mon Sep 17 00:00:00 2001 From: wang zhen Date: Tue, 13 Jul 2021 15:41:50 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=80=82=E9=85=8DSDK6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/classic/common/simple/MyApplication.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/entry/src/main/java/com/classic/common/simple/MyApplication.java b/entry/src/main/java/com/classic/common/simple/MyApplication.java index d3d74b3..88f2687 100644 --- a/entry/src/main/java/com/classic/common/simple/MyApplication.java +++ b/entry/src/main/java/com/classic/common/simple/MyApplication.java @@ -1,3 +1,18 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.classic.common.simple; import ohos.aafwk.ability.AbilityPackage; -- Gitee