From 55d93cf81d3d6b6aebe8e8192aeb12b9f42b6c96 Mon Sep 17 00:00:00 2001 From: dengxiaoyu Date: Tue, 25 Mar 2025 20:18:45 +0800 Subject: [PATCH 1/3] fix UX issue Signed-off-by: dengxiaoyu --- application/AppScope/app.json | 4 ++-- application/AppScope/app.json5 | 4 ++-- .../resources/base/profile/configuration.json | 5 +++++ .../entry/src/main/ets/pages/ContinueSwitch.ets | 8 ++++++-- .../entry/src/main/resources/base/element/float.json | 12 ++++++++++++ 5 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 application/AppScope/resources/base/profile/configuration.json create mode 100644 application/entry/src/main/resources/base/element/float.json diff --git a/application/AppScope/app.json b/application/AppScope/app.json index 4a2224e5..07971b1d 100644 --- a/application/AppScope/app.json +++ b/application/AppScope/app.json @@ -2,8 +2,8 @@ "app": { "bundleName": "com.ohos.dhardwareui", "vendor": "example", - "versionCode": 10000037, - "versionName": "1.0.37", + "versionCode": 10000038, + "versionName": "1.0.38", "icon": "$media:app_icon", "label": "$string:app_name", "minAPIVersion": 12, diff --git a/application/AppScope/app.json5 b/application/AppScope/app.json5 index 29dc8935..d0d89633 100644 --- a/application/AppScope/app.json5 +++ b/application/AppScope/app.json5 @@ -16,8 +16,8 @@ "app": { "bundleName": "com.ohos.dhardwareui", "vendor": "example", - "versionCode": 10000037, - "versionName": "1.0.37", + "versionCode": 10000038, + "versionName": "1.0.38", "icon": "$media:app_icon", "label": "$string:app_name", "minAPIVersion": 12, diff --git a/application/AppScope/resources/base/profile/configuration.json b/application/AppScope/resources/base/profile/configuration.json new file mode 100644 index 00000000..e4a0a9ff --- /dev/null +++ b/application/AppScope/resources/base/profile/configuration.json @@ -0,0 +1,5 @@ +{ + "configuration": { + "fontSizeScale": "followSystem" + } +} \ No newline at end of file diff --git a/application/entry/src/main/ets/pages/ContinueSwitch.ets b/application/entry/src/main/ets/pages/ContinueSwitch.ets index 007d150c..889441f9 100644 --- a/application/entry/src/main/ets/pages/ContinueSwitch.ets +++ b/application/entry/src/main/ets/pages/ContinueSwitch.ets @@ -324,7 +324,9 @@ struct ContinueSwitch { } .margin({ bottom: CommonConstants.CONTINUE_DESC_TEXT_MARGIN_BOTTOM, - top: CommonConstants.CONTINUE_DESC_TEXT_MARGIN_TOP + top: CommonConstants.CONTINUE_DESC_TEXT_MARGIN_TOP, + left: $('app.float.margin_8'), + right: $('app.float.margin_8') }) .textAlign(TextAlign.Center) .width('100%') @@ -440,7 +442,7 @@ struct ContinueSwitch { .width('100%') .height(this.screenHeight) .scrollable(ScrollDirection.Vertical) - .scrollBar(BarState.Off) + .scrollBar(BarState.On) .align(Alignment.TopStart) .friction(0.6) .edgeEffect(EdgeEffect.Spring) @@ -490,6 +492,8 @@ struct ContinueSwitch { } logger.info(`${TAG} this.imageAnimatorWidth = ${this.imageAnimatorWidth}, this.imageAnimatorHeight = ${this.imageAnimatorHeight}`); }) + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) + .padding({ bottom: $('app.float.margin_16') }) } private getContentVisibility(): Visibility { diff --git a/application/entry/src/main/resources/base/element/float.json b/application/entry/src/main/resources/base/element/float.json new file mode 100644 index 00000000..64bf2941 --- /dev/null +++ b/application/entry/src/main/resources/base/element/float.json @@ -0,0 +1,12 @@ +{ + "float": [ + { + "name": "margin_8", + "value": "8vp" + }, + { + "name": "margin_16", + "value": "16vp" + } + ] +} \ No newline at end of file -- Gitee From f85e93301871ad598153cc2c81331cd257dcdac6 Mon Sep 17 00:00:00 2001 From: dengxiaoyu Date: Tue, 25 Mar 2025 20:41:12 +0800 Subject: [PATCH 2/3] add Signed-off-by: dengxiaoyu --- application/entry/src/main/ets/pages/ContinueSwitch.ets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/entry/src/main/ets/pages/ContinueSwitch.ets b/application/entry/src/main/ets/pages/ContinueSwitch.ets index 889441f9..96019943 100644 --- a/application/entry/src/main/ets/pages/ContinueSwitch.ets +++ b/application/entry/src/main/ets/pages/ContinueSwitch.ets @@ -325,8 +325,8 @@ struct ContinueSwitch { .margin({ bottom: CommonConstants.CONTINUE_DESC_TEXT_MARGIN_BOTTOM, top: CommonConstants.CONTINUE_DESC_TEXT_MARGIN_TOP, - left: $('app.float.margin_8'), - right: $('app.float.margin_8') + left: $r('app.float.margin_8'), + right: $r('app.float.margin_8') }) .textAlign(TextAlign.Center) .width('100%') @@ -493,7 +493,7 @@ struct ContinueSwitch { logger.info(`${TAG} this.imageAnimatorWidth = ${this.imageAnimatorWidth}, this.imageAnimatorHeight = ${this.imageAnimatorHeight}`); }) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) - .padding({ bottom: $('app.float.margin_16') }) + .padding({ bottom: $r('app.float.margin_16') }) } private getContentVisibility(): Visibility { -- Gitee From 7829f6ec594df7d23b0fb9bdb3db71ac31c687bf Mon Sep 17 00:00:00 2001 From: dengxiaoyu Date: Fri, 28 Mar 2025 16:43:00 +0800 Subject: [PATCH 3/3] add scrollbar Signed-off-by: dengxiaoyu --- application/entry/src/main/ets/pages/ContinueSwitch.ets | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/entry/src/main/ets/pages/ContinueSwitch.ets b/application/entry/src/main/ets/pages/ContinueSwitch.ets index 96019943..07688eb0 100644 --- a/application/entry/src/main/ets/pages/ContinueSwitch.ets +++ b/application/entry/src/main/ets/pages/ContinueSwitch.ets @@ -442,7 +442,7 @@ struct ContinueSwitch { .width('100%') .height(this.screenHeight) .scrollable(ScrollDirection.Vertical) - .scrollBar(BarState.On) + .scrollBar(BarState.Off) .align(Alignment.TopStart) .friction(0.6) .edgeEffect(EdgeEffect.Spring) @@ -455,6 +455,9 @@ struct ContinueSwitch { .onAreaChange((oldArea: Area, newArea: Area) => { logger.info(`${TAG} Scroll, oldArea.height = ${oldArea.height}, newArea.height = ${newArea.height}`); }) + + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.Auto }) + .position({ right: 0, bottom: 16 }) } build() { -- Gitee