diff --git a/buttonprogressbar/src/main/java/github/ishaan/buttonprogressbar/utils/AttrValue.java b/buttonprogressbar/src/main/java/github/ishaan/buttonprogressbar/utils/AttrValue.java index f6c32f860f6bb9c3842122d89218b9b064d1ffdd..11cc59baa79a5cbdb740e1aaab3fb26dcc2f7ee6 100644 --- a/buttonprogressbar/src/main/java/github/ishaan/buttonprogressbar/utils/AttrValue.java +++ b/buttonprogressbar/src/main/java/github/ishaan/buttonprogressbar/utils/AttrValue.java @@ -33,10 +33,10 @@ public class AttrValue { /** * 获取动态属性 * - * @param attrSet - * @param key - * @param defValue - * @param + * @param attrSet attrSet + * @param key key + * @param defValue defValue + * @param defValue * @return 返回泛型T */ @SuppressWarnings("unchecked cast") @@ -68,9 +68,9 @@ public class AttrValue { /** * 获取尺寸 * - * @param attrSet - * @param key - * @param defDimensionValue + * @param attrSet attrSet + * @param key key + * @param defDimensionValue defDimensionValue * @return 返回尺寸 */ public static int getDimension(AttrSet attrSet, String key, int defDimensionValue) { diff --git a/buttonprogressbar/src/main/java/github/ishaan/buttonprogressbar/utils/Logcat.java b/buttonprogressbar/src/main/java/github/ishaan/buttonprogressbar/utils/Logcat.java index 6870a2396b428bb7e5a4a5f66404cf2c2808e90d..3dcb1dcebf092fd701dfcdbdc6c5c7b333e73acf 100644 --- a/buttonprogressbar/src/main/java/github/ishaan/buttonprogressbar/utils/Logcat.java +++ b/buttonprogressbar/src/main/java/github/ishaan/buttonprogressbar/utils/Logcat.java @@ -38,8 +38,8 @@ public class Logcat { /** * 调试 * - * @param mess - * @param args + * @param mess mess + * @param args args */ public static void d(String mess, Object... args) { if (LOGD) { @@ -50,9 +50,9 @@ public class Logcat { /** * 调试 * - * @param tag - * @param mess - * @param args + * @param tag tag + * @param mess mess + * @param args args */ public static void d(String tag, String mess, Object... args) { if (LOGD) { @@ -63,8 +63,8 @@ public class Logcat { /** * 信息 * - * @param mess - * @param args + * @param mess mess + * @param args args */ public static void i(String mess, Object... args) { if (LOGI) { @@ -75,9 +75,9 @@ public class Logcat { /** * 信息 * - * @param tag - * @param mess - * @param args + * @param tag tag + * @param mess mess + * @param args args */ public static void i(String tag, String mess, Object... args) { if (LOGI) { @@ -88,8 +88,8 @@ public class Logcat { /** * 警告 * - * @param mess - * @param args + * @param mess mess + * @param args args */ public static void w(String mess, Object... args) { if (LOGW) { @@ -100,9 +100,9 @@ public class Logcat { /** * 警告 * - * @param tag - * @param mess - * @param args + * @param tag tag + * @param mess mess + * @param args args */ public static void w(String tag, String mess, Object... args) { if (LOGW) { @@ -113,8 +113,8 @@ public class Logcat { /** * 错误 * - * @param mess - * @param args + * @param mess mess + * @param args args */ public static void e(String mess, Object... args) { if (LOGE) { @@ -125,9 +125,9 @@ public class Logcat { /** * 错误 * - * @param tag - * @param mess - * @param args + * @param tag tag + * @param mess mess + * @param args args */ public static void e(String tag, String mess, Object... args) { if (LOGE) { @@ -138,8 +138,8 @@ public class Logcat { /** * 致命log * - * @param mess - * @param args + * @param mess mess + * @param args args */ public static void f(String mess, Object... args) { if (LOGF) { @@ -150,9 +150,9 @@ public class Logcat { /** * 致命log * - * @param tag - * @param mess - * @param args + * @param tag tag + * @param mess mess + * @param args args */ public static void f(String tag, String mess, Object... args) { if (LOGF) { @@ -163,7 +163,7 @@ public class Logcat { /** * 获取相关数据:类名,方法名,行号等.用来定位行 * - * @return + * @return functionName */ private static String getFunctionName() { StackTraceElement[] sts = Thread.currentThread().getStackTrace(); @@ -188,8 +188,8 @@ public class Logcat { /** * 输出格式定义 * - * @param msg - * @return + * @param msg msg + * @return msgFormat */ private static String getMsgFormat(String msg) { return msg + " ;" + getFunctionName(); diff --git a/buttonprogressbar/src/test/java/github/ishaan/buttonprogressbar/ExampleTest.java b/buttonprogressbar/src/test/java/github/ishaan/buttonprogressbar/ExampleTest.java index 2ceb4d0e414bb44c4d2c8f33d7e558dcfec6eda3..c78fa38663365808d550b360016fa31146a073d8 100644 --- a/buttonprogressbar/src/test/java/github/ishaan/buttonprogressbar/ExampleTest.java +++ b/buttonprogressbar/src/test/java/github/ishaan/buttonprogressbar/ExampleTest.java @@ -3,6 +3,9 @@ package github.ishaan.buttonprogressbar; import org.junit.Test; public class ExampleTest { + /** + * 纯UI组件,无法执行单元测试 + */ @Test public void onStart() { } diff --git a/entry/src/main/java/github/ishaan/buttonprogressbar/MainAbility.java b/entry/src/main/java/github/ishaan/buttonprogressbar/MainAbility.java index a4add49267ad1d98c83b86906992cc2cd2fc9a38..a47f93e8c87b403d1541cee12f70ef80721cf82c 100644 --- a/entry/src/main/java/github/ishaan/buttonprogressbar/MainAbility.java +++ b/entry/src/main/java/github/ishaan/buttonprogressbar/MainAbility.java @@ -1,3 +1,17 @@ +/* + * 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 github.ishaan.buttonprogressbar; import github.ishaan.buttonprogressbar.slice.MainAbilitySlice; diff --git a/entry/src/main/java/github/ishaan/buttonprogressbar/MyApplication.java b/entry/src/main/java/github/ishaan/buttonprogressbar/MyApplication.java index b7e85bfec1695fa74c93b924db119e757bb04da3..895f788581112952e3a75794a561a379eea232cd 100644 --- a/entry/src/main/java/github/ishaan/buttonprogressbar/MyApplication.java +++ b/entry/src/main/java/github/ishaan/buttonprogressbar/MyApplication.java @@ -1,3 +1,17 @@ +/* + * 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 github.ishaan.buttonprogressbar; import ohos.aafwk.ability.AbilityPackage; diff --git a/entry/src/main/java/github/ishaan/buttonprogressbar/slice/MainAbilitySlice.java b/entry/src/main/java/github/ishaan/buttonprogressbar/slice/MainAbilitySlice.java index 5982778e4527160d808124b07d729519f5d41d9e..bf2851a32640bc8987df0083b863e8e320d894e5 100644 --- a/entry/src/main/java/github/ishaan/buttonprogressbar/slice/MainAbilitySlice.java +++ b/entry/src/main/java/github/ishaan/buttonprogressbar/slice/MainAbilitySlice.java @@ -1,3 +1,17 @@ +/* + * 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 github.ishaan.buttonprogressbar.slice; import com.jaredrummler.materialspinner.MaterialSpinner; @@ -156,6 +170,11 @@ public class MainAbilitySlice extends AbilitySlice implements Component.ClickedL } } + /** + * 更新ui + * + * @param type type + */ public void updateUI(int type) { switch (type) { case EVENT_MESSAGE_DELAY_1: diff --git a/entry/src/ohosTest/java/github/ishaan/buttonprogressbar/ExampleOhosTest.java b/entry/src/ohosTest/java/github/ishaan/buttonprogressbar/ExampleOhosTest.java index b96ce576836c555108a4f18b24d407c8713cf89a..9ca78e406143af8663b83c1086f96d8af67b23ce 100644 --- a/entry/src/ohosTest/java/github/ishaan/buttonprogressbar/ExampleOhosTest.java +++ b/entry/src/ohosTest/java/github/ishaan/buttonprogressbar/ExampleOhosTest.java @@ -6,6 +6,9 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; public class ExampleOhosTest { + /** + * 纯UI组件,无法执行单元测试 + */ @Test public void testBundleName() { final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); diff --git a/entry/src/test/java/github/ishaan/buttonprogressbar/ExampleTest.java b/entry/src/test/java/github/ishaan/buttonprogressbar/ExampleTest.java index 2ceb4d0e414bb44c4d2c8f33d7e558dcfec6eda3..c78fa38663365808d550b360016fa31146a073d8 100644 --- a/entry/src/test/java/github/ishaan/buttonprogressbar/ExampleTest.java +++ b/entry/src/test/java/github/ishaan/buttonprogressbar/ExampleTest.java @@ -3,6 +3,9 @@ package github.ishaan.buttonprogressbar; import org.junit.Test; public class ExampleTest { + /** + * 纯UI组件,无法执行单元测试 + */ @Test public void onStart() { } diff --git a/img/ButtonProgressBar2.gif b/img/ButtonProgressBar2.gif index 16dc6930761e1da77dd8ee8a736290dcbfea1fc1..8cababcb8047a6f1825f88bcc2e37b1a32051179 100644 Binary files a/img/ButtonProgressBar2.gif and b/img/ButtonProgressBar2.gif differ