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 8b7046e71592dd3b824883959dfccc63a99fd980..631a488589fedc95d377f1283bcf68dd56f9caef 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 729e89def4dc84bf97fc5da55814dedcaeeba206..510bae876f5b1bcc5ea4e871e0ad3dbce1c0c309 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) {