From f820691c907f2976057c0f262c01740586a72669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=B0=8F=E7=A7=8B?= <1273378004@qq.com> Date: Thu, 9 Sep 2021 14:38:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?build=EF=BC=9A=E9=A1=B9=E7=9B=AE=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=88=B0=E6=9C=80=E6=96=B0=E7=9A=84ide=EF=BC=882.2.0.?= =?UTF-8?q?220=EF=BC=89=EF=BC=8C=E5=B0=86=E7=BC=96=E8=AF=91=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=BF=AE=E6=94=B9=E4=B8=BA6=EF=BC=8C=E5=B0=86entry?= =?UTF-8?q?=E7=9A=84=E4=BE=9D=E8=B5=96=E5=BA=93=E7=89=88=E6=9C=AC=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=9C=80=E6=96=B0=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 6 +++--- entry/build.gradle | 6 +++--- entry/src/main/config.json | 21 +-------------------- timetableView/build.gradle | 2 +- 4 files changed, 8 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index 0367685..36f102d 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.huawei.ohos.app' ohos { - compileSdkVersion 5 + compileSdkVersion 6 defaultConfig { compatibleSdkVersion 5 } @@ -19,8 +19,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.huawei.ohos:hap:2.4.2.7' - classpath 'com.huawei.ohos:decctest:1.0.0.6' + classpath 'com.huawei.ohos:hap:2.4.5.0' + classpath 'com.huawei.ohos:decctest:1.2.4.1' } } diff --git a/entry/build.gradle b/entry/build.gradle index 8624e00..5751b42 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.huawei.ohos.hap' apply plugin: 'com.huawei.ohos.decctest' ohos { - compileSdkVersion 5 + compileSdkVersion 6 defaultConfig { compatibleSdkVersion 5 } @@ -10,8 +10,8 @@ ohos { 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.8' + implementation 'io.openharmony.tpc.thirdlib:glide:1.1.2' + implementation 'io.openharmony.tpc.thirdlib:XPopup:1.1.1' implementation project(':timetableView') } decc { diff --git a/entry/src/main/config.json b/entry/src/main/config.json index c9f2ca0..96f457d 100644 --- a/entry/src/main/config.json +++ b/entry/src/main/config.json @@ -5,10 +5,6 @@ "version": { "code": 1, "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5 } }, "deviceConfig": {}, @@ -44,9 +40,8 @@ } ], "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.MainAbility", - "label": "课表Demo", + "label": "$string:app_name", "type": "page", "launchType": "standard" }, @@ -61,7 +56,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.SimpleAbility", "type": "page", "launchType": "standard" @@ -77,7 +71,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.BaseFuncAbility", "type": "page", "launchType": "standard" @@ -93,7 +86,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.AttrAbility", "type": "page", "launchType": "standard" @@ -109,7 +101,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.ColorPoolAbility", "type": "page", "launchType": "standard" @@ -125,7 +116,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.ItemStyleAbility", "type": "page", "launchType": "standard" @@ -141,7 +131,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.CustomWidthAbility", "type": "page", "launchType": "standard" @@ -157,7 +146,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.ElasticAbility", "type": "page", "launchType": "standard" @@ -173,7 +161,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.SlideAbility", "type": "page", "launchType": "standard" @@ -189,7 +176,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.DateAbility", "type": "page", "launchType": "standard" @@ -205,7 +191,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.NonViewAbility", "type": "page", "launchType": "standard" @@ -221,7 +206,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.ExtrasAbility", "type": "page", "launchType": "standard" @@ -237,7 +221,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.FlaglayoutAbility", "type": "page", "launchType": "standard" @@ -253,7 +236,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.DateDelayAbility", "type": "page", "launchType": "standard" @@ -269,7 +251,6 @@ ] }, "orientation": "unspecified", - "formEnabled": false, "name": "com.zhuangfei.hos_timetableview.ability.LocalConfigAbility", "type": "page", "launchType": "standard" diff --git a/timetableView/build.gradle b/timetableView/build.gradle index f3beffc..fb183ce 100644 --- a/timetableView/build.gradle +++ b/timetableView/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'com.huawei.ohos.library' ohos { - compileSdkVersion 5 + compileSdkVersion 6 defaultConfig { compatibleSdkVersion 5 } -- Gitee From e72a55af24d7891da59266652af82ed6f2f01164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=B0=8F=E7=A7=8B?= <1273378004@qq.com> Date: Mon, 25 Oct 2021 15:08:52 +0800 Subject: [PATCH 2/3] =?UTF-8?q?build=EF=BC=9A=E9=A1=B9=E7=9B=AE=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E9=80=82=E9=85=8D=E6=9C=80=E6=96=B0=E7=9A=84IDE?= =?UTF-8?q?=EF=BC=883.0.0.601=EF=BC=89=EF=BC=8C=E7=BC=96=E8=AF=91=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=BF=AE=E6=94=B9=E4=B8=BA7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 6 +++--- entry/build.gradle | 2 +- timetableView/build.gradle | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 36f102d..33bfb5a 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.huawei.ohos.app' ohos { - compileSdkVersion 6 + compileSdkVersion 7 defaultConfig { compatibleSdkVersion 5 } @@ -19,8 +19,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.huawei.ohos:hap:2.4.5.0' - classpath 'com.huawei.ohos:decctest:1.2.4.1' + classpath 'com.huawei.ohos:hap:3.0.3.4' + classpath 'com.huawei.ohos:decctest:1.2.6.0' } } diff --git a/entry/build.gradle b/entry/build.gradle index 5751b42..540423c 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.huawei.ohos.hap' apply plugin: 'com.huawei.ohos.decctest' ohos { - compileSdkVersion 6 + compileSdkVersion 7 defaultConfig { compatibleSdkVersion 5 } diff --git a/timetableView/build.gradle b/timetableView/build.gradle index fb183ce..ec21b5f 100644 --- a/timetableView/build.gradle +++ b/timetableView/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'com.huawei.ohos.library' ohos { - compileSdkVersion 6 + compileSdkVersion 7 defaultConfig { compatibleSdkVersion 5 } -- Gitee From ae25acd4a42107a4b788d9b048814919685caa05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=B0=8F=E7=A7=8B?= <1273378004@qq.com> Date: Mon, 25 Oct 2021 15:12:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix=EF=BC=9A=E8=A7=A3=E5=86=B3=E5=BC=B9?= =?UTF-8?q?=E6=80=A7=E5=B8=83=E5=B1=80=E5=9C=A8sdk7=E4=B8=AD=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DTS2021090210163 --- .../view/ElasticScrollView.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/entry/src/main/java/com/zhuangfei/hos_timetableview/view/ElasticScrollView.java b/entry/src/main/java/com/zhuangfei/hos_timetableview/view/ElasticScrollView.java index 06c413e..3b564ac 100644 --- a/entry/src/main/java/com/zhuangfei/hos_timetableview/view/ElasticScrollView.java +++ b/entry/src/main/java/com/zhuangfei/hos_timetableview/view/ElasticScrollView.java @@ -23,11 +23,12 @@ import ohos.agp.components.DirectionalLayout; import ohos.agp.utils.Rect; import ohos.app.Context; import ohos.multimodalinput.event.TouchEvent; +import ohos.system.version.SystemVersion; /** * 弹性滚动布局,下拉时会反弹 */ -public class ElasticScrollView extends DirectionalLayout implements Component.TouchEventListener { +public class ElasticScrollView extends DirectionalLayout { private Component inner; private float downY; private float deltaY; @@ -44,11 +45,25 @@ public class ElasticScrollView extends DirectionalLayout implements Component.To public ElasticScrollView(Context context, AttrSet attrSet, String styleName) { super(context, attrSet, styleName); - setTouchEventListener(this); + // sdk7以上事件和手势不分离,需要使用setForwardTouchListener来监听触摸手势 + if (SystemVersion.getApiVersion() >= 7) { + setForwardTouchListener(new ForwardTouchListener() { + @Override + public boolean onForwardTouch(Component component, TouchEvent touchEvent) { + return onTouch(component, touchEvent); + } + }); + } else { + setTouchEventListener(new TouchEventListener() { + @Override + public boolean onTouchEvent(Component component, TouchEvent touchEvent) { + return onTouch(component, touchEvent); + } + }); + } } - @Override - public boolean onTouchEvent(Component component, TouchEvent event) { + public boolean onTouch(Component component, TouchEvent event) { if (getChildCount() > 0) { inner = getComponentAt(0); } -- Gitee