mirror of
https://github.com/openharmony/applications_notes.git
synced 2026-07-18 18:24:27 -04:00
!33 fix UI for UX designer options
Merge pull request !33 from guozejun/master
This commit is contained in:
@@ -254,6 +254,7 @@ struct NoteDataMoveItemComp {
|
||||
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
|
||||
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = []
|
||||
private folderItem: FolderData
|
||||
dividerShow: boolean = true
|
||||
|
||||
build() {
|
||||
Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) {
|
||||
@@ -283,9 +284,12 @@ struct NoteDataMoveItemComp {
|
||||
.width(248)
|
||||
.height(55)
|
||||
|
||||
Divider()
|
||||
.color($r("app.color.divider_color_e4e4e4"))
|
||||
.strokeWidth(1)
|
||||
if (this.dividerShow) {
|
||||
Divider()
|
||||
.color($r("app.color.divider_color_e4e4e4"))
|
||||
.strokeWidth(1)
|
||||
}
|
||||
|
||||
}
|
||||
.padding({ left: 16 })
|
||||
}
|
||||
@@ -317,7 +321,7 @@ export struct NoteDataMoveDialog {
|
||||
.width(288)
|
||||
|
||||
List() {
|
||||
ForEach(this.NoteDataMoveArray, (item) => {
|
||||
ForEach(this.NoteDataMoveArray.slice(0, this.NoteDataMoveArray.length - 1), (item) => {
|
||||
ListItem() {
|
||||
NoteDataMoveItemComp({ folderItem: item })
|
||||
}
|
||||
@@ -326,6 +330,13 @@ export struct NoteDataMoveDialog {
|
||||
this.onConfirm(item.uuid)
|
||||
})
|
||||
}, noteItem => noteItem.uuid)
|
||||
ListItem() {
|
||||
NoteDataMoveItemComp({ folderItem: this.NoteDataMoveArray[this.NoteDataMoveArray.length - 1], dividerShow: false })
|
||||
}
|
||||
.onClick(() => {
|
||||
this.noteDataMoveDialogCtl.close()
|
||||
this.onConfirm(this.NoteDataMoveArray[this.NoteDataMoveArray.length - 1].uuid)
|
||||
})
|
||||
}.listDirection(Axis.Vertical)
|
||||
.edgeEffect(EdgeEffect.Spring)
|
||||
.height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56)
|
||||
|
||||
@@ -17,15 +17,15 @@ import DateUtil from '@ohos/utils/src/main/ets/default/baseUtil/DateUtil'
|
||||
import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil'
|
||||
import FolderData from '@ohos/utils/src/main/ets/default/model/databaseModel/FolderData'
|
||||
import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData'
|
||||
import {TableName, NoteTableColumn, SysDefFolderUuid, Favorite, Delete
|
||||
import { TableName, NoteTableColumn, SysDefFolderUuid, Favorite, Delete
|
||||
} from '@ohos/utils/src/main/ets/default/model/databaseModel/EnumData'
|
||||
import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleConstants'
|
||||
import {EditContentDialogPortrait, DeleteDialog, EditTitleDialog} from './CusDialogComp'
|
||||
import { EditContentDialogPortrait, DeleteDialog, EditTitleDialog } from './CusDialogComp'
|
||||
import FolderUtil from '@ohos/utils/src/main/ets/default/baseUtil/FolderUtil'
|
||||
import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil'
|
||||
import prompt from '@system.prompt'
|
||||
import featureAbility from '@ohos.ability.featureAbility';
|
||||
import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil'
|
||||
import { LogUtil } from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil'
|
||||
import OperationUtils from '@ohos/utils/src/main/ets/default/baseUtil/OperationUtils'
|
||||
import router from '@system.router'
|
||||
import inputMethod from '@ohos.inputmethod';
|
||||
@@ -145,6 +145,7 @@ export struct NoteContentOverViewComp {
|
||||
@Consume('SelectedNoteData') selectedNoteData: NoteData
|
||||
@StorageLink('AllFolderArray') AllFolderArray: FolderData[] = []
|
||||
@StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = []
|
||||
NoteDataMoveArray: FolderData[]
|
||||
editTitleDialogCtl: CustomDialogController = new CustomDialogController({
|
||||
builder: EditTitleDialog({ confirm: this.confirm.bind(this) }),
|
||||
alignment: DialogAlignment.Center,
|
||||
@@ -152,6 +153,11 @@ export struct NoteContentOverViewComp {
|
||||
customStyle: true,
|
||||
})
|
||||
|
||||
aboutToAppear() {
|
||||
this.NoteDataMoveArray = this.AllFolderArray.slice(2, this.AllFolderArray.length);
|
||||
this.NoteDataMoveArray.push(this.AllFolderArray[1]);
|
||||
}
|
||||
|
||||
confirm(newTitle: string) {
|
||||
this.selectedNoteData.title = newTitle
|
||||
this.selectedNoteData.modified_time = new Date().getTime()
|
||||
@@ -165,30 +171,37 @@ export struct NoteContentOverViewComp {
|
||||
}
|
||||
|
||||
@Builder MenuBuilder() {
|
||||
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
List() {
|
||||
ForEach(this.AllFolderArray, (item) => {
|
||||
ListItem() {
|
||||
NoteDataMoveItemCompMenu({ folderItem: item, uuid: this.selectedNoteData.folder_uuid })
|
||||
}
|
||||
.onClick(() => {
|
||||
this.selectedNoteData.folder_uuid = item.uuid
|
||||
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
|
||||
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
|
||||
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
|
||||
// save continue data
|
||||
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
||||
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
|
||||
LogUtil.info(TAG, 'MenuBuilder, set continue note success')
|
||||
})
|
||||
}, noteItem => noteItem.uuid)
|
||||
}.listDirection(Axis.Vertical)
|
||||
.edgeEffect(EdgeEffect.Spring)
|
||||
.height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56)
|
||||
Column() {
|
||||
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
List() {
|
||||
ForEach(this.NoteDataMoveArray, (item) => {
|
||||
ListItem() {
|
||||
NoteDataMoveItemCompMenu({ folderItem: item, uuid: this.selectedNoteData.folder_uuid })
|
||||
}
|
||||
.onClick(() => {
|
||||
this.selectedNoteData.folder_uuid = item.uuid
|
||||
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
|
||||
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
|
||||
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
|
||||
// save continue data
|
||||
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
||||
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
|
||||
LogUtil.info(TAG, 'MenuBuilder, set continue note success')
|
||||
})
|
||||
}, noteItem => noteItem.uuid)
|
||||
}
|
||||
.margin({ top: 4, bottom: 4 })
|
||||
.listDirection(Axis.Vertical)
|
||||
.edgeEffect(EdgeEffect.Spring)
|
||||
.height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56)
|
||||
}
|
||||
.margin({ top: 24, bottom: 24, left: 24, right: 24 })
|
||||
.borderRadius(16)
|
||||
.backgroundColor($r('app.color.folder_color_ffffff'))
|
||||
.shadow({ color: "#0a000000", offsetX: 0, offsetY: 2, radius: 30 })
|
||||
.width(148)
|
||||
.padding({ left: 24, right: 24 })
|
||||
}
|
||||
.width(148)
|
||||
.backgroundColor($r("app.color.color_fffffB"))
|
||||
.padding({ left: 24, right: 24 })
|
||||
}
|
||||
|
||||
build() {
|
||||
@@ -209,6 +222,7 @@ export struct NoteContentOverViewComp {
|
||||
.fontColor($r("app.color.modified_time_font_color"))
|
||||
Row() {
|
||||
Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)))
|
||||
.fontColor($r('app.color.folder_color_99182431'))
|
||||
.fontSize(12)
|
||||
Image($r('app.media.triangle'))
|
||||
.width(6)
|
||||
@@ -520,7 +534,7 @@ struct NoteDataMoveItemCompMenu {
|
||||
.objectFit(ImageFit.ScaleDown)
|
||||
.width(24)
|
||||
.height(24)
|
||||
.fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false))
|
||||
.fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, this.folderItem.uuid == this.uuid))
|
||||
}
|
||||
.width(24)
|
||||
|
||||
@@ -528,7 +542,7 @@ struct NoteDataMoveItemCompMenu {
|
||||
Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) {
|
||||
Text(FolderUtil.getFolderText(this.folderItem))
|
||||
.fontSize(16)
|
||||
.fontColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid == this.uuid ? this.folderItem.uuid : '', false))
|
||||
.fontColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid == this.uuid ? this.folderItem.uuid : '', this.folderItem.uuid == this.uuid))
|
||||
.textAlign(TextAlign.Center)
|
||||
.maxLines(1)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
@@ -537,9 +551,12 @@ struct NoteDataMoveItemCompMenu {
|
||||
.width('100%')
|
||||
.height(55)
|
||||
|
||||
Divider()
|
||||
.color($r("app.color.divider_color_e4e4e4"))
|
||||
.strokeWidth(1)
|
||||
if (this.folderItem.uuid != SysDefFolderUuid.UnClassified) {
|
||||
Divider()
|
||||
.color($r("app.color.divider_color_e4e4e4"))
|
||||
.strokeWidth(1)
|
||||
}
|
||||
|
||||
}
|
||||
.padding({ left: 16 })
|
||||
}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
<?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="M5.6,7.5l1.1,11c0.1,1.1,1,2,2.2,2l0.1,0H15c1.1,0,2.1-0.8,2.2-2l0-0.1l0.9-9.2l0.2-1.8h1.5l-0.2,1.9l-0.9,9.2
|
||||
C18.6,20.5,17,22,15.1,22L15,22H9c-1.9,0-3.5-1.4-3.7-3.3l0-0.1L4.1,7.5H5.6z M10.2,11.7c0.4,0,0.8,0.3,0.8,0.8v6
|
||||
c0,0.4-0.3,0.8-0.8,0.8s-0.8-0.3-0.8-0.8v-6C9.5,12.1,9.8,11.7,10.2,11.7z M13.8,11.7c0.4,0,0.8,0.3,0.8,0.8v6
|
||||
c0,0.4-0.3,0.8-0.8,0.8S13,18.9,13,18.5v-6C13,12.1,13.3,11.7,13.8,11.7z M12,1.7c1.8,0,3.2,1.4,3.2,3.2l0,0.1H21
|
||||
c0.4,0,0.8,0.3,0.8,0.8c0,0.4-0.3,0.7-0.7,0.7l0,0h-6.5c-0.4,0-0.7-0.3-0.7-0.7l0,0V5c0-1-0.8-1.7-1.8-1.7c-0.9,0-1.7,0.8-1.7,1.7
|
||||
l0,0.1v0.8c0,0.4-0.3,0.7-0.7,0.7l0,0H2.8C2.3,6.5,2,6.2,2,5.7C2,5.4,2.3,5,2.7,5l0,0h6C8.8,3.2,10.2,1.7,12,1.7z"/>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>删除</title>
|
||||
<defs>
|
||||
<path d="M5.629,7.5 L6.72612901,18.4738834 C6.83893748,19.6019681 7.77211147,20.4662096 8.89848718,20.4990325 L8.96496269,20.5 L15.0342282,20.5 C16.1681898,20.5 17.1211231,19.6570911 17.2655686,18.5392856 L17.2731282,18.4732196 L18.1924161,9.2527383 L18.369,7.5 L19.877,7.5 L19.6849078,9.40262938 L18.7657282,18.6220326 C18.5772847,20.512127 17.0070268,21.9581787 15.1166184,21.9991088 L15.0342282,22 L8.96496269,22 C7.06591715,22 5.47142703,20.5815579 5.24265599,18.7050136 L5.23357322,18.6231389 L4.121,7.5 L5.629,7.5 Z M10.25,11.75 C10.6642136,11.75 11,12.0857864 11,12.5 L11,18.5 C11,18.9142136 10.6642136,19.25 10.25,19.25 C9.83578644,19.25 9.5,18.9142136 9.5,18.5 L9.5,12.5 C9.5,12.0857864 9.83578644,11.75 10.25,11.75 Z M13.75,11.75 C14.1642136,11.75 14.5,12.0857864 14.5,12.5 L14.5,18.5 C14.5,18.9142136 14.1642136,19.25 13.75,19.25 C13.3357864,19.25 13,18.9142136 13,18.5 L13,12.5 C13,12.0857864 13.3357864,11.75 13.75,11.75 Z M12,1.75 C13.7692836,1.75 15.2083571,3.16379796 15.2491124,4.92328595 L15.25,5 L21,5 C21.4142136,5 21.75,5.33578644 21.75,5.75 C21.75,6.14942022 21.43777,6.47591522 21.0440682,6.49872683 L21,6.5 L14.5,6.5 C14.1005798,6.5 13.7740848,6.18777001 13.7512732,5.7940682 L13.75,5.75 L13.75,5 C13.75,4.03350169 12.9664983,3.25 12,3.25 C11.0536371,3.25 10.2827253,4.00119585 10.2510148,4.93983756 L10.25,5 L10.25,5.75 C10.25,6.14942022 9.93777001,6.47591522 9.5440682,6.49872683 L9.5,6.5 L2.75,6.5 C2.33578644,6.5 2,6.16421356 2,5.75 C2,5.35057978 2.31222999,5.02408478 2.7059318,5.00127317 L2.75,5 L8.75,5 C8.75,3.20507456 10.2050746,1.75 12,1.75 Z" id="path-1"></path>
|
||||
</defs>
|
||||
<g id="删除" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<mask id="mask-2" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
<use id="形状结合" fill="#182431" fill-rule="nonzero" xlink:href="#path-1"></use>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -1 +1,7 @@
|
||||
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" fill="#182431" viewBox="0 0 24 24"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>笔记本</title><rect x="7.25" y="1" width="1.5" height="22"/><path class="cls-1" d="M17,2.5H7A2.5,2.5,0,0,0,4.5,5V19A2.5,2.5,0,0,0,7,21.5H17A2.5,2.5,0,0,0,19.5,19V5A2.5,2.5,0,0,0,17,2.5ZM17,1a4,4,0,0,1,4,4V19a4,4,0,0,1-4,4H7a4,4,0,0,1-4-4V5A4,4,0,0,1,7,1Z"/><path class="cls-1" d="M16.5,6.959l-.96254-.65254-.179-.12136-.1777.123-.93078.6441V2.25H16.5Zm.9375-5.709h-4.125a.57592.57592,0,0,0-.5625.58853V8.59784a.38405.38405,0,0,0,.37641.393.359.359,0,0,0,.21806-.07484l1.75285-1.02878a.5.5,0,0,1,.50272-.002l1.80849,1.04207A.35912.35912,0,0,0,17.62369,9,.3841.3841,0,0,0,18,8.607V1.83853Q18,1.51347,17.4375,1.25Z"/></svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>未分类图标</title>
|
||||
<g id="未分类图标" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M6,23 C4.34314575,23 3,21.6568542 3,20 L3,4 C3,2.34314575 4.34314575,1 6,1 L18,1 C19.6568542,1 21,2.34314575 21,4 L21,20 C21,21.6568542 19.6568542,23 18,23 L6,23 Z M7.25,2.5 L6,2.5 C5.22030388,2.5 4.57955132,3.09488808 4.50686658,3.85553999 L4.5,4 L4.5,20 C4.5,20.7796961 5.09488808,21.4204487 5.85553999,21.4931334 L6,21.5 L7.25,21.5 L7.25,2.5 Z M13,2.5 L8.75,2.5 L8.75,21.5 L18,21.5 C18.7796961,21.5 19.4204487,20.9051119 19.4931334,20.14446 L19.5,20 L19.5,4 C19.5,3.17157288 18.8284271,2.5 18,2.5 L17.75,2.5 L17.75,8.60696035 C17.75,8.80959843 17.6241436,8.95854085 17.4747134,8.99261024 L17.4095268,9 C17.3655893,9 17.3208978,8.98992961 17.2778651,8.96839378 L15.6217319,7.91271676 C15.4841217,7.82507842 15.314438,7.81108657 15.1666498,7.87051518 L15.081036,7.914981 L13.5378527,8.91603645 C13.4760179,8.96763087 13.4074821,8.99087779 13.340558,8.99087779 C13.1865541,8.99087779 13.0413173,8.86749043 13.0074144,8.68130167 L13,8.59783814 L13,2.5 Z M16.5,2.5 L14.25,2.5 L14.25,6.95222182 L15.358483,6.18509007 L16.5,6.95898847 L16.5,2.5 Z" id="形状" fill="#182431"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 794 B After Width: | Height: | Size: 1.4 KiB |
@@ -68,7 +68,7 @@ export class FolderUtil {
|
||||
let folderData: FolderData = this.getFolderData(folderDataArray, selectFolderUuid)
|
||||
if (folderData == undefined) {
|
||||
LogUtil.info(TAG, "FolderIconColor is 182431")
|
||||
return $r("app.color.folder_color_99182431")
|
||||
return $r("app.color.folder_color_182431")
|
||||
}
|
||||
LogUtil.info(TAG, "folderData uuid " + folderData.uuid + " isSelected " + isSelected)
|
||||
if (folderData.folder_type == FolderType.SysDef || folderData.folder_type == FolderType.FeatureDef) {
|
||||
|
||||
Reference in New Issue
Block a user