diff --git a/common/component/package.json b/common/component/package.json index 95679aa..a378052 100644 --- a/common/component/package.json +++ b/common/component/package.json @@ -1,17 +1,17 @@ { - "license": "ISC", - "types": "", - "devDependencies": {}, - "name": "@ohos/component", - "description": "a npm package which contains arkUI2.0 page", - "ohos": { - "org": "" + "license":"ISC", + "types":"", + "devDependencies":{}, + "name":"@ohos/component", + "description":"a npm package which contains arkUI2.0 page", + "ohos":{ + "org":"" }, - "main": "index.ets", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/utils": "file:../utils", - "@ohos/source": "file:../resources" + "main":"index.ets", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/utils":"file:../utils", + "@ohos/source":"file:../resources" } -} +} \ No newline at end of file diff --git a/common/component/src/main/ets/components/FolderListComp.ets b/common/component/src/main/ets/components/FolderListComp.ets index 7f99e89..2d59ce3 100644 --- a/common/component/src/main/ets/components/FolderListComp.ets +++ b/common/component/src/main/ets/components/FolderListComp.ets @@ -33,39 +33,42 @@ export struct FolderListComp { TAG = "FolderListComp" build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) { + Flex({direction: FlexDirection.Column, justifyContent: FlexAlign.SpaceBetween}) { Column() { - Image($r("app.media.suojin")) - .height(24) - .width(24) - .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) - .onClick(() => { - if (this.sectionStatus == 1) { - this.expandStatus = !this.expandStatus - } else { - this.sectionStatus = (this.sectionStatus == 3 ? 2 : 3) - // save continue data - AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) - LogUtil.info(this.TAG, "FolderListComp, set continue section success") - } - }) - }.alignItems(HorizontalAlign.Start) - .width("100%") - .margin({ top: 28 }) - .padding({ left: 24 }) + Column() { + Image($r("app.media.suojin")) + .height(24) + .width(24) + .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) + .onClick(() => { + if (this.sectionStatus == 1) { + this.expandStatus = !this.expandStatus + } else { + this.sectionStatus = (this.sectionStatus == 3 ? 2 : 3) + // save continue data + AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) + LogUtil.info(this.TAG, "FolderListComp, set continue section success") + } + }) + }.alignItems(HorizontalAlign.Start) + .width("100%") + .margin({ top: 28 }) + .padding({ left: 24 }) - NoteAndCreateComp() - // center - List() { - ForEach(this.AllFolderArray, (folderItem: FolderData) => { - ListItem() { - if (!FolderUtil.isBottomFixedFolder(folderItem)) { - FolderItemComp({ folderItem: folderItem, controllerShow: this.controllerShow }) + NoteAndCreateComp() + // center + List() { + ForEach(this.AllFolderArray, (folderItem: FolderData) => { + ListItem() { + if (!FolderUtil.isBottomFixedFolder(folderItem)) { + FolderItemComp({ folderItem: folderItem, controllerShow: this.controllerShow }) + } } - } - }, folderItem => folderItem.name.toString()) - }.width('100%') - .padding({ left: 12, right: 12 }) + }, folderItem => folderItem.name.toString()) + }.width('100%') + .padding({ left: 12, right: 12 }) + } + Column() { FolderItemComp({ @@ -80,7 +83,7 @@ export struct FolderListComp { .width("100%") .padding({ left: 12, right: 12 }) } - .padding({ bottom: 48 }) + .padding({ bottom: 24 }) .height("100%") } @@ -349,7 +352,7 @@ struct FolderItemComp { .height(56) .padding({ left: 12, right: 12 }) .backgroundColor(this.isLongPress ? $r("app.color.folder_color_19182431") : this.selectedFolderData.uuid == this.folderItem.uuid - ? $r("app.color.folder_color_ffffff") : $r("app.color.folder_color_19ffffff")) + ? $r("app.color.folder_color_ffffff") : "") .bindContextMenu(this.menuBuilder, ResponseType.LongPress) .bindContextMenu(this.menuBuilder, ResponseType.RightClick) .onClick(() => { @@ -389,4 +392,21 @@ struct FolderItemComp { ) ) } +} + + +@Component +export struct FolderListBackGround { + build() { + Column() { } + .shadow({ + radius: 54, + offsetY: 24 + }) + .width("100%") + .height("100%") + .backgroundColor($r('app.color.folder_color_d6d6d6')) + .opacity(0.4) + .blur(60) + } } \ No newline at end of file diff --git a/common/component/src/main/ets/components/NoteContentCompPortrait.ets b/common/component/src/main/ets/components/NoteContentCompPortrait.ets index 9929710..c102b13 100644 --- a/common/component/src/main/ets/components/NoteContentCompPortrait.ets +++ b/common/component/src/main/ets/components/NoteContentCompPortrait.ets @@ -78,16 +78,15 @@ export struct NoteContentCompPortrait { } build() { - Stack({ alignContent: Alignment.Bottom }) { + Column() { Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, alignItems: ItemAlign.Start, alignContent: FlexAlign.SpaceAround }) { Column() { ToolBarComp({ controllerShow: this.controllerShow }) + NoteContentOverViewComp() } Column() { - NoteContentOverViewComp() - Web({ src: $rawfile('editor.html'), controller: this.controllerShow }) .javaScriptAccess(true) .onPageEnd((e) => { @@ -110,6 +109,7 @@ export struct NoteContentCompPortrait { .height('70%') .width('100%') } + .flexShrink(1) .onClick(() => { // 添加定时器:3s自动保存 time_id = setInterval(() => { @@ -121,7 +121,7 @@ export struct NoteContentCompPortrait { .margin({ top: 16 }) .width(StyleConstants.PERCENTAGE_100) } - .height(StyleConstants.PERCENTAGE_100) + .flexShrink(1) .margin({ left: 24, right: 24 }) EditNoteCompForPortrait({ controllerShow: this.controllerShow }) @@ -224,7 +224,7 @@ export struct NoteContentOverViewComp { } .opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1) .width(StyleConstants.PERCENTAGE_100) - .height(80) + .height(82) } } @@ -317,7 +317,7 @@ export struct ToolBarComp { } } .width(StyleConstants.PERCENTAGE_100) - .height(80) + .height(40) } } @@ -418,9 +418,9 @@ export struct EditNoteCompForPortrait { } build() { - Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.SpaceBetween }) { + Row() { Column() { - Image($r('app.media.circle_tick')) + Image($r('app.media.circle_tick1')) .width(24) .height(24) .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) @@ -433,6 +433,9 @@ export struct EditNoteCompForPortrait { .fontColor($r('app.color.list_font_color')) .padding({ top: 5 }) } + .height("100%") + .width(120) + .justifyContent(FlexAlign.Center) .alignItems(HorizontalAlign.Center) Column() { @@ -448,6 +451,9 @@ export struct EditNoteCompForPortrait { .fontColor($r('app.color.style_font_color')) .padding({ top: 5 }) } + .height("100%") + .width(120) + .justifyContent(FlexAlign.Center) .alignItems(HorizontalAlign.Center) Column() { @@ -470,6 +476,7 @@ export struct EditNoteCompForPortrait { let uri = param['select-item-list']; imageUri = uri; } + LogUtil.info(TAG, "image url" + imageUri) // 拷贝 if (imageUri != null && imageUri != "") { OperationUtils.copy(imageUri).then((uriPath) => { @@ -487,6 +494,9 @@ export struct EditNoteCompForPortrait { .fontColor($r('app.color.photo_font_color')) .padding({ top: 5 }) } + .height("100%") + .width(120) + .justifyContent(FlexAlign.Center) .alignItems(HorizontalAlign.Center) } .width(360) diff --git a/common/component/src/main/ets/components/NoteListComp.ets b/common/component/src/main/ets/components/NoteListComp.ets index bfa62ce..8a03da1 100644 --- a/common/component/src/main/ets/components/NoteListComp.ets +++ b/common/component/src/main/ets/components/NoteListComp.ets @@ -49,18 +49,22 @@ export struct NoteListComp { controllerShow: WebController build() { - Stack({ alignContent: Alignment.Bottom }) { + Flex({direction: FlexDirection.Column}) { - Flex({ direction: FlexDirection.Column }) { + Flex({direction: FlexDirection.Column}) { NoteOverViewComp({ controllerShow: this.controllerShow }) NoteItemListComp({ controllerShow: this.controllerShow }) } .padding({ top: this.search ? 15 : 0 }) .width('100%') - .height('100%') + .flexShrink(1) - OperateNoteCompForPortrait() + Column() { + OperateNoteCompForPortrait() + } + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) } + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) .height('100%') .width('100%') } @@ -155,6 +159,7 @@ struct NoteOverViewComp { OperateNoteComp({ controllerShow: this.controllerShow }) Text(this.refreshFlag.toString()).visibility(Visibility.None) } + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) .width('100%').height(82) .padding({ left: this.sectionStatus == 2 ? 24 : 36, right: 24 }) // 两分栏时缩进图标与左侧不需要间距 .visibility(this.search ? Visibility.None : Visibility.Visible) @@ -265,6 +270,7 @@ export struct NoteItemComp { NoteUtil.setNoteChecked(this.CheckedNoteArray, this.noteItem) this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) } + return; } else { this.selectedNoteData = this.noteItem this.chooseNote = true @@ -336,11 +342,14 @@ export struct NoteItemListComp { } build() { - Column() { + Flex({direction: FlexDirection.Column}) { Text(this.refreshFlag.toString()).visibility(Visibility.None) Flex() { SearchComp() - }.margin({ left: 24, right: 24, bottom: 12 }) + } + .width("100%") + .padding({ left: 24, right: 24, bottom: 12 }) + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) .visibility((FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) == 0) ? Visibility.None : Visibility.Visible) Flex({ justifyContent: FlexAlign.Center }) { @@ -348,7 +357,8 @@ export struct NoteItemListComp { .fontSize(12) .fontColor($r("app.color.Recently_delete_prompt_font_color")) } - .margin({ bottom: this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? 12 : 0 }) + .padding({ bottom: this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? 12 : 0 }) + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) .width('100%') .visibility(this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.Visible : Visibility.None) @@ -364,6 +374,7 @@ export struct NoteItemListComp { .fontColor($r("app.color.Empty_page_font_color")) } } + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) .width('100%') .height('100%') .padding({ bottom: 120 }) @@ -372,20 +383,28 @@ export struct NoteItemListComp { ForEach(this.inputKeyword.length == 0 ? NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) : this.searchResultList, (noteItem) => { ListItem() { - NoteItemComp({ - noteItem: noteItem, - spans: SearchModel.splitToHighlightText(noteItem.title, this.inputKeyword), - controllerShow: this.controllerShow - }) - }.margin({ left: 24, right: 24, bottom: 12 }) + Column() { + NoteItemComp({ + noteItem: noteItem, + spans: SearchModel.splitToHighlightText(noteItem.title, this.inputKeyword), + controllerShow: this.controllerShow + }) + } + .padding({ left: 24, right: 24, bottom: 12 }) + } + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) }, noteItem => noteItem.uuid.toString()) - }.listDirection(Axis.Vertical) + } + .height("100%") + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) + .listDirection(Axis.Vertical) .edgeEffect(EdgeEffect.Spring) } .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) - .height('100%') + .flexGrow(1) } - .height('80%') + .backgroundColor($r("app.color.notelist_bgcolor_f1f3f5")) + .flexGrow(1) .padding({ bottom: 1 }) .onClick(() => { this.search = false @@ -648,9 +667,10 @@ export struct OperateNoteCompForPortrait { @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') @Consume('SelectedFolderData') selectedFolderData: FolderData - @Consume('RefreshFlag') refreshFlag: number + @Consume('RefreshFlag') @Watch('opacityChange') refreshFlag: number @Consume('SelectedNoteData') selectedNoteData: NoteData @Consume('PortraitModel') portraitModel: boolean + @State greyOpacity: boolean = false noteDataMoveDialogCtlBottom: CustomDialogController = new CustomDialogController({ builder: NoteDataMoveDialog({ onConfirm: this.onMoveConfirm.bind(this) }), alignment: DialogAlignment.Bottom, @@ -658,6 +678,16 @@ export struct OperateNoteCompForPortrait { customStyle: true, }) + opacityChange() { + if (this.CheckedNoteArray.length == 0) { + this.greyOpacity = true + LogUtil.info(TAG, "none checked array") + } else { + this.greyOpacity = false + LogUtil.info(TAG, this.CheckedNoteArray.length.toString()) + } + } + onMoveConfirm(folderUuid: string) { this.CheckedNoteArray.forEach((noteItem) => { noteItem.folder_uuid = folderUuid @@ -713,10 +743,11 @@ export struct OperateNoteCompForPortrait { } build() { - Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.SpaceBetween }) { + Row() { if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) { Column() { Image($r("app.media.set_top")) + .opacity(this.greyOpacity ? 0.4 : 1) .width(24) .height(24) .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) @@ -732,17 +763,23 @@ export struct OperateNoteCompForPortrait { NoteUtil.unsetAllNotesChecked(this.CheckedNoteArray) }) Text($r("app.string.set_top")) + .opacity(this.greyOpacity ? 0.4 : 1) .fontSize(10) .fontColor($r("app.color.set_top_font_color")) .padding({ top: 5 }) } - .opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1) - .enabled(this.CheckedNoteArray.length == 0 ? false : true) + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .width("25%") + .height("100%") + .opacity(this.greyOpacity ? 0.4 : 1) + .enabled(this.greyOpacity ? false : true) .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) } Column() { Image($r('app.media.delete')) + .opacity(this.greyOpacity ? 0.4 : 1) .width(24) .height(24) .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) @@ -750,17 +787,23 @@ export struct OperateNoteCompForPortrait { this.noteDataDeleteDialogCtlBottom.open() }) Text($r("app.string.delete")) + .opacity(this.greyOpacity ? 0.4 : 1) .fontSize(10) .fontColor($r("app.color.delete_font_color")) .padding({ top: 5 }) } - .opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1) - .enabled(this.CheckedNoteArray.length == 0 ? false : true) + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .width("25%") + .height("100%") + .opacity(this.greyOpacity ? 0.4 : 1) + .enabled(this.greyOpacity ? false : true) .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) { Column() { Image($r('app.media.move')) + .opacity(this.greyOpacity ? 0.4 : 1) .width(24) .height(24) .responseRegion({ x: -15.0, y: -15.0, width: 54, height: 54 }) @@ -768,13 +811,18 @@ export struct OperateNoteCompForPortrait { this.noteDataMoveDialogCtlBottom.open() }) Text($r("app.string.move")) + .opacity(this.greyOpacity ? 0.4 : 1) .fontSize(10) .fontColor($r("app.color.move_font_color")) .padding({ top: 5 }) } - .opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1) - .enabled(this.CheckedNoteArray.length == 0 ? false : true) + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .width("25%") + .height("100%") + .opacity(this.greyOpacity ? 0.4 : 1) + .enabled(this.greyOpacity ? false : true) .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) } @@ -803,9 +851,13 @@ export struct OperateNoteCompForPortrait { .fontColor($r("app.color.recover_font_color")) .padding({ top: 5 }) } - .opacity(this.CheckedNoteArray.length == 0 ? 0.4 : 1) - .enabled(this.CheckedNoteArray.length == 0 ? false : true) + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .width("25%") + .height("100%") + .opacity(this.greyOpacity ? 0.4 : 1) + .enabled(this.greyOpacity ? false : true) .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) } Column() { @@ -828,9 +880,13 @@ export struct OperateNoteCompForPortrait { .fontColor($r("app.color.check_all_font_color")) .padding({ top: 5 }) } + .backgroundColor($r('app.color.notelist_bgcolor_f1f3f5')) + .width("25%") + .height("100%") .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) } - .width(360) + .width("100%") .height(56) .visibility(this.longpress && this.portraitModel == true ? Visibility.Visible : Visibility.None) } diff --git a/common/resources/src/main/resources/base/element/color.json b/common/resources/src/main/resources/base/element/color.json index 76374a3..4f8480b 100644 --- a/common/resources/src/main/resources/base/element/color.json +++ b/common/resources/src/main/resources/base/element/color.json @@ -56,6 +56,10 @@ "name": "folder_color_19ffffff", "value": "#19ffffff" }, + { + "name": "folder_color_d6d6d6", + "value": "#d6d6d6" + }, { "name": "folder_color_19182431", "value": "#19182431" diff --git a/common/resources/src/main/resources/base/media/circle_tick1.svg b/common/resources/src/main/resources/base/media/circle_tick1.svg index 295c58c..44d44b4 100644 --- a/common/resources/src/main/resources/base/media/circle_tick1.svg +++ b/common/resources/src/main/resources/base/media/circle_tick1.svg @@ -1 +1,13 @@ -文档扫描 \ No newline at end of file + + + + +画板 + + diff --git a/common/resources/src/main/resources/base/media/foldMove_select.svg b/common/resources/src/main/resources/base/media/foldMove_select.svg index 6b7b9d1..d9a4f73 100644 --- a/common/resources/src/main/resources/base/media/foldMove_select.svg +++ b/common/resources/src/main/resources/base/media/foldMove_select.svg @@ -3,7 +3,7 @@ diff --git a/common/utils/package.json b/common/utils/package.json index 6581745..acf594b 100644 --- a/common/utils/package.json +++ b/common/utils/package.json @@ -1,16 +1,16 @@ { - "license": "ISC", - "types": "", - "devDependencies": {}, - "name": "@ohos/utils", - "description": "a npm package which contains arkUI2.0 page", - "ohos": { - "org": "" + "license":"ISC", + "types":"", + "devDependencies":{}, + "name":"@ohos/utils", + "description":"a npm package which contains arkUI2.0 page", + "ohos":{ + "org":"" }, - "main": "index.ets", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/source": "file:../resources" + "main":"index.ets", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/source":"file:../resources" } -} +} \ No newline at end of file diff --git a/common/utils/src/main/ets/default/baseUtil/LogUtil.ets b/common/utils/src/main/ets/default/baseUtil/LogUtil.ets index 0f5a561..637a0cb 100644 --- a/common/utils/src/main/ets/default/baseUtil/LogUtil.ets +++ b/common/utils/src/main/ets/default/baseUtil/LogUtil.ets @@ -16,20 +16,36 @@ /** * Log Util */ + export class LogUtil { - static debug(tag: string, msg: string) { - console.debug(tag + ', ' + msg) + private static readonly IS_DEBUG_ON: boolean = false; + private static readonly CONTACTS_DOMAIN: string = "00902"; + private static readonly SLASH: string = "/"; + private static readonly COLON: string = ": "; + constructor() { } - static info(tag: string, msg: string) { - console.info(tag + ', ' + msg) + private static prefix(tag: string) { + return this.CONTACTS_DOMAIN + this.SLASH + tag + this.COLON; } - static warn(tag: string, msg: string) { - console.warn(tag + ', ' + msg) + static debug(tag: string, msg: string, ...args: any[]) { + if (this.IS_DEBUG_ON) { + console.info(this.prefix(tag) + msg, args); + } else { + console.debug(this.prefix(tag) + msg, args); + } } - static error(tag: string, msg: string) { - console.error(tag + ', ' + msg) + static info(tag: string, msg: string, ...args: any[]) { + console.info(this.prefix(tag) + msg, args); + } + + static warn(tag: string, msg: string, ...args: any[]) { + console.warn(this.prefix(tag) + msg, args); + } + + static error(tag: string, msg: string, ...args: any[]) { + console.error(this.prefix(tag) + msg, args); } } \ No newline at end of file diff --git a/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets b/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets index c79a653..99ff038 100644 --- a/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets +++ b/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets @@ -67,7 +67,7 @@ export class OperationUtils { } async getFileAssetById(id,context){ - LogUtil.info(TAG, 'getFileAssetById'); + LogUtil.info(TAG, 'getFileAssetById', id); let fetchOpt = { selections : 'file_id =?', selectionArgs : [`${id}`], diff --git a/product/phone/package.json b/product/phone/package.json index 4e725b2..e161814 100644 --- a/product/phone/package.json +++ b/product/phone/package.json @@ -1,18 +1,18 @@ { - "license": "ISC", - "devDependencies": {}, - "name": "phone", - "ohos": { - "org": "huawei", - "directoryLevel": "module", - "buildTool": "hvigor" + "license":"ISC", + "devDependencies":{}, + "name":"phone", + "ohos":{ + "org":"huawei", + "directoryLevel":"module", + "buildTool":"hvigor" }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/utils": "file:../../common/utils", - "@ohos/component": "file:../../common/component", - "@ohos/source": "file:../../common/resources" + "description":"example description", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/utils":"file:../../common/utils", + "@ohos/component":"file:../../common/component", + "@ohos/source":"file:../../common/resources" } -} +} \ No newline at end of file diff --git a/product/phone/src/main/ets/pages/MyNoteHome.ets b/product/phone/src/main/ets/pages/MyNoteHome.ets index 3f54077..65aca00 100644 --- a/product/phone/src/main/ets/pages/MyNoteHome.ets +++ b/product/phone/src/main/ets/pages/MyNoteHome.ets @@ -50,6 +50,8 @@ export struct MyNoteHomeComp { let permissionList: Array = [ "ohos.permission.READ_MEDIA", + "ohos.permission.WRITE_MEDIA", + "ohos.permission.MEDIA_LOCATION", "ohos.permission.DISTRIBUTED_DATASYNC" ] LogUtil.info(this.TAG, 'permissions need to require from user') diff --git a/product/phone/src/main/ets/pages/NoteHomePortrait.ets b/product/phone/src/main/ets/pages/NoteHomePortrait.ets index d764c09..cb63418 100644 --- a/product/phone/src/main/ets/pages/NoteHomePortrait.ets +++ b/product/phone/src/main/ets/pages/NoteHomePortrait.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import {FolderListComp} from '@ohos/component/src/main/ets/components/FolderListComp' +import {FolderListComp, FolderListBackGround} from '@ohos/component/src/main/ets/components/FolderListComp' import {NoteListComp} from '@ohos/component/src/main/ets/components/NoteListComp' import {NoteContentCompPortrait} from '@ohos/component/src/main/ets/components/NoteContentCompPortrait' import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleConstants' @@ -64,11 +64,11 @@ export struct NoteHomePortraitComp { .enabled(this.expandStatus ? false : true) //Folder list display area - Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.Center }) { + Stack() { + FolderListBackGround() FolderListComp() } - .backgroundColor($r("app.color.folderlist_bgcolor_f1f3f5")) - .width(StyleConstants.PERCENTAGE_60) + .width(200) .height(StyleConstants.PERCENTAGE_100) .visibility(this.expandStatus == false ? Visibility.None : Visibility.Visible) } diff --git a/product/phone/src/main/module.json5 b/product/phone/src/main/module.json5 index 6353f7b..6794925 100644 --- a/product/phone/src/main/module.json5 +++ b/product/phone/src/main/module.json5 @@ -21,7 +21,21 @@ "description": "$string:entry_MainAbility", "mainElement": "MainAbility", "deviceTypes": [ - "phone" + "phone", + ], + "requestPermissions": [ + { + "name": "ohos.permission.READ_MEDIA" + }, + { + "name": "ohos.permission.WRITE_MEDIA" + }, + { + "name": "ohos.permission.MEDIA_LOCATION" + }, + { + "name": "ohos.permission.DISTRIBUTED_DATASYNC" + }, ], "deliveryWithInstall": true, "installationFree": false, diff --git a/product/tablet/package.json b/product/tablet/package.json index a398728..4cfedc4 100644 --- a/product/tablet/package.json +++ b/product/tablet/package.json @@ -1,18 +1,18 @@ { - "license": "ISC", - "devDependencies": {}, - "name": "tablet", - "ohos": { - "org": "huawei", - "directoryLevel": "module", - "buildTool": "hvigor" + "license":"ISC", + "devDependencies":{}, + "name":"tablet", + "ohos":{ + "org":"huawei", + "directoryLevel":"module", + "buildTool":"hvigor" }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/utils": "file:../../common/utils", - "@ohos/component": "file:../../common/component", - "@ohos/source": "file:../../common/resources" + "description":"example description", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/utils":"file:../../common/utils", + "@ohos/component":"file:../../common/component", + "@ohos/source":"file:../../common/resources" } -} +} \ No newline at end of file diff --git a/product/tablet/src/main/ets/MainAbility/MainAbility.ts b/product/tablet/src/main/ets/MainAbility/MainAbility.ts index af24f37..746b8cf 100644 --- a/product/tablet/src/main/ets/MainAbility/MainAbility.ts +++ b/product/tablet/src/main/ets/MainAbility/MainAbility.ts @@ -23,7 +23,7 @@ export default class MainAbility extends Ability { onCreate(want, launchParam) { console.info(this.Tag + " onCreate, launchReason is " + launchParam.launchReason) - if (launchParam.launchReason == 3) { + if (launchParam.launchReason == AbilityConstant.LaunchReason.CONTINUATION) { // 设置迁移标记 AppStorage.SetOrCreate('IsContinue', true) // 获取对端的迁移数据