From be61131215474e11d46b5bf0c6624013cbbb22f1 Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Sun, 6 Apr 2025 10:34:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=85=81=E8=AE=B8=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=BC=B9=E7=AA=97=E7=9A=84=E6=8F=90=E7=A4=BA=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=B8=8E=E8=AE=BE=E8=AE=A1=E4=B8=8D=E7=AC=A6=EF=BC=88?= =?UTF-8?q?=E9=A2=84=E6=9C=9F=EF=BC=9A=E9=80=9A=E7=9F=A5=E6=8F=90=E9=86=92?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E5=8C=85=E6=8B=AC=E6=A8=AA=E5=B9=85=E3=80=82?= =?UTF-8?q?=E5=8F=AF=E5=89=8D=E5=BE=80=E2=80=9C=E8=AE=BE=E7=BD=AE=E2=80=9D?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E3=80=82=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- .../src/main/ets/pages/carNotificationDialog.ets | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/carNotificationDialog.ets b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/carNotificationDialog.ets index a00dadfac..ea3fcc17e 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/carNotificationDialog.ets +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/carNotificationDialog.ets @@ -15,11 +15,12 @@ import bundleResourceManager from '@ohos.bundle.bundleResourceManager'; import window from '@ohos.window'; -import { titleTrim, calOverLine } from '../common/utils'; +import { titleTrim, calOverLine, getFontSizeScale, getLimitFontSize } from '../common/utils'; import Constants from '../common/constant'; import { EnableNotificationDialog } from '../ServiceExtAbility/NotificationServiceExtAbility'; import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; import { MeasureOptions } from '@ohos.measure'; +import common from '@ohos.app.ability.common'; import uiextension from '@ohos.arkui.uiExtension'; const TAG = 'NotificationDialog_Service '; @@ -29,7 +30,7 @@ let storage = LocalStorage.getShared(); @Extend(Button) function customizeButton() { .type(ButtonType.Normal) .fontColor('#E6FFFFFF') - .fontSize(16) + .fontSize(getLimitFontSize(16, getFontSizeScale(getContext(this) as common.UIAbilityContext, 2))) .fontWeight(FontWeight.Medium) .height(40) .width('50%') @@ -95,7 +96,7 @@ struct PermissionDialog { Row() { Flex({ justifyContent: FlexAlign.Center }) { Text($r('app.string.group_label_notification', this.appName)) - .fontSize(20) + .fontSize(getLimitFontSize(20, getFontSizeScale(getContext(this) as common.UIAbilityContext, 2))) .lineHeight(27) .fontColor('#E6FFFFFF') .fontWeight(FontWeight.Bold) @@ -110,7 +111,7 @@ struct PermissionDialog { let containerWidth = newValue.width as number; let options: MeasureOptions = { textContent: $r('app.string.group_label_notification', this.appName), - fontSize: 20, + fontSize: getLimitFontSize(20, getFontSizeScale(getContext(this) as common.UIAbilityContext, 2)), fontWeight: FontWeight.Bold, }; this.titleOverLine = calOverLine(containerWidth, options, this.getUIContext().getMeasureUtils()); @@ -120,7 +121,7 @@ struct PermissionDialog { Row() { Flex({ justifyContent: FlexAlign.Center }) { Text() { - Span($r('app.string.reason')) + Span($r('app.string.reason_tv')) } .lineHeight(19) .fontSize(14) @@ -133,8 +134,9 @@ struct PermissionDialog { .onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => { let containerWidth = newValue.width as number; let options: MeasureOptions = { - textContent: $r('app.string.reason'), - fontSize: 14, + textContent: $r('app.string.reason_tv'), + fontSize: getLimitFontSize(14, + getFontSizeScale(getContext(this) as common.UIAbilityContext)), fontWeight: FontWeight.Medium, }; this.contentOverLine = calOverLine(containerWidth, options, this.getUIContext().getMeasureUtils()); -- Gitee