From b296a484b5b549b533a4b69ff491937ef00b0c57 Mon Sep 17 00:00:00 2001 From: fanchenxuan Date: Thu, 14 Jul 2022 11:32:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AA=E9=80=80bug=20rk=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E6=97=B6=E7=82=B9=E5=87=BB=E5=BA=94=E7=94=A8=E7=BB=B4=E5=BA=A6?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=97=AA=E9=80=80=20Signed-off-by:=20fanchen?= =?UTF-8?q?xuan=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ets/MainAbility/common/utils/constant.ets | 2 +- .../pages/authority-management.ets | 154 +++++++++--------- 2 files changed, 76 insertions(+), 80 deletions(-) diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/utils/constant.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/utils/constant.ets index 8b7046e71..631a48858 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/utils/constant.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/utils/constant.ets @@ -165,7 +165,7 @@ export default class Constants { static AUTHORITY_LISTITEM_PADDING_LEFT = 12; static AUTHORITY_LISTITEM_PADDING_RIGHT = 12; static AUTHORITY_TEXTINPUT_PADDING_LEFT = 12; - static AUTHORITY_TEXTINPUT_PADDING_RIGHT = 4; + static AUTHORITY_TEXTINPUT_PADDING_RIGHT = 24; static AUTHORITY_TEXT_MARGIN_TOP = 24; static AUTHORITY_TEXT_MARGIN_LEFT = 0; static AUTHORITY_ROW_MARGIN_TOP = 24; diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-management.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-management.ets index 729e89def..510bae876 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-management.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-management.ets @@ -479,63 +479,60 @@ struct authorityManagementPage { Column() { Column() { Stack() { - Tabs() { - TabContent() { - Row() { + if(this.allGroupPermission.length) { + Tabs() { + TabContent() { + Row() { Column() { - if(this.allGroupPermission.length) { - Flex({ justifyContent: FlexAlign.SpaceBetween }) { - Shape() { - Rect().width(Constants.SHAPE_DIA).height(Constants.SHAPE_DIA).fill($r('app.color.background_color')) - Circle().width(Constants.SHAPE_BIG_DIA).height(Constants.SHAPE_BIG_DIA) - .fill($r('app.color.list_background_color')) - }.width(Constants.SHAPE_DIA) - Shape() { - Rect().width(Constants.SHAPE_DIA).height(Constants.SHAPE_DIA).fill($r('app.color.background_color')) - Circle().width(Constants.SHAPE_BIG_DIA).height(Constants.SHAPE_BIG_DIA) - .fill($r('app.color.list_background_color')).offset({ x: Constants.SHAPE_OFFSET_X }) - }.width(Constants.SHAPE_DIA) - }.width(Constants.FULL_WIDTH).height(Constants.SHAPE_DIA).zIndex(Constants.SHAPE_ZINDEX) - .position({ x: 0, y: Constants.MANAGEMENT_ROW_PADDING_TOP }) - .padding({ left: Constants.MANAGEMENT_ROW_PADDING_LEFT, right: Constants.MANAGEMENT_ROW_PADDING_RIGHT }) - } + Flex({ justifyContent: FlexAlign.SpaceBetween }) { + Shape() { + Rect().width(Constants.SHAPE_DIA).height(Constants.SHAPE_DIA).fill($r('app.color.background_color')) + Circle().width(Constants.SHAPE_BIG_DIA).height(Constants.SHAPE_BIG_DIA) + .fill($r('app.color.list_background_color')) + }.width(Constants.SHAPE_DIA) + Shape() { + Rect().width(Constants.SHAPE_DIA).height(Constants.SHAPE_DIA).fill($r('app.color.background_color')) + Circle().width(Constants.SHAPE_BIG_DIA).height(Constants.SHAPE_BIG_DIA) + .fill($r('app.color.list_background_color')).offset({ x: Constants.SHAPE_OFFSET_X }) + }.width(Constants.SHAPE_DIA) + }.width(Constants.FULL_WIDTH).height(Constants.SHAPE_DIA).zIndex(Constants.SHAPE_ZINDEX) + .position({ x: 0, y: Constants.MANAGEMENT_ROW_PADDING_TOP }) + .padding({ left: Constants.MANAGEMENT_ROW_PADDING_LEFT, right: Constants.MANAGEMENT_ROW_PADDING_RIGHT }) Scroll() { Column() { - if(this.allGroupPermission.length) { - List() { - ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.FIXED_GROUP).slice(Constants.SLICE_START, - this.getPermissionGroup(this.allGroupPermission, Constants.FIXED_GROUP).length - 1), (item) => { - this.ListItemLayout(item, Constants.SLICE_START_INDEX) - }, item => item.toString()) - ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.FIXED_GROUP).slice(Constants.SLICE_END), (item, index) => { - this.ListItemLayout(item, Constants.SLICE_END_INDEX) - }, item => item.toString()) - }.backgroundColor($r('app.color.default_background_color')) - .borderRadius(Constants.BORDER_RADIUS) - .padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM }) - .margin({ bottom: Constants.LIST_MARGIN_BOTTOM }) - - List() { - ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.CHANGE_GROUP).slice(Constants.SLICE_START, - this.getPermissionGroup(this.allGroupPermission, Constants.CHANGE_GROUP).length - 1), (item) => { - this.ListItemLayout(item, Constants.SLICE_START_INDEX) - }, item => item.toString()) - ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.CHANGE_GROUP).slice(Constants.SLICE_END), (item, index) => { - this.ListItemLayout(item, Constants.SLICE_END_INDEX) - }, item => item.toString()) - }.backgroundColor($r('app.color.default_background_color')) - .borderRadius(Constants.BORDER_RADIUS) - .padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM }) - .margin({ bottom: Constants.LIST_MARGIN_BOTTOM }) - - List() { - ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.OTHER_GROUP), (item) => { - this.ListItemLayout(item, Constants.SLICE_END_INDEX) - }, item => item.toString()) - }.backgroundColor($r('app.color.default_background_color')) - .borderRadius(Constants.BORDER_RADIUS) - .padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM }) - } + List() { + ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.FIXED_GROUP).slice(Constants.SLICE_START, + this.getPermissionGroup(this.allGroupPermission, Constants.FIXED_GROUP).length - 1), (item) => { + this.ListItemLayout(item, Constants.SLICE_START_INDEX) + }, item => item.toString()) + ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.FIXED_GROUP).slice(Constants.SLICE_END), (item, index) => { + this.ListItemLayout(item, Constants.SLICE_END_INDEX) + }, item => item.toString()) + }.backgroundColor($r('app.color.default_background_color')) + .borderRadius(Constants.BORDER_RADIUS) + .padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM }) + .margin({ bottom: Constants.LIST_MARGIN_BOTTOM }) + + List() { + ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.CHANGE_GROUP).slice(Constants.SLICE_START, + this.getPermissionGroup(this.allGroupPermission, Constants.CHANGE_GROUP).length - 1), (item) => { + this.ListItemLayout(item, Constants.SLICE_START_INDEX) + }, item => item.toString()) + ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.CHANGE_GROUP).slice(Constants.SLICE_END), (item, index) => { + this.ListItemLayout(item, Constants.SLICE_END_INDEX) + }, item => item.toString()) + }.backgroundColor($r('app.color.default_background_color')) + .borderRadius(Constants.BORDER_RADIUS) + .padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM }) + .margin({ bottom: Constants.LIST_MARGIN_BOTTOM }) + + List() { + ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.OTHER_GROUP), (item) => { + this.ListItemLayout(item, Constants.SLICE_END_INDEX) + }, item => item.toString()) + }.backgroundColor($r('app.color.default_background_color')) + .borderRadius(Constants.BORDER_RADIUS) + .padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM }) }.padding({ left: Constants.MANAGEMENT_ROW_PADDING_LEFT, right: Constants.MANAGEMENT_ROW_PADDING_RIGHT, @@ -544,16 +541,17 @@ struct authorityManagementPage { .margin({ top: Constants.MANAGEMENT_ROW_PADDING_TOP }) }.width(Constants.FULL_WIDTH) } - }.tabBar($r('app.string.authority')) - TabContent() { - applicationItem({ - applicationItem: bundleInfosList, - oldApplicationItem: bundleInfosList - }) - }.tabBar($r('app.string.application')) + }.tabBar($r('app.string.authority')) + TabContent() { + applicationItem({ + applicationItem: bundleInfosList, + oldApplicationItem: bundleInfosList + }) + }.tabBar($r('app.string.application')) + } + .barWidth(Constants.BAR_WIDTH) + .barMode(BarMode.Fixed) } - .barWidth(Constants.BAR_WIDTH) - .barMode(BarMode.Fixed) }.height(Constants.FULL_HEIGHT) } } @@ -658,22 +656,20 @@ struct applicationItem { Row() { Flex({ alignItems: ItemAlign.Start }) { Column() { - if (this.applicationItem.length) { - Flex({ justifyContent: FlexAlign.SpaceBetween }) { - Shape() { - Rect().width(Constants.SHAPE_DIA).height(Constants.SHAPE_DIA).fill($r('app.color.background_color')) - Circle().width(Constants.SHAPE_BIG_DIA).height(Constants.SHAPE_BIG_DIA) - .fill($r('app.color.list_background_color')) - }.width(Constants.SHAPE_DIA) - Shape() { - Rect().width(Constants.SHAPE_DIA).height(Constants.SHAPE_DIA).fill($r('app.color.background_color')) - Circle().width(Constants.SHAPE_BIG_DIA).height(Constants.SHAPE_BIG_DIA) - .fill($r('app.color.list_background_color')).offset({ x: Constants.SHAPE_OFFSET_X }) - }.width(Constants.SHAPE_DIA) - }.width(Constants.FULL_WIDTH).height(Constants.SHAPE_DIA).zIndex(Constants.SHAPE_ZINDEX) - .position({ x: 0, y: Constants.MANAGEMENT_ROW_MARGIN_TOP }) - .padding({ left: Constants.MANAGEMENT_ROW_PADDING_LEFT }) - } + Flex({ justifyContent: FlexAlign.SpaceBetween }) { + Shape() { + Rect().width(Constants.SHAPE_DIA).height(Constants.SHAPE_DIA).fill($r('app.color.background_color')) + Circle().width(Constants.SHAPE_BIG_DIA).height(Constants.SHAPE_BIG_DIA) + .fill($r('app.color.list_background_color')) + }.width(Constants.SHAPE_DIA) + Shape() { + Rect().width(Constants.SHAPE_DIA).height(Constants.SHAPE_DIA).fill($r('app.color.background_color')) + Circle().width(Constants.SHAPE_BIG_DIA).height(Constants.SHAPE_BIG_DIA) + .fill($r('app.color.list_background_color')).offset({ x: Constants.SHAPE_OFFSET_X }) + }.width(Constants.SHAPE_DIA) + }.width(Constants.FULL_WIDTH).height(Constants.SHAPE_DIA).zIndex(Constants.SHAPE_ZINDEX) + .position({ x: 0, y: Constants.MANAGEMENT_ROW_MARGIN_TOP }) + .padding({ left: Constants.MANAGEMENT_ROW_PADDING_LEFT }) Scroll() { if (!this.applicationItem.length) { if (this.searchResult) { -- Gitee