From f6776659d58c335cb7a0677d299b2b375965d8b7 Mon Sep 17 00:00:00 2001 From: li-li-wang Date: Thu, 29 Aug 2024 19:31:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E8=80=81=E5=8C=96=E6=97=A0=E9=9A=9C?= =?UTF-8?q?=E7=A2=8D=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-li-wang --- AppScope/app.json | 4 +- AppScope/app.json5 | 4 +- .../common/components/dlp_alert_dialog.ets | 17 ++- entry/src/main/ets/common/constant.ets | 16 +-- .../common/encryptionComponents/AddStaff.ets | 5 + .../encryptionComponents/encrypting.ets | 1 - .../permission_type_select.ets | 12 +- .../ets/common/encryptionComponents/staff.ets | 4 +- entry/src/main/ets/pages/changeEncryption.ets | 106 +++++++++------- .../main/ets/pages/encryptionProtection.ets | 71 +++++++---- .../src/main/ets/pages/encryptionSuccess.ets | 113 +++++++++--------- entry/src/main/ets/pages/permissionStatus.ets | 12 +- 12 files changed, 203 insertions(+), 162 deletions(-) diff --git a/AppScope/app.json b/AppScope/app.json index 14e3a99..7dadaad 100644 --- a/AppScope/app.json +++ b/AppScope/app.json @@ -2,8 +2,8 @@ "app": { "bundleName": "com.ohos.dlpmanager", "vendor": "example", - "versionCode": 1000106, - "versionName": "1.0.1.06", + "versionCode": 1000107, + "versionName": "1.0.1.07", "icon": "$media:app_icon", "label": "$string:app_name", "minAPIVersion": 12, diff --git a/AppScope/app.json5 b/AppScope/app.json5 index 816848f..3d587ea 100644 --- a/AppScope/app.json5 +++ b/AppScope/app.json5 @@ -16,8 +16,8 @@ "app": { "bundleName": "com.ohos.dlpmanager", "vendor": "example", - "versionCode": 1000106, - "versionName": "1.0.1.06", + "versionCode": 1000107, + "versionName": "1.0.1.07", "icon": "$media:app_icon", "label": "$string:app_name", "minAPIVersion": 12, diff --git a/entry/src/main/ets/common/components/dlp_alert_dialog.ets b/entry/src/main/ets/common/components/dlp_alert_dialog.ets index 328a874..02ef8ff 100644 --- a/entry/src/main/ets/common/components/dlp_alert_dialog.ets +++ b/entry/src/main/ets/common/components/dlp_alert_dialog.ets @@ -15,6 +15,7 @@ import Constants from '../constant'; import common from '@ohos.app.ability.common'; +import { SystemUtils } from '../systemUtils'; const TAG = '[DLPManager_dialog]'; @@ -67,7 +68,7 @@ struct DlpAlertDialog { .width(this.ok ? Constants.HEADER_TEXT_WIDTH : Constants.ENCRYPTION_MESSAGE_DIALOG_BUTTON) .focusable(false) .fontColor($r('sys.color.ohos_id_color_text_primary_activated')) - .height(Constants.FOOTER_HEIGHT) + .controlSize(ControlSize.NORMAL) .onClick(async (event) => { this.controller?.close() if (this.action != null) { @@ -77,18 +78,26 @@ struct DlpAlertDialog { } }) .margin({ - right: this.ok ? Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN : Constants.ENCRYPTION_ADD_STAFF_NO_MARGIN + right: !this.ok && SystemUtils.isRTL() ? + Constants.ADD_STAFF_ITEM_MARGIN_LEFT : Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN, + left: this.ok && SystemUtils.isRTL() ? + Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN : Constants.ADD_STAFF_ITEM_MARGIN_LEFT, }); if (this.ok) { Button(this.ok, { type: ButtonType.Capsule, stateEffect: true }) .width(Constants.HEADER_TEXT_WIDTH) .focusable(false) .backgroundColor($r('sys.color.ohos_id_color_text_primary_activated')) - .height(Constants.FOOTER_BUTTON_HEIGHT) + .controlSize(ControlSize.NORMAL) .onClick(async (event) => { (getContext(this) as common.UIAbilityContext).terminateSelf(); }) - .margin({ left: Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN }) + .margin({ + right: SystemUtils.isRTL() ? + Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN : Constants.ADD_STAFF_ITEM_MARGIN_LEFT, + left: SystemUtils.isRTL() ? + Constants.ADD_STAFF_ITEM_MARGIN_LEFT : Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN, + }); } } .margin({ diff --git a/entry/src/main/ets/common/constant.ets b/entry/src/main/ets/common/constant.ets index 2194f80..b0ce2ee 100644 --- a/entry/src/main/ets/common/constant.ets +++ b/entry/src/main/ets/common/constant.ets @@ -14,17 +14,13 @@ */ export default class Constants { - public static FOOTER_HEIGHT = 40; - public static FOOTER_BUTTON_HEIGHT = 40; public static FOOTER_ROW_WIDTH = '100%'; public static FOOTER_ROW_MARGIN = 8; public static FOOTER_ROW_PAD_LEFT = 16; public static FOOTER_ROW_PAD_RIGHT = 16; - public static HEADER_TEXT_LINE_HEIGHT = 28; public static HEADER_TEXT_WIDTH = '100%'; public static HEADER_COLUMN_WIDTH = '100%'; public static HEADER_COLUMN_HEIGHT = 56; - public static HEADER_COLUMN_HEIGHT_READONLY = 40; public static HEADER_COLUMN_PADDING_LEFT = 24; public static HEADER_COLUMN_PADDING_RIGHT = 24; public static HEADER_COLUMN_PADDING_BOTTOM = 24; @@ -34,15 +30,12 @@ export default class Constants { public static ENCRYPTION_SUCCESS_ICON = 40; public static HEADER_COLUMN_MESSAGE_TIPS = 400; public static ENCRYPTION_SUCCESS_TRANSLATE = 180; - public static ENCRYPTION_SUCCESS_TRANSLATE_WIDTH = 180; public static ENCRYPTION_SUCCESS_CHANGE_TOP = 32; - public static ENCRYPTION_ADD_STAFF_WIDTH = 110; public static ENCRYPTION_LOADING_HEIGHT = 340; public static ENCRYPTION_LOADING_ICON_HEIGHT = 72; public static ENCRYPTION_LOADING_CONTENT_HEIGHT = '65%'; public static HEADER_ROW_FONT_SIZE = 16; public static ENCRYPTION_STAFF_BORDER_RADIUS = 999; - public static ENCRYPTION_STAFF_MAX_WIDTH = 82; public static ENCRYPTION_STAFF_WIDTH_NAME = 82; public static ENCRYPTION_STAFF_PAD = 8; public static ENCRYPTION_PERMISSION_STATUS_WIDTH = '70%'; @@ -50,12 +43,11 @@ export default class Constants { public static PP_IMAGE_WIDTH = 24; public static PP_IMAGE_HEIGHT = 24; public static PP_IMAGE_PAD = 2; - public static PP_TEXT_FONT_SIZE2 = 12; public static PP_TEXT_LINE_HEIGHT2 = 17; public static PP_BUTTON_PAD = 0; public static PP_ROW_RADIUS = 0; public static AP_TEXT_PAD_RIGHT = 4; - public static AP_MARGIN_TOP = 19; + public static AP_TEXT_PAD_LEFT = 0; public static DU_WIDTH_FULL = '100%'; public static DU_LINE_WIDTH = 0.5; public static DU_LINE_MARGIN_TOP2 = 8; @@ -69,13 +61,13 @@ export default class Constants { public static FILE_OPEN_HISTORY_TWO = 2; public static FILE_OPEN_HISTORY_THREE = 3; public static ADD_STAFF_ITEM_MARGIN_RIGHT = 4; + public static ADD_STAFF_ITEM_MARGIN_LEFT = 0; public static CHANGE_MAX_HEIGHT = '70%'; public static ENCRYPTION_SUCCESS_MAX_HEIGHT = '70%'; public static ENCRYPTION_SUCCESS_ROTATE_MARGIN_BOTTOM = 16; public static ENCRYPTION_SUCCESS_IMAGE_MARGIN_TOP = 16; public static ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_TOP = 12; public static ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_BOTTOM = 16; - public static ENCRYPTION_READ_ONLY_EDIT_HEIGHT = 19; public static ENCRYPTION_CHANGE_TIPS_MARGIN_BOTTOM = 16; public static ENCRYPTION_CHANGE_VALID_UNTIL_MARGIN_BOTTOM = 8; public static ENCRYPTION_BUTTON_PADDING_TOP = 16; @@ -93,7 +85,6 @@ export default class Constants { public static ENCRYPTION_PROTECTION_TIME_MENU_PADDING_RIGHT = 12; public static ENCRYPTION_PROTECTION_TIME_MENU_MARGIN_LEFT = 2; public static ENCRYPTION_PROTECTION_TIME_MENU_MARGIN_RIGHT = 2; - public static ENCRYPTION_PROTECTION_TIME_MENU_WIDTH = 32; public static ENCRYPTION_ADD_STAFF_FLEX_GROW = 1; public static ENCRYPTION_ADD_STAFF_MARGIN_RIGHT = 8; public static ENCRYPTION_ADD_STAFF_MARGIN_BOTTOM = 8; @@ -188,7 +179,7 @@ export default class Constants { public static DLP_ZIP_MAGIC = 0x04034b50; - public static VALIDITY_IMAGE_WIDTH = 10; + public static VALIDITY_IMAGE_WIDTH = 15; public static VALIDITY_IMAGE_HEIGHT = 40; public static VALIDITY_IMAGE_PADDING_RIGHT = 12; public static VALIDITY_IMAGE_PADDING_LEFT = 8; @@ -208,6 +199,7 @@ export default class Constants { public static RICH_EDITOR_FIRST = 1; public static POPUP_OFFSET_X = -20; public static SUB_HEADER_HEIGHT = 40; + public static SUB_HEADER_WIDTH = '65%'; public static STAFF_FONT_SIZE = 10; public static STAFF_FONT_PADDING = 1; diff --git a/entry/src/main/ets/common/encryptionComponents/AddStaff.ets b/entry/src/main/ets/common/encryptionComponents/AddStaff.ets index 8105c9f..bf8a936 100644 --- a/entry/src/main/ets/common/encryptionComponents/AddStaff.ets +++ b/entry/src/main/ets/common/encryptionComponents/AddStaff.ets @@ -199,6 +199,11 @@ struct AddStaff { wrap: FlexWrap.Wrap, }) { RichEditor(this.options) + .onReady(() => { + this.controller.setTypingStyle({ + fontSize: $r('sys.float.ohos_id_text_size_body1') + }) + }) .placeholder(!this.staffArray.length ? ($r('app.string.enter_a_complete_work_ID')) : '', { font: { size: $r('sys.float.ohos_id_text_size_body1') }, diff --git a/entry/src/main/ets/common/encryptionComponents/encrypting.ets b/entry/src/main/ets/common/encryptionComponents/encrypting.ets index c3465c2..ca48d16 100644 --- a/entry/src/main/ets/common/encryptionComponents/encrypting.ets +++ b/entry/src/main/ets/common/encryptionComponents/encrypting.ets @@ -40,7 +40,6 @@ struct EncryptingPanel { .fontFamily($r('app.string.typeface')) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_dialog_tittle')) - .lineHeight(Constants.HEADER_TEXT_LINE_HEIGHT) .width(Constants.HEADER_TEXT_WIDTH) .align(Alignment.Start) } diff --git a/entry/src/main/ets/common/encryptionComponents/permission_type_select.ets b/entry/src/main/ets/common/encryptionComponents/permission_type_select.ets index 528e42d..b1636cc 100644 --- a/entry/src/main/ets/common/encryptionComponents/permission_type_select.ets +++ b/entry/src/main/ets/common/encryptionComponents/permission_type_select.ets @@ -99,9 +99,9 @@ struct permissionTypeSelect { .fontWeight(FontWeight.Medium) .fontColor($r('sys.color.ohos_id_color_text_secondary')); - Image($r('app.media.rectangle')) - .width(Constants.VALIDITY_IMAGE_WIDTH) - .fillColor($r('sys.color.ohos_id_color_tertiary')) + SymbolGlyph($r('sys.symbol.arrowtriangle_down_fill')) + .fontSize(`${Constants.VALIDITY_IMAGE_WIDTH}vp`) + .fontColor([$r('sys.color.ohos_id_color_tertiary')]) .margin({ left: Constants.VALIDITY_IMAGE_PADDING_LEFT, right: Constants.VALIDITY_IMAGE_PADDING_RIGHT @@ -157,9 +157,9 @@ struct validDateTypeMenu { .fontWeight(FontWeight.Medium) .fontColor($r('sys.color.ohos_id_color_text_secondary')); - Image($r('app.media.rectangle')) - .width(Constants.VALIDITY_IMAGE_WIDTH) - .fillColor($r('sys.color.ohos_id_color_tertiary')) + SymbolGlyph($r('sys.symbol.arrowtriangle_down_fill')) + .fontSize(`${Constants.VALIDITY_IMAGE_WIDTH}vp`) + .fontColor([$r('sys.color.ohos_id_color_tertiary')]) .margin({ left: Constants.VALIDITY_IMAGE_PADDING_LEFT, right: Constants.VALIDITY_IMAGE_PADDING_RIGHT diff --git a/entry/src/main/ets/common/encryptionComponents/staff.ets b/entry/src/main/ets/common/encryptionComponents/staff.ets index ddd26f1..3147b7b 100644 --- a/entry/src/main/ets/common/encryptionComponents/staff.ets +++ b/entry/src/main/ets/common/encryptionComponents/staff.ets @@ -21,6 +21,7 @@ import { AccountTips, AccountTipsConfig } from '../AccountTipsConfig'; import { GetAlertMessage } from '../GetAlertMessage'; import { DlpAlertDialog } from '../components/dlp_alert_dialog'; import { HiLog } from '../HiLog'; +import { SystemUtils } from '../systemUtils'; const TAG = 'staff'; @@ -148,7 +149,8 @@ struct staffItem { .padding({ bottom: Constants.STAFF_FONT_PADDING }); } .margin({ - right: Constants.ADD_STAFF_ITEM_MARGIN_RIGHT, + left: SystemUtils.isRTL() ? Constants.ADD_STAFF_ITEM_MARGIN_RIGHT : Constants.ADD_STAFF_ITEM_MARGIN_LEFT, + right: SystemUtils.isRTL() ? Constants.ADD_STAFF_ITEM_MARGIN_LEFT : Constants.ADD_STAFF_ITEM_MARGIN_RIGHT, }); Text(this.splitContent()) .textOverflow({ diff --git a/entry/src/main/ets/pages/changeEncryption.ets b/entry/src/main/ets/pages/changeEncryption.ets index 18600c9..1c65a39 100644 --- a/entry/src/main/ets/pages/changeEncryption.ets +++ b/entry/src/main/ets/pages/changeEncryption.ets @@ -42,6 +42,7 @@ import { AccountTipsConfig } from '../common/AccountTipsConfig'; import { EncryptingPanel } from '../common/encryptionComponents/encrypting'; import { GetAlertMessage } from '../common/GetAlertMessage'; import { HiLog } from '../common/HiLog'; +import { SystemUtils } from '../common/systemUtils'; import FileUtils, { FileMsg } from '../common/FileUtils'; const TAG = 'ModEnc'; @@ -476,7 +477,6 @@ struct changeEncryption { .fontFamily($r('app.string.typeface')) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_dialog_tittle')) - .lineHeight(Constants.HEADER_TEXT_LINE_HEIGHT) .width(Constants.HEADER_TEXT_WIDTH) .align(Alignment.Start) } @@ -518,11 +518,13 @@ struct changeEncryption { .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - Image($r('app.media.ic_public_detail')) - .width(Constants.FOOTER_ROW_PAD_RIGHT) - .height(Constants.FOOTER_ROW_PAD_RIGHT) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) - .fillColor($r('sys.color.icon_secondary')) + SymbolGlyph($r('sys.symbol.info_circle')) + .fontSize(`${Constants.FOOTER_ROW_PAD_RIGHT}vp`) + .fontColor([$r('sys.color.icon_secondary')]) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) .onClick(() => { this.handlePopupReadOnly = !this.handlePopupReadOnly }) @@ -541,7 +543,6 @@ struct changeEncryption { }) } .width(Constants.FOOTER_ROW_WIDTH) - .height(Constants.ENCRYPTION_READ_ONLY_EDIT_HEIGHT) .margin({ top: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_TOP, bottom: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_BOTTOM @@ -558,11 +559,13 @@ struct changeEncryption { .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - Image($r('app.media.ic_public_detail')) - .width(Constants.FOOTER_ROW_PAD_RIGHT) - .height(Constants.FOOTER_ROW_PAD_RIGHT) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) - .fillColor($r('sys.color.icon_secondary')) + SymbolGlyph($r('sys.symbol.info_circle')) + .fontSize(`${Constants.FOOTER_ROW_PAD_RIGHT}vp`) + .fontColor([$r('sys.color.icon_secondary')]) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) .onClick(() => { this.handlePopupReadOnly = !this.handlePopupReadOnly }) @@ -581,7 +584,6 @@ struct changeEncryption { }) } .width(Constants.FOOTER_ROW_WIDTH) - .height(Constants.ENCRYPTION_READ_ONLY_EDIT_HEIGHT) .margin({ top: Constants.FOOTER_ROW_MARGIN }) Flex({ @@ -610,12 +612,9 @@ struct changeEncryption { } .customizeText() } - Image($r('app.media.icon_change')) - .draggable(false) - .width(Constants.PP_IMAGE_HEIGHT) - .height(Constants.PP_TEXT_FONT_SIZE2) - .objectFit(ImageFit.Contain) - .fillColor($r('sys.color.ohos_id_color_secondary')) + SymbolGlyph($r('sys.symbol.chevron_down')) + .fontSize(`${Constants.PP_IMAGE_HEIGHT}vp`) + .fontColor([$r('sys.color.ohos_id_color_secondary')]) .rotate({ angle: !this.readOnlyFlag ? Constants.PP_BUTTON_PAD : Constants.ENCRYPTION_SUCCESS_TRANSLATE @@ -663,16 +662,19 @@ struct changeEncryption { .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - Text(this.selectedPermissionTypeEdit.data === 'all' ? $r('app.string.PERMISSION_TYPE_SELECT_ALL') : $r('app.string.PERMISSION_TYPE_SELECT_SELF')) + Text(this.selectedPermissionTypeEdit.data === 'all' ? + $r('app.string.PERMISSION_TYPE_SELECT_ALL') : $r('app.string.PERMISSION_TYPE_SELECT_SELF')) .fontFamily($r('app.string.typeface')) .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - Image($r('app.media.ic_public_detail')) - .width(Constants.FOOTER_ROW_PAD_RIGHT) - .height(Constants.FOOTER_ROW_PAD_RIGHT) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) - .fillColor($r('sys.color.icon_secondary')) + SymbolGlyph($r('sys.symbol.info_circle')) + .fontSize(`${Constants.FOOTER_ROW_PAD_RIGHT}vp`) + .fontColor([$r('sys.color.icon_secondary')]) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) .onClick(() => { this.handlePopupEdit = !this.handlePopupEdit }) @@ -692,7 +694,6 @@ struct changeEncryption { } .justifyContent(FlexAlign.Start) .width(Constants.FOOTER_ROW_WIDTH) - .height(Constants.ENCRYPTION_READ_ONLY_EDIT_HEIGHT) .margin({ top: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_TOP, bottom: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_BOTTOM @@ -709,11 +710,13 @@ struct changeEncryption { .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - Image($r('app.media.ic_public_detail')) - .width(Constants.FOOTER_ROW_PAD_RIGHT) - .height(Constants.FOOTER_ROW_PAD_RIGHT) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) - .fillColor($r('sys.color.icon_secondary')) + SymbolGlyph($r('sys.symbol.info_circle')) + .fontSize(`${Constants.FOOTER_ROW_PAD_RIGHT}vp`) + .fontColor([$r('sys.color.icon_secondary')]) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) .onClick(() => { this.handlePopupEdit = !this.handlePopupEdit }) @@ -733,7 +736,6 @@ struct changeEncryption { } .justifyContent(FlexAlign.Start) .width(Constants.FOOTER_ROW_WIDTH) - .height(Constants.ENCRYPTION_READ_ONLY_EDIT_HEIGHT) Flex({ direction: FlexDirection.Row, @@ -761,12 +763,9 @@ struct changeEncryption { } .customizeText() } - Image($r('app.media.icon_change')) - .draggable(false) - .width(Constants.PP_IMAGE_HEIGHT) - .height(Constants.PP_TEXT_FONT_SIZE2) - .objectFit(ImageFit.Contain) - .fillColor($r('sys.color.ohos_id_color_secondary')) + SymbolGlyph($r('sys.symbol.chevron_down')) + .fontSize(`${Constants.PP_IMAGE_HEIGHT}vp`) + .fontColor([$r('sys.color.ohos_id_color_secondary')]) .rotate({ angle: !this.editFlag ? Constants.PP_BUTTON_PAD : Constants.ENCRYPTION_SUCCESS_TRANSLATE @@ -810,21 +809,27 @@ struct changeEncryption { .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontWeight(FontWeight.Medium) .textAlign(TextAlign.Start) - Text(' : ') + Text(' :') .fontFamily($r('app.string.typeface')) .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + }) Text(getTime()) .fontSize($r('sys.float.ohos_id_text_size_body2')) .fontColor($r('sys.color.ohos_id_color_text_secondary')) .fontWeight(FontWeight.Regular) .width(Constants.HEADER_COLUMN_WIDTH) .textAlign(TextAlign.Start) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) } .width(Constants.HEADER_COLUMN_WIDTH) - .height(Constants.AP_MARGIN_TOP) } .padding({ bottom: Constants.ENCRYPTION_CHANGE_VALID_UNTIL_MARGIN_BOTTOM @@ -839,12 +844,11 @@ struct changeEncryption { left: Constants.HEADER_COLUMN_PADDING_LEFT, right: Constants.HEADER_COLUMN_PADDING_RIGHT }) - .margin({ bottom: Constants.ENCRYPTION_CHANGE_VALID_UNTIL_MARGIN_BOTTOM }); Flex({ direction: FlexDirection.Row }) { Button($r('app.string.unencrypted'), { type: ButtonType.Capsule, stateEffect: true }) .backgroundColor($r('sys.color.ohos_id_color_button_normal')) .width(Constants.HEADER_TEXT_WIDTH) - .height(Constants.FOOTER_HEIGHT) + .controlSize(ControlSize.NORMAL) .fontColor($r('sys.color.ohos_id_color_text_primary_activated')) .onClick(async (event) => { AppStorage.setOrCreate('hiOperation', 'Delete_policy'); @@ -856,19 +860,29 @@ struct changeEncryption { this.unEncrypt(); sendDlpManagerFileConfiguration(); }) - .margin({ right: Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN }) + .margin({ + right: SystemUtils.isRTL() ? + Constants.ADD_STAFF_ITEM_MARGIN_LEFT : Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN, + left: SystemUtils.isRTL() ? + Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN : Constants.ADD_STAFF_ITEM_MARGIN_LEFT, + }) Button($r('app.string.change_encryption'), { type: ButtonType.Capsule, stateEffect: true }) .backgroundColor($r('sys.color.ohos_id_color_button_normal')) .width(Constants.HEADER_TEXT_WIDTH) .fontColor($r('sys.color.ohos_id_color_text_primary_activated')) - .height(Constants.FOOTER_HEIGHT) + .controlSize(ControlSize.NORMAL) .onClick(async (event) => { router.replaceUrl({ url: 'pages/encryptionProtection', params: this.routerData }) }) - .margin({ left: Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN }) + .margin({ + right: SystemUtils.isRTL() ? + Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN : Constants.ADD_STAFF_ITEM_MARGIN_LEFT, + left: SystemUtils.isRTL() ? + Constants.ADD_STAFF_ITEM_MARGIN_LEFT : Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN, + }) } .margin({ left: Constants.ENCRYPTION_BUTTON_TO_BUTTON_WIDTH, diff --git a/entry/src/main/ets/pages/encryptionProtection.ets b/entry/src/main/ets/pages/encryptionProtection.ets index 6ef9721..d7f9cdd 100644 --- a/entry/src/main/ets/pages/encryptionProtection.ets +++ b/entry/src/main/ets/pages/encryptionProtection.ets @@ -53,6 +53,7 @@ import HomeFeature from '../feature/HomeFeature'; import { GetAlertMessage } from '../common/GetAlertMessage'; import { HiLog } from '../common/HiLog'; import FileUtils, { FileMsg } from '../common/FileUtils'; +import { SystemUtils } from '../common/systemUtils'; const TAG = 'Encrypt'; let abilityResult: ability.AbilityResult = { @@ -661,7 +662,6 @@ struct DlpDialog { .fontFamily($r('app.string.typeface')) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_dialog_tittle')) - .lineHeight(Constants.HEADER_TEXT_LINE_HEIGHT) .width(Constants.HEADER_TEXT_WIDTH) .align(Alignment.Start) } @@ -684,17 +684,20 @@ struct DlpDialog { .align(Alignment.Start) } .width(Constants.HEADER_COLUMN_WIDTH) + .margin({ bottom: Constants.ENCRYPTION_CHANGE_TIPS_MARGIN_BOTTOM }) Row() { Text($r('app.string.header_title_readonly')) .fontWeight(FontWeight.Medium) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body1')) - Image($r('app.media.ic_public_detail')) - .width(Constants.FOOTER_ROW_PAD_RIGHT) - .height(Constants.FOOTER_ROW_PAD_RIGHT) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) - .fillColor($r('sys.color.icon_secondary')) + SymbolGlyph($r('sys.symbol.info_circle')) + .fontSize(`${Constants.FOOTER_ROW_PAD_RIGHT}vp`) + .fontColor([$r('sys.color.icon_secondary')]) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) .onClick(() => { this.handlePopupReadOnly = !this.handlePopupReadOnly }) @@ -720,8 +723,10 @@ struct DlpDialog { }) } .width(Constants.FOOTER_ROW_WIDTH) - .height(Constants.HEADER_COLUMN_HEIGHT_READONLY) - .margin({ top: Constants.FOOTER_ROW_MARGIN }) + .margin({ + top: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_TOP, + bottom: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_BOTTOM + }) Row() { if (!['all', 'self'].includes(this.selectedPermissionTypeReadOnly?.data ?? '')) { @@ -739,11 +744,13 @@ struct DlpDialog { .fontWeight(FontWeight.Medium) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body1')) - Image($r('app.media.ic_public_detail')) - .width(Constants.FOOTER_ROW_PAD_RIGHT) - .height(Constants.FOOTER_ROW_PAD_RIGHT) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) - .fillColor($r('sys.color.icon_secondary')) + SymbolGlyph($r('sys.symbol.info_circle')) + .fontSize(`${Constants.FOOTER_ROW_PAD_RIGHT}vp`) + .fontColor([$r('sys.color.icon_secondary')]) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) .onClick(() => { this.handlePopupEdit = !this.handlePopupEdit }) @@ -769,7 +776,10 @@ struct DlpDialog { }) } .width(Constants.FOOTER_ROW_WIDTH) - .height(Constants.HEADER_COLUMN_HEIGHT_READONLY) + .margin({ + top: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_TOP, + bottom: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_BOTTOM + }) Row() { if (!['all', 'self'].includes(this.selectedPermissionTypeEdit?.data ?? '')) { @@ -794,9 +804,9 @@ struct DlpDialog { this.validity = value; }) Row() { - Image($r('app.media.rectangle')) - .width(Constants.VALIDITY_IMAGE_WIDTH) - .fillColor($r('sys.color.ohos_id_color_tertiary')) + SymbolGlyph($r('sys.symbol.arrowtriangle_down_fill')) + .fontSize(`${Constants.VALIDITY_IMAGE_WIDTH}vp`) + .fontColor([$r('sys.color.ohos_id_color_tertiary')]) } .height(Constants.VALIDITY_IMAGE_HEIGHT) .padding({ @@ -812,7 +822,10 @@ struct DlpDialog { } } .width(Constants.FOOTER_ROW_WIDTH) - .height(Constants.HEADER_COLUMN_HEIGHT_READONLY) + .margin({ + top: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_TOP, + bottom: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_BOTTOM + }) } }.constraintSize({ maxHeight: this.directionStatus === @@ -829,7 +842,7 @@ struct DlpDialog { .width(Constants.HEADER_TEXT_WIDTH) .focusable(true) .fontColor($r('sys.color.ohos_id_color_text_primary_activated')) - .height(Constants.FOOTER_HEIGHT) + .controlSize(ControlSize.NORMAL) .onClick(async (event) => { if (this.isDlpFile && !(GlobalContext.load('requestIsFromSandBox') as boolean)) { this.homeFeature.closeDLPFileHome(GlobalContext.load('uri'), (err: number) => { @@ -853,10 +866,13 @@ struct DlpDialog { (getContext(this) as common.UIAbilityContext).terminateSelfWithResult(abilityResult); } }) - .margin({ right: Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN }) - Button($r('app.string.sure'), { - type: ButtonType.Capsule, stateEffect: true - }) + .margin({ + right: SystemUtils.isRTL() ? + Constants.ADD_STAFF_ITEM_MARGIN_LEFT : Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN, + left: SystemUtils.isRTL() ? + Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN : Constants.ADD_STAFF_ITEM_MARGIN_LEFT, + }) + Button($r('app.string.sure'), { type: ButtonType.Capsule, stateEffect: true }) .backgroundColor($r('sys.color.ohos_id_color_button_normal')) .width(Constants.HEADER_TEXT_WIDTH) .focusable(true) @@ -868,7 +884,7 @@ struct DlpDialog { ['all', 'self'].includes(this.selectedPermissionTypeReadOnly.data ?? '') || ['all', 'self'].includes(this.selectedPermissionTypeEdit.data ?? '')) ) - .height(Constants.FOOTER_BUTTON_HEIGHT) + .controlSize(ControlSize.NORMAL) .onClick(async (event) => { AppStorage.setOrCreate('hiValidDate', false); if (this.selectedIndex === 1) { @@ -892,7 +908,12 @@ struct DlpDialog { await this.beginEncrypt(); } }) - .margin({ left: Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN }) + .margin({ + right: SystemUtils.isRTL() ? + Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN : Constants.ADD_STAFF_ITEM_MARGIN_LEFT, + left: SystemUtils.isRTL() ? + Constants.ADD_STAFF_ITEM_MARGIN_LEFT : Constants.ENCRYPTION_PROTECTION_BUTTON_MARGIN, + }) } .margin({ left: Constants.ENCRYPTION_BUTTON_TO_BUTTON_WIDTH, diff --git a/entry/src/main/ets/pages/encryptionSuccess.ets b/entry/src/main/ets/pages/encryptionSuccess.ets index 0d857dd..bb7a975 100644 --- a/entry/src/main/ets/pages/encryptionSuccess.ets +++ b/entry/src/main/ets/pages/encryptionSuccess.ets @@ -30,6 +30,7 @@ import { import GlobalContext from '../common/GlobalContext'; import HomeFeature from '../feature/HomeFeature'; import { HiLog } from '../common/HiLog'; +import { SystemUtils } from '../common/systemUtils'; const TAG = 'EncSucc'; let abilityResult: ability.AbilityResult = { @@ -148,7 +149,6 @@ struct encryptionSuccess { .fontFamily($r('app.string.typeface')) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_dialog_tittle')) - .lineHeight(Constants.HEADER_TEXT_LINE_HEIGHT) .width(Constants.HEADER_TEXT_WIDTH) .align(Alignment.Start) } @@ -165,11 +165,9 @@ struct encryptionSuccess { Stack() { Circle({ width: Constants.ENCRYPTION_SUCCESS_CIRCLE, height: Constants.ENCRYPTION_SUCCESS_CIRCLE }) .fill($r('sys.color.multi_color_04')); - Image($r('app.media.ic_public_ok')) - .draggable(false) - .fillColor($r('sys.color.icon_on_primary')) - .width(Constants.ENCRYPTION_SUCCESS_ICON) - .height(Constants.ENCRYPTION_SUCCESS_ICON) + SymbolGlyph($r('sys.symbol.checkmark')) + .fontSize(`${Constants.ENCRYPTION_SUCCESS_ICON}vp`) + .fontColor([$r('sys.color.icon_on_primary')]) } .margin({ top: Constants.ENCRYPTION_SUCCESS_IMAGE_MARGIN_TOP }); Column() { @@ -205,20 +203,15 @@ struct encryptionSuccess { .fontColor($r('sys.color.ohos_id_color_secondary')) .fontWeight(FontWeight.Regular) .textAlign(TextAlign.Center) - Image($r('app.media.icon_change')) - .draggable(false) - .fillColor($r('sys.color.ohos_id_color_tertiary')) - .width(Constants.PP_IMAGE_HEIGHT) - .height(Constants.PP_TEXT_FONT_SIZE2) - .objectFit(ImageFit.Contain) + SymbolGlyph($r('sys.symbol.chevron_down')) + .fontSize(`${Constants.PP_IMAGE_HEIGHT}vp`) + .fontColor([$r('sys.color.ohos_id_color_tertiary')]) .rotate({ angle: !this.flag ? Constants.PP_BUTTON_PAD : Constants.ENCRYPTION_SUCCESS_TRANSLATE }) .transition({ type: TransitionType.All, opacity: Constants.PP_BUTTON_PAD }) } .onClick(() => this.onFlagChange()) - .width(Constants.ENCRYPTION_SUCCESS_TRANSLATE_WIDTH) - .height(Constants.ENCRYPTION_READ_ONLY_EDIT_HEIGHT) .justifyContent(FlexAlign.Center) .margin({ bottom: Constants.ENCRYPTION_SUCCESS_ROTATE_MARGIN_BOTTOM }) @@ -240,11 +233,13 @@ struct encryptionSuccess { .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - Image($r('app.media.ic_public_detail')) - .width(Constants.FOOTER_ROW_PAD_RIGHT) - .height(Constants.FOOTER_ROW_PAD_RIGHT) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) - .fillColor($r('sys.color.icon_secondary')) + SymbolGlyph($r('sys.symbol.info_circle')) + .fontSize(`${Constants.FOOTER_ROW_PAD_RIGHT}vp`) + .fontColor([$r('sys.color.icon_secondary')]) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) .onClick(() => { this.handlePopupReadOnly = !this.handlePopupReadOnly }) @@ -263,7 +258,6 @@ struct encryptionSuccess { }) } .width(Constants.FOOTER_ROW_WIDTH) - .height(Constants.ENCRYPTION_READ_ONLY_EDIT_HEIGHT) .margin({ top: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_TOP, bottom: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_BOTTOM @@ -280,11 +274,13 @@ struct encryptionSuccess { .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - Image($r('app.media.ic_public_detail')) - .width(Constants.FOOTER_ROW_PAD_RIGHT) - .height(Constants.FOOTER_ROW_PAD_RIGHT) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) - .fillColor($r('sys.color.icon_secondary')) + SymbolGlyph($r('sys.symbol.info_circle')) + .fontSize(`${Constants.FOOTER_ROW_PAD_RIGHT}vp`) + .fontColor([$r('sys.color.icon_secondary')]) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) .onClick(() => { this.handlePopupReadOnly = !this.handlePopupReadOnly }) @@ -303,7 +299,6 @@ struct encryptionSuccess { }) } .width(Constants.FOOTER_ROW_WIDTH) - .height(Constants.ENCRYPTION_READ_ONLY_EDIT_HEIGHT) Flex({ direction: FlexDirection.Row, @@ -331,12 +326,9 @@ struct encryptionSuccess { } .customizeText() } - Image($r('app.media.icon_change')) - .draggable(false) - .width(Constants.PP_IMAGE_HEIGHT) - .height(Constants.PP_TEXT_FONT_SIZE2) - .objectFit(ImageFit.Contain) - .fillColor($r('sys.color.ohos_id_color_secondary')) + SymbolGlyph($r('sys.symbol.chevron_down')) + .fontSize(`${Constants.PP_IMAGE_HEIGHT}vp`) + .fontColor([$r('sys.color.ohos_id_color_secondary')]) .rotate({ angle: !this.readOnlyFlag ? Constants.PP_BUTTON_PAD : Constants.ENCRYPTION_SUCCESS_TRANSLATE @@ -375,7 +367,8 @@ struct encryptionSuccess { } } - if (['all', 'self'].includes((this.routerParams.selectedPermissionTypeEdit as PermissionType).data)) { + if (['all', 'self'] + .includes((this.routerParams.selectedPermissionTypeEdit as PermissionType).data)) { Row() { Text($r('app.string.header_title_edit')) .fontWeight(FontWeight.Medium) @@ -386,16 +379,19 @@ struct encryptionSuccess { .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - Text((this.routerParams.selectedPermissionTypeEdit as PermissionType).data === 'all' ? $r('app.string.PERMISSION_TYPE_SELECT_ALL') : $r('app.string.PERMISSION_TYPE_SELECT_SELF')) + Text((this.routerParams.selectedPermissionTypeEdit as PermissionType).data === 'all' ? + $r('app.string.PERMISSION_TYPE_SELECT_ALL') : $r('app.string.PERMISSION_TYPE_SELECT_SELF')) .fontFamily($r('app.string.typeface')) .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - Image($r('app.media.ic_public_detail')) - .width(Constants.FOOTER_ROW_PAD_RIGHT) - .height(Constants.FOOTER_ROW_PAD_RIGHT) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) - .fillColor($r('sys.color.icon_secondary')) + SymbolGlyph($r('sys.symbol.info_circle')) + .fontSize(`${Constants.FOOTER_ROW_PAD_RIGHT}vp`) + .fontColor([$r('sys.color.icon_secondary')]) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) .onClick(() => { this.handlePopupEdit = !this.handlePopupEdit }) @@ -415,7 +411,6 @@ struct encryptionSuccess { } .justifyContent(FlexAlign.Start) .width(Constants.FOOTER_ROW_WIDTH) - .height(Constants.ENCRYPTION_READ_ONLY_EDIT_HEIGHT) .margin({ top: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_TOP, bottom: Constants.ENCRYPTION_SUCCESS_ADD_STAFF_MARGIN_BOTTOM @@ -432,11 +427,13 @@ struct encryptionSuccess { .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - Image($r('app.media.ic_public_detail')) - .width(Constants.FOOTER_ROW_PAD_RIGHT) - .height(Constants.FOOTER_ROW_PAD_RIGHT) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) - .fillColor($r('sys.color.icon_secondary')) + SymbolGlyph($r('sys.symbol.info_circle')) + .fontSize(`${Constants.FOOTER_ROW_PAD_RIGHT}vp`) + .fontColor([$r('sys.color.icon_secondary')]) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) .onClick(() => { this.handlePopupEdit = !this.handlePopupEdit }) @@ -456,7 +453,6 @@ struct encryptionSuccess { } .justifyContent(FlexAlign.Start) .width(Constants.FOOTER_ROW_WIDTH) - .height(Constants.ENCRYPTION_READ_ONLY_EDIT_HEIGHT) Flex({ direction: FlexDirection.Row, @@ -484,12 +480,9 @@ struct encryptionSuccess { } .customizeText() } - Image($r('app.media.icon_change')) - .draggable(false) - .width(Constants.PP_IMAGE_HEIGHT) - .height(Constants.PP_TEXT_FONT_SIZE2) - .objectFit(ImageFit.Contain) - .fillColor($r('sys.color.ohos_id_color_secondary')) + SymbolGlyph($r('sys.symbol.chevron_down')) + .fontSize(`${Constants.PP_IMAGE_HEIGHT}vp`) + .fontColor([$r('sys.color.ohos_id_color_secondary')]) .rotate({ angle: !this.editFlag ? Constants.PP_BUTTON_PAD : Constants.ENCRYPTION_SUCCESS_TRANSLATE @@ -535,18 +528,25 @@ struct encryptionSuccess { .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontWeight(FontWeight.Medium) .textAlign(TextAlign.Start) - Text(' : ') + Text(' :') .fontFamily($r('app.string.typeface')) .fontWeight(FontWeight.Regular) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + }) Text(getTime()) .fontSize($r('sys.float.ohos_id_text_size_body2')) .fontColor($r('sys.color.ohos_id_color_text_secondary')) .fontWeight(FontWeight.Regular) .width(Constants.HEADER_COLUMN_WIDTH) .textAlign(TextAlign.Start) - .margin({ left: Constants.AP_TEXT_PAD_RIGHT }) + .margin({ + right: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_RIGHT : Constants.AP_TEXT_PAD_LEFT, + left: SystemUtils.isRTL() ? Constants.AP_TEXT_PAD_LEFT : Constants.AP_TEXT_PAD_RIGHT, + }) } .width(Constants.HEADER_COLUMN_WIDTH) @@ -585,7 +585,7 @@ struct encryptionSuccess { .backgroundColor($r('sys.color.ohos_id_color_text_primary_activated')) .fontWeight(FontWeight.Medium) .width(Constants.FOOTER_WIDTH_BUTTON) - .height(Constants.FOOTER_HEIGHT) + .controlSize(ControlSize.NORMAL) .onClick(async (event) => { if (!(GlobalContext.load('requestIsFromSandBox') as boolean)) { let dlpFileName: string = GlobalContext.load('dlpFileName') as string; @@ -613,7 +613,8 @@ struct encryptionSuccess { }); } else { if (GlobalContext.load('fileOpenHistoryFromMain')) { - (GlobalContext.load('fileOpenHistoryFromMain') as Map).delete(GlobalContext.load('uri') as string) + (GlobalContext.load('fileOpenHistoryFromMain') as Map) + .delete(GlobalContext.load('uri') as string) } abilityResult.resultCode = 0; (getContext(this) as common.UIAbilityContext).terminateSelfWithResult(abilityResult); diff --git a/entry/src/main/ets/pages/permissionStatus.ets b/entry/src/main/ets/pages/permissionStatus.ets index c895d0a..c4e4f43 100644 --- a/entry/src/main/ets/pages/permissionStatus.ets +++ b/entry/src/main/ets/pages/permissionStatus.ets @@ -211,7 +211,6 @@ struct PermissionStatus { .fontWeight(FontWeight.Bold) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_dialog_tittle')) - .lineHeight(Constants.HEADER_TEXT_LINE_HEIGHT) .width(Constants.HEADER_TEXT_WIDTH) .align(Alignment.Start) } @@ -246,7 +245,7 @@ struct PermissionStatus { Column() { Row() { Text(item.label) - .constraintSize({ minHeight: Constants.SUB_HEADER_HEIGHT }) + .constraintSize({ minHeight: Constants.SUB_HEADER_HEIGHT, maxWidth: Constants.SUB_HEADER_WIDTH }) .fontSize($r('sys.float.ohos_id_text_size_body1')) .textAlign(TextAlign.Start) .fontWeight(FontWeight.Medium) @@ -259,10 +258,9 @@ struct PermissionStatus { .fontWeight(FontWeight.Regular) .opacity(Constants.ENCRYPTION_STATUS_VALUE_COLOR) } else { - Image(item.value ? $r('app.media.ok') : $r('app.media.cancel')) - .width(Constants.PP_IMAGE_WIDTH) - .height(Constants.PP_IMAGE_HEIGHT) - .fillColor($r('sys.color.ohos_id_color_text_primary')) + SymbolGlyph(item.value ? $r('sys.symbol.checkmark') : $r('sys.symbol.multiply')) + .fontSize(`${Constants.PP_IMAGE_WIDTH}vp`) + .fontColor([$r('sys.color.ohos_id_color_text_primary')]) .opacity(Constants.ENCRYPTION_STATUS_VALUE_COLOR) } } @@ -307,7 +305,7 @@ struct PermissionStatus { .backgroundColor($r('sys.color.ohos_id_color_button_normal')) .fontColor($r('sys.color.ohos_id_color_text_primary_activated')) .width(Constants.ENCRYPTION_PERMISSION_STATUS_WIDTH) - .height(Constants.FOOTER_BUTTON_HEIGHT) + .controlSize(ControlSize.NORMAL) .onClick(() => { if (this.session !== undefined) { this.session.terminateSelfWithResult({