!23 modify UI for ux opinion

Merge pull request !23 from guozejun/master
This commit is contained in:
openharmony_ci
2022-04-27 09:00:19 +00:00
committed by Gitee
16 changed files with 282 additions and 150 deletions
+14 -14
View File
@@ -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"
}
}
}
@@ -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<number>('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<number>('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)
}
}
@@ -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)
@@ -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)
}
@@ -56,6 +56,10 @@
"name": "folder_color_19ffffff",
"value": "#19ffffff"
},
{
"name": "folder_color_d6d6d6",
"value": "#d6d6d6"
},
{
"name": "folder_color_19182431",
"value": "#19182431"
@@ -1 +1,13 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><style>.cls-1{fill:#fff;}</style></defs><title>文档扫描</title><path d="M20,40A20,20,0,1,1,40,20,20,20,0,0,1,20,40Zm0-1A19,19,0,1,0,1,20,19,19,0,0,0,20,39Z"/><circle class="cls-1" cx="20" cy="20" r="19"/><path d="M16.99349,24.34229l12.2994-12.2994a1,1,0,0,1,1.41422,1.41422L17.7006,26.46361a1,1,0,0,1-1.41421,0l-6.9935-6.99349a1,1,0,0,1,1.41422-1.41422Z"/></svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:#182431;}
</style>
<title>画板</title>
<path class="st0" d="M12,1c6.1,0,11,4.9,11,11s-4.9,11-11,11S1,18.1,1,12S5.9,1,12,1z M12,2.5c-5.2,0-9.5,4.3-9.5,9.5
s4.3,9.5,9.5,9.5s9.5-4.3,9.5-9.5S17.2,2.5,12,2.5z M18.2,8.7c0.3,0.3,0.3,0.7,0,1l0,0l-5.9,5.9c-0.7,0.7-1.7,0.7-2.4,0l0,0
l-3.4-3.4c-0.1-0.1-0.2-0.2-0.2-0.4l0-0.1v-0.1c0-0.2,0.1-0.3,0.2-0.5c0.3-0.3,0.7-0.3,1,0l0,0l3.1,3.1c0.3,0.3,0.7,0.3,1,0l0,0
l5.6-5.6C17.4,8.4,17.9,8.4,18.2,8.7z"/>
</svg>

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 831 B

@@ -3,7 +3,7 @@
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#007DFF;}
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#FF6100;}
.st1{filter:url(#filter-2);}
.st2{fill-rule:evenodd;clip-rule:evenodd;}
.st3{fill:none;stroke:#000000;stroke-opacity:5.000000e-02;}
@@ -18,15 +18,13 @@
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="0.5"></feGaussianBlur>
<feColorMatrix in="shadowBlurOuter1" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"></feColorMatrix>
</filter>
<title>选中</title>
<g transform="translate(2.000000, 2.000000)">
<circle id="Oval-21" class="st0" cx="10" cy="10" r="10"/>
<g id="Oval-43">
<g class="st1">
<circle id="path-1_1_" class="st2" cx="10" cy="10" r="5"/>
</g>
<circle class="st3" cx="10" cy="10" r="5.5"/>
<title>画板</title>
<circle id="Oval-21" class="st0" cx="12" cy="12" r="10"/>
<g id="Oval-43">
<g class="st1">
<circle id="path-1_1_" class="st2" cx="12" cy="12" r="5"/>
</g>
<circle class="st4" cx="10" cy="10" r="5"/>
<circle class="st3" cx="12" cy="12" r="5.5"/>
</g>
<circle class="st4" cx="12" cy="12" r="5"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

+13 -13
View File
@@ -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"
}
}
}
@@ -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);
}
}
@@ -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}`],
+15 -15
View File
@@ -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"
}
}
}
@@ -50,6 +50,8 @@ export struct MyNoteHomeComp {
let permissionList: Array<string> = [
"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')
@@ -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)
}
+15 -1
View File
@@ -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,
+15 -15
View File
@@ -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"
}
}
}
@@ -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<boolean>('IsContinue', true)
// 获取对端的迁移数据