!124 权限使用记录显示优化

Merge pull request !124 from fanchenxuan/master
This commit is contained in:
openharmony_ci 2023-05-27 09:51:09 +00:00 committed by Gitee
commit 3761895ebe
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 9 additions and 23 deletions

View File

@ -103,9 +103,8 @@ export default class Constants {
static LIST_PADDING_LEFT = 12 static LIST_PADDING_LEFT = 12
static LISTITEM_PADDING_RIGHT = 24; static LISTITEM_PADDING_RIGHT = 24;
static LISTITEM_PADDING_LEFT_RECORD = 32; static LISTITEM_PADDING_LEFT_RECORD = 32;
static LISTITEM_PADDING_RIGHT_RECORD = 50;
static LISTITEM_MARGIN_BOTTOM = 12; static LISTITEM_MARGIN_BOTTOM = 12;
static LISTITEM_MARGIN_BOTTOM_PERMISSION = 14;
static LISTITEM_MARGIN_BOTTOM_APPLICATION = 10;
static LISTITEM_HEIGHT_PERMISSION = 64; static LISTITEM_HEIGHT_PERMISSION = 64;
static LISTITEM_HEIGHT_APPLICATION = 72; static LISTITEM_HEIGHT_APPLICATION = 72;
static IMAGE_HEIGHT = 24; static IMAGE_HEIGHT = 24;
@ -157,15 +156,9 @@ export default class Constants {
static TERTIARY_TEXT_MARGIN_LEFT = 24; static TERTIARY_TEXT_MARGIN_LEFT = 24;
static TERTIARY_HALF_WIDTH = '50%'; static TERTIARY_HALF_WIDTH = '50%';
static TERTIARY_ROW_MARGIN_TOP = 24; static TERTIARY_ROW_MARGIN_TOP = 24;
static TERTIARY_PERMISSION_ROW_MARGIN_TOP = 12;
static TERTIARY_RADIO_IMAGE_WIDTH = 24; static TERTIARY_RADIO_IMAGE_WIDTH = 24;
static TERTIARY_RADIO_IMAGE_HEIGHT = 24; static TERTIARY_RADIO_IMAGE_HEIGHT = 24;
static TERTIARY_RADIO_IMAGE_MARGIN_TOP = 4;
static TERTIARY_LISTITEM_PADDING_LEFT = 24;
static TERTIARY_LISTITEM_PADDING_RIGHT = 24;
static TERTIARY_LISTITEM_MARGIN_TOP = 1; static TERTIARY_LISTITEM_MARGIN_TOP = 1;
static TERTIARY_LIST_PADDING_LEFT = 12;
static TERTIARY_LIST_PADDING_RIGHT = 12;
static TERTIARY_LIST_PADDING_TOP = 4; static TERTIARY_LIST_PADDING_TOP = 4;
static TERTIARY_LIST_PADDING_BOTTOM = 4; static TERTIARY_LIST_PADDING_BOTTOM = 4;
static LOCATION_MARGIN_TOP = 12; static LOCATION_MARGIN_TOP = 12;
@ -195,8 +188,6 @@ export default class Constants {
static SEARCHNORESULT_IMAGE_HEIGHT = 200; static SEARCHNORESULT_IMAGE_HEIGHT = 200;
static AUTHORITY_ALPHABETINDEX_WIDTH = 24; static AUTHORITY_ALPHABETINDEX_WIDTH = 24;
static AUTHORITY_ALPHABETINDEX_PADDING_TOP = 16; static AUTHORITY_ALPHABETINDEX_PADDING_TOP = 16;
static AUTHORITY_TEXT_DECORATION_WIDTH = '86%';
static AUTHORITY_TEXT_DECORATION_MARGIN_LEFT = 53;
// authority-management // authority-management
static MANAGEMENT_IMAGE_WIDTH = 24; static MANAGEMENT_IMAGE_WIDTH = 24;
@ -205,11 +196,9 @@ export default class Constants {
static MANAGEMENT_IMAGE_MARGIN_RIGHT_RECORD = 24; static MANAGEMENT_IMAGE_MARGIN_RIGHT_RECORD = 24;
static MANAGEMENT_IMAGE_MARGIN_LEFT = 8; static MANAGEMENT_IMAGE_MARGIN_LEFT = 8;
static MANAGEMENT_ROW_HEIGHT = 56; static MANAGEMENT_ROW_HEIGHT = 56;
static MANAGEMENT_TEXT_DECORATION_WIDTH = '95%';
static MANAGEMENT_TEXT_DECORATION_MARGIN_LEFT = 40; static MANAGEMENT_TEXT_DECORATION_MARGIN_LEFT = 40;
static MANAGEMENT_LODING_IMAGE_WIDTH = 48; static MANAGEMENT_LODING_IMAGE_WIDTH = 48;
static MANAGEMENT_LODING_IMAGE_HEIGHT = 48; static MANAGEMENT_LODING_IMAGE_HEIGHT = 48;
static MANAGEMENT_LODING_ROW_HEIGHT = '90%';
static MANAGEMENT_ROW_PADDING_LEFT = 12; static MANAGEMENT_ROW_PADDING_LEFT = 12;
static MANAGEMENT_ROW_PADDING_RIGHT = 12; static MANAGEMENT_ROW_PADDING_RIGHT = 12;
static MANAGEMENT_ROW_PADDING_TOP = 8; static MANAGEMENT_ROW_PADDING_TOP = 8;
@ -219,18 +208,12 @@ export default class Constants {
static APPLICATION_IMAGE_HEIGHT = 40; static APPLICATION_IMAGE_HEIGHT = 40;
static APPLICATION_IMAGE_MARGIN_RIGHT = 16; static APPLICATION_IMAGE_MARGIN_RIGHT = 16;
static APPLICATION_TEXT_MARGIN_RIGHT = 4; static APPLICATION_TEXT_MARGIN_RIGHT = 4;
static APPLICATION_LIST_PADDING_LEFT = 12;
static APPLICATION_LIST_PADDING_RIGHT = 12;
static APPLICATION_LIST_MARGIN_BOTTOM = 50; static APPLICATION_LIST_MARGIN_BOTTOM = 50;
static APPLICATION_LISTITEM_PADDING_LEFT = 12;
static APPLICATION_LISTITEM_PADDING_RIGHT = 12;
static APPLICATION_TEXTINPUT_PADDING_LEFT = 12; static APPLICATION_TEXTINPUT_PADDING_LEFT = 12;
static APPLICATION_TEXTINPUT_PADDING_TOP = 8; static APPLICATION_TEXTINPUT_PADDING_TOP = 8;
static APPLICATION_TEXTINPUT_PADDING_RIGHT = 24; static APPLICATION_TEXTINPUT_PADDING_RIGHT = 24;
static APPLICATION_COLUMN_HEIGHT = '93%';
static APPLICATION_ALPHABETINDEX_MARGIN_TOP = 12; static APPLICATION_ALPHABETINDEX_MARGIN_TOP = 12;
static APPLICATION_ALPHABETINDEX_WIDTH = 24; static APPLICATION_ALPHABETINDEX_WIDTH = 24;
static APPLICATION_TEXT_DECORATION_WIDTH = '90%';
static APPLICATION_TEXT_DECORATION_MARGIN_LEFT = 56; static APPLICATION_TEXT_DECORATION_MARGIN_LEFT = 56;
static LOADING_WIDTH = 100; static LOADING_WIDTH = 100;
@ -246,9 +229,6 @@ export default class Constants {
static OTHER_GROUP = 3; static OTHER_GROUP = 3;
static EXTRA_GROUP = 4; static EXTRA_GROUP = 4;
// tabBar
static BAR_WIDTH = 285;
// setTimeout // setTimeout
static DELAY_TIME = 1000; static DELAY_TIME = 1000;
static DELAY_TIME_MAX = 2000; static DELAY_TIME_MAX = 2000;

View File

@ -165,7 +165,7 @@ struct permissionRecordPage {
Column() { Column() {
Row().width(Constants.FULL_WIDTH).height(Constants.TEXT_DECORATION_HEIGHT) Row().width(Constants.FULL_WIDTH).height(Constants.TEXT_DECORATION_HEIGHT)
.backgroundColor($r("sys.color.ohos_id_color_list_separator")) .backgroundColor($r("sys.color.ohos_id_color_list_separator"))
.margin({ bottom: Constants.LISTITEM_MARGIN_BOTTOM_PERMISSION }) .position({ x: 0, y: 0 })
Text(permissionApplication.groupName) Text(permissionApplication.groupName)
.width(Constants.MAXIMUM_HEADER_WIDTH) .width(Constants.MAXIMUM_HEADER_WIDTH)
.maxLines(Constants.MAXIMUM_HEADER_LINES) .maxLines(Constants.MAXIMUM_HEADER_LINES)
@ -177,11 +177,14 @@ struct permissionRecordPage {
.margin({ bottom: Constants.TERTIARY_LABEL_MARGIN_BOTTOM }) .margin({ bottom: Constants.TERTIARY_LABEL_MARGIN_BOTTOM })
Text(this.strings.visits + this.getAppRecords(permissionApplication, item.groupName, true) + Text(this.strings.visits + this.getAppRecords(permissionApplication, item.groupName, true) +
this.strings.recent_visit + this.getTime(this.getAppRecords(permissionApplication, item.groupName, false))) this.strings.recent_visit + this.getTime(this.getAppRecords(permissionApplication, item.groupName, false)))
.padding({ right: Constants.LISTITEM_PADDING_RIGHT_RECORD })
.fontSize(Constants.TEXT_SMALL_FONT_SIZE) .fontSize(Constants.TEXT_SMALL_FONT_SIZE)
.fontColor($r('sys.color.ohos_id_color_text_secondary')) .fontColor($r('sys.color.ohos_id_color_text_secondary'))
.lineHeight(Constants.TEXT_SMALL_LINE_HEIGHT) .lineHeight(Constants.TEXT_SMALL_LINE_HEIGHT)
}.alignItems(HorizontalAlign.Start) }.alignItems(HorizontalAlign.Start)
.height(Constants.FULL_HEIGHT) .height(Constants.FULL_HEIGHT)
.width(Constants.FULL_WIDTH)
.justifyContent(FlexAlign.Center)
} }
}.height(Constants.LISTITEM_HEIGHT_APPLICATION) }.height(Constants.LISTITEM_HEIGHT_APPLICATION)
.onClick(() => { .onClick(() => {
@ -211,7 +214,7 @@ struct permissionRecordPage {
Column() { Column() {
Row().width(Constants.FULL_WIDTH).height(Constants.TEXT_DECORATION_HEIGHT) Row().width(Constants.FULL_WIDTH).height(Constants.TEXT_DECORATION_HEIGHT)
.backgroundColor($r("sys.color.ohos_id_color_list_separator")) .backgroundColor($r("sys.color.ohos_id_color_list_separator"))
.margin({ bottom: Constants.LISTITEM_MARGIN_BOTTOM_APPLICATION }) .position({ x: 0, y: 0 })
Text(permission.groupName) Text(permission.groupName)
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE) .fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
.fontWeight(FontWeight.Medium) .fontWeight(FontWeight.Medium)
@ -220,11 +223,14 @@ struct permissionRecordPage {
.margin({ bottom: Constants.TERTIARY_LABEL_MARGIN_BOTTOM }) .margin({ bottom: Constants.TERTIARY_LABEL_MARGIN_BOTTOM })
Text(this.strings.visits + permission['count' + item.accessTokenId] Text(this.strings.visits + permission['count' + item.accessTokenId]
+ this.strings.recent_visit + this.getTime(permission['lastTime' + item.accessTokenId])) + this.strings.recent_visit + this.getTime(permission['lastTime' + item.accessTokenId]))
.padding({ right: Constants.LISTITEM_PADDING_RIGHT_RECORD })
.fontSize(Constants.TEXT_SMALL_FONT_SIZE) .fontSize(Constants.TEXT_SMALL_FONT_SIZE)
.fontColor($r('sys.color.ohos_id_color_text_secondary')) .fontColor($r('sys.color.ohos_id_color_text_secondary'))
.lineHeight(Constants.TEXT_SMALL_LINE_HEIGHT) .lineHeight(Constants.TEXT_SMALL_LINE_HEIGHT)
}.alignItems(HorizontalAlign.Start) }.alignItems(HorizontalAlign.Start)
.height(Constants.FULL_HEIGHT) .height(Constants.FULL_HEIGHT)
.width(Constants.FULL_WIDTH)
.justifyContent(FlexAlign.Center)
} }
}.height(Constants.LISTITEM_HEIGHT_PERMISSION) }.height(Constants.LISTITEM_HEIGHT_PERMISSION)
.onClick(() => { .onClick(() => {