From 8350f7e9fbb7ba74a806cd245cff1efc9adf9e90 Mon Sep 17 00:00:00 2001 From: wangpeng Date: Fri, 21 May 2021 15:09:08 +0800 Subject: [PATCH 1/5] README.OPENSOURCE.md --- README.OPENSOURCE.md | 19 +++++++++++++++++++ entry/src/ohosTest/config.json | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 README.OPENSOURCE.md diff --git a/README.OPENSOURCE.md b/README.OPENSOURCE.md new file mode 100644 index 0000000..f60aa97 --- /dev/null +++ b/README.OPENSOURCE.md @@ -0,0 +1,19 @@ +[ + + { + + "Name": "StateButton", + + "License": "MIT License", + + "License File": "https://github.com/niniloveyou/StateButton/blob/master/LICENSE", + + "Version Number": "1.1.0", + + "Upstream URL": "https://github.com/niniloveyou/StateButton", + + "Description": "比较常用的ViewGroup和View的圆角实现,一发治好设计的圆角病" + + } + +] \ No newline at end of file diff --git a/entry/src/ohosTest/config.json b/entry/src/ohosTest/config.json index e3ff2e5..1f030c4 100644 --- a/entry/src/ohosTest/config.json +++ b/entry/src/ohosTest/config.json @@ -9,7 +9,7 @@ "apiVersion": { "compatible": 5, "target": 5, - "releaseType": "Beta1" + "releaseType": "Release" } }, "deviceConfig": {}, -- Gitee From be373b6305b373de792dd347067f2d5e0bab538b Mon Sep 17 00:00:00 2001 From: wangpeng Date: Fri, 21 May 2021 15:11:49 +0800 Subject: [PATCH 2/5] config.json --- statebutton/src/main/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statebutton/src/main/config.json b/statebutton/src/main/config.json index 23c0a4f..c92ec98 100644 --- a/statebutton/src/main/config.json +++ b/statebutton/src/main/config.json @@ -9,7 +9,7 @@ "apiVersion": { "compatible": 5, "target": 5, - "releaseType": "Beta1" + "releaseType": "Release" } }, "deviceConfig": { -- Gitee From 04ef3f980e899eb9052ab8663424a2fe98f0fa0f Mon Sep 17 00:00:00 2001 From: wangpeng Date: Fri, 21 May 2021 16:17:36 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BA=91=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/deadline/statebutton/StateConfig.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/statebutton/src/main/java/com/deadline/statebutton/StateConfig.java b/statebutton/src/main/java/com/deadline/statebutton/StateConfig.java index 6a447ee..7df563e 100644 --- a/statebutton/src/main/java/com/deadline/statebutton/StateConfig.java +++ b/statebutton/src/main/java/com/deadline/statebutton/StateConfig.java @@ -163,11 +163,6 @@ public class StateConfig { return this; } - private Builder setUnableTextColor(int unableTextColor) { - this.mUnableTextColor = unableTextColor; - return this; - } - private Builder setStrokeDashWidth(float strokeDashWidth) { this.mStrokeDashWidth = strokeDashWidth; return this; -- Gitee From aa34f7ac849347bdde7605b866800996ea5775d1 Mon Sep 17 00:00:00 2001 From: wangpeng Date: Fri, 21 May 2021 16:27:00 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BA=91=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/deadline/statebutton/StateConfig.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/statebutton/src/main/java/com/deadline/statebutton/StateConfig.java b/statebutton/src/main/java/com/deadline/statebutton/StateConfig.java index 7df563e..85771f3 100644 --- a/statebutton/src/main/java/com/deadline/statebutton/StateConfig.java +++ b/statebutton/src/main/java/com/deadline/statebutton/StateConfig.java @@ -198,11 +198,6 @@ public class StateConfig { return this; } - private Builder setUnableStrokeColor(int unableStrokeColor) { - this.mUnableStrokeColor = mUnableStrokeColor; - return this; - } - private Builder setNormalBackgroundColor(int normalBackgroundColor) { this.mNormalBackgroundColor = normalBackgroundColor; return this; -- Gitee From d958872be462a20dbb0e13afda5d683635e7b04c Mon Sep 17 00:00:00 2001 From: wangpeng Date: Fri, 21 May 2021 16:35:42 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BA=91=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/deadline/statebutton/StateButton.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/statebutton/src/main/java/com/deadline/statebutton/StateButton.java b/statebutton/src/main/java/com/deadline/statebutton/StateButton.java index eb26d90..47957b4 100644 --- a/statebutton/src/main/java/com/deadline/statebutton/StateButton.java +++ b/statebutton/src/main/java/com/deadline/statebutton/StateButton.java @@ -112,9 +112,11 @@ public class StateButton extends Button implements Component.TouchEventListener // 获取屏幕高度和宽度 Optional display = DisplayManager.getInstance().getDefaultDisplay(this.getContext()); - DisplayAttributes displayAttributes = display.get().getAttributes(); - displayWidth = displayAttributes.width; - displayHeight = displayAttributes.height; + if (display.isPresent()) { + DisplayAttributes displayAttributes = display.get().getAttributes(); + displayWidth = displayAttributes.width; + displayHeight = displayAttributes.height; + } // 初始化button initButton(attrSet); -- Gitee