diff --git a/README.md b/README.md index 560d7645f49933c8ad2e9957455bdb03c4d71d5b..947e2e9318ad92e3b80166a08df91caba95c63b3 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ allprojects{ mavenCentral() } } -implementation 'io.openharmony.tpc.thirdlib:TimetableView:1.0.3' +implementation 'io.openharmony.tpc.thirdlib:TimetableView:1.0.4' ``` ## xml属性 diff --git a/build.gradle b/build.gradle index ef3f57778829a3a3db8f688a13cdf9f686af29cb..03676856250801186e64eb703c0326e29a2246d5 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.huawei.ohos:hap:2.4.2.5' + classpath 'com.huawei.ohos:hap:2.4.2.7' classpath 'com.huawei.ohos:decctest:1.0.0.6' } } diff --git a/changelog.md b/changelog.md index 1145c52afd8ae83d1c54dd3fa67326a62b442f9c..85cdff6e54820b9235ebc317552adfcefbd64805 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +## 1.0.4 +修复PerWeekView控件几个接口失效的问题 + ## 1.0.3 修改readme图片路径为绝对路径 diff --git a/entry/build.gradle b/entry/build.gradle index c9e54bc2f74950925153a9736bce41584b86ae47..8624e00f130397beb4d66cff2cf172980b77002b 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -11,7 +11,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) implementation 'com.google.code.gson:gson:2.8.0' implementation 'io.openharmony.tpc.thirdlib:glide:1.0.4' - implementation 'io.openharmony.tpc.thirdlib:XPopup:1.0.3' + implementation 'io.openharmony.tpc.thirdlib:XPopup:1.0.8' implementation project(':timetableView') } decc { diff --git a/timetableView/src/main/java/com/zhuangfei/timetable/view/PerWeekView.java b/timetableView/src/main/java/com/zhuangfei/timetable/view/PerWeekView.java index a2392c4877c5d7c8e88273e0c86163d1d6bd0a69..409332ed8718c8b0d93732ae5697b5a2de6a2e88 100644 --- a/timetableView/src/main/java/com/zhuangfei/timetable/view/PerWeekView.java +++ b/timetableView/src/main/java/com/zhuangfei/timetable/view/PerWeekView.java @@ -78,7 +78,7 @@ public class PerWeekView extends Component implements Component.DrawTask { * @return PerWeekView控件自身 */ public PerWeekView setLightColor(int lightARGBColor) { - this.lightColor = lightColor; + this.lightColor = lightARGBColor; invalidate(); return this; } @@ -90,7 +90,7 @@ public class PerWeekView extends Component implements Component.DrawTask { * @return PerWeekView控件自身 */ public PerWeekView setGrayColor(int grayARGBColor) { - this.grayColor = grayColor; + this.grayColor = grayARGBColor; invalidate(); return this; } @@ -151,7 +151,7 @@ public class PerWeekView extends Component implements Component.DrawTask { * @return PerWeekView控件自身 */ public PerWeekView setRadiusInPx(int radiusPx) { - this.radius = radius; + this.radius = radiusPx; return this; } @@ -187,18 +187,13 @@ public class PerWeekView extends Component implements Component.DrawTask { } private void initAttr(AttrSet attrs) { - int defRadius = ScreenUtils.vp2px(getContext(), 2); grayColor = Color.rgb(207, 219, 219); - if (attrs.getAttr(GRAY_COLOR).isPresent()) { - grayColor = attrs.getAttr(GRAY_COLOR).get().getColorValue().getValue(); - } lightColor = 0xff3FCAB8; - if (attrs.getAttr(LIGHT_COLOR).isPresent()) { - grayColor = attrs.getAttr(LIGHT_COLOR).get().getColorValue().getValue(); - } - radius = defRadius; - if (attrs.getAttr(RADIUS).isPresent()) { - radius = attrs.getAttr(RADIUS).get().getDimensionValue(); + radius = ScreenUtils.vp2px(getContext(), 2); + if (attrs != null) { + attrs.getAttr(GRAY_COLOR).ifPresent(attr -> grayColor = attr.getColorValue().getValue()); + attrs.getAttr(LIGHT_COLOR).ifPresent(attr -> lightColor = attr.getColorValue().getValue()); + attrs.getAttr(RADIUS).ifPresent(attr -> radius = attr.getDimensionValue()); } }