1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import DateUtil from '@ohos/utils/src/main/ets/default/baseUtil/DateUtil' 17import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil' 18import FolderData from '@ohos/utils/src/main/ets/default/model/databaseModel/FolderData' 19import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData' 20import util from '@ohos.util' 21import { 22 TableName, 23 NoteTableColumn, 24 SysDefFolderUuid, 25 Favorite, 26 Delete 27} from '@ohos/utils/src/main/ets/default/model/databaseModel/EnumData' 28import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleConstants' 29import { EditContentDialog, EditTitleDialog } from './CusDialogComp' 30import FolderUtil from '@ohos/utils/src/main/ets/default/baseUtil/FolderUtil' 31import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' 32import { LogUtil } from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' 33import OperationUtils from '@ohos/utils/src/main/ets/default/baseUtil/OperationUtils' 34import router from '@system.router'; 35import inputMethod from '@ohos.inputMethod'; 36import { folderTextMap } from '@ohos/utils/src/main/ets/default/model/NoteBaseData' 37 38const TAG = "NoteContent" 39 40var timeID: number 41 42@Component 43export struct NoteContent { 44 @Provide('SelectedNoteData') selectedNoteData: NoteData = AppStorage.Get('NewNote') 45 @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') 46 @Provide('Issave') issave: number = 0 47 @Provide('EditModel') editModel: boolean = false 48 @StorageLink('dpi') dpi: number = 240 49 controllerShow: WebviewController 50 private editContentFlag = false 51 @StorageLink('ScrollTopPercent') scrollTopPercent: number = 0.0 52 53 storeScrollTop(scrollTop: number) { 54 if (scrollTop < 0) { 55 return 56 } 57 AppStorage.SetOrCreate<number>('ScrollTopPercent', scrollTop / this.controllerShow.getPageHeight()) 58 } 59 60 restoreScrollTop() { 61 if (!AppStorage.Has('remoteScrollTopPercent')) { 62 return 63 } 64 var scrollTopPercent = AppStorage.Get<number>('remoteScrollTopPercent') 65 if (scrollTopPercent < 0) { 66 return 67 } 68 this.controllerShow.runJavaScript( 69 'document.documentElement.scrollTop = ' + this.controllerShow.getPageHeight() * scrollTopPercent 70 ) 71 AppStorage.Delete('remoteScrollTopPercent') 72 } 73 74 restoreFocus() { 75 if (!AppStorage.Has('isRemoteFocusOnSearch')) { 76 return 77 } 78 let isRemoteFocusOnSearch = AppStorage.Get<boolean>('isRemoteFocusOnSearch') 79 if (isRemoteFocusOnSearch) { 80 focusControl.requestFocus('searchInput') 81 } 82 AppStorage.Delete('isRemoteFocusOnSearch') 83 } 84 85 noteContent = { 86 callbackhtml: (html) => { 87 LogUtil.info(TAG, 'note uuid is:' + this.selectedNoteData.uuid) 88 this.selectedNoteData.content_text = html 89 this.selectedNoteData.modified_time = new Date().getTime() 90 let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) 91 predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) 92 RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) 93 LogUtil.info(TAG, 'update note success:' + this.selectedNoteData.uuid) 94 AppStorage.SetOrCreate<NoteData>('NewNote', this.selectedNoteData) 95 AppStorage.SetOrCreate<boolean>('needRefresh', true) 96 // save continue data 97 let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) 98 AppStorage.SetOrCreate<string>('ContinueNote', continueNote) 99 LogUtil.info(TAG, "callbackhtml, set continue note success") 100 }, 101 callbackImagePath: (imgName) => { 102 // updata note image 103 LogUtil.info(TAG, 'note imgPath is:' + imgName) 104 this.selectedNoteData.content_img = imgName 105 }, 106 107 callbackScheduledSave: (html) => { 108 LogUtil.info(TAG, 'callbackScheduledSave') 109 if (this.selectedNoteData.content_text == html) { 110 LogUtil.info(TAG, 'callbackScheduledSave the same value return') 111 return; 112 } 113 this.selectedNoteData.content_text = html 114 this.selectedNoteData.modified_time = new Date().getTime() 115 let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) 116 predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) 117 RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) 118 LogUtil.info(TAG, 'callbackScheduledSave, update note success:' + this.selectedNoteData.uuid) 119 // save continue data 120 let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) 121 LogUtil.info(TAG, 'continueNote content', continueNote) 122 AppStorage.SetOrCreate<string>('ContinueNote', continueNote) 123 LogUtil.info(TAG, 'callbackScheduledSave, set continue note success') 124 }, 125 callbackPasteImage: (html) => { 126 if (html) { 127 LogUtil.info(TAG, 'paste info' + html) 128 let realHtml = "" 129 let base64regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/ 130 if (html && html.indexOf("base64") > 0) { 131 LogUtil.info(TAG, " getSrcFromHtml, src[1] : " + html) 132 let imgData = html.split(',')[1]; 133 let imgType = 'png' 134 if (html.indexOf("jpeg") > 0) { 135 imgType = 'jpg' 136 } else if (html.indexOf("gif") > 0) { 137 imgType = 'gif' 138 } 139 let filePath = "" 140 if (base64regex.test(imgData)) { 141 let base64 = new util.Base64() 142 let decodeArr = base64.decodeSync(imgData) 143 filePath = OperationUtils.saveImageData(decodeArr, imgType) 144 } else { 145 filePath = OperationUtils.saveImage(imgData, imgType) 146 } 147 realHtml = "file://" + filePath 148 } 149 LogUtil.info(TAG, 'paste info11' + realHtml) 150 this.controllerShow.runJavaScript("javascript:RICH_EDITOR.insertImageHtml('" + realHtml + "')") 151 } else { 152 LogUtil.info(TAG, 'paste info22223') 153 } 154 }, 155 callbackGetSize: (fontSize) => { 156 if (fontSize === 16) { 157 this.selectedNoteData.slider_value = 0 158 } else if (fontSize === 18) { 159 this.selectedNoteData.slider_value = 4 160 } else if (fontSize === 24) { 161 this.selectedNoteData.slider_value = 8 162 } else if (fontSize === 32) { 163 this.selectedNoteData.slider_value = 12 164 } else if (fontSize === 48) { 165 this.selectedNoteData.slider_value = 16 166 } 167 } 168 } 169 170 build() { 171 Stack({ alignContent: Alignment.Bottom }) { 172 Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, 173 alignItems: ItemAlign.Start, alignContent: FlexAlign.SpaceAround }) { 174 Column() { 175 ToolBarComp({ controllerShow: this.controllerShow }) 176 }.margin({ left: 24, right: 24 }) 177 178 Column() { 179 NoteContentOverViewComp() 180 181 Web({ src: $rawfile('editor.html'), controller: this.controllerShow }) 182 .javaScriptAccess(true) 183 .javaScriptProxy({ 184 object: this.noteContent, 185 name: "callBackToApp", // html--> name.method 186 methodList: ["callbackhtml", "callbackScheduledSave", "callbackPasteImage", "callbackImagePath", "callbackGetSize"], 187 controller: this.controllerShow 188 }) 189 .onPageEnd((e) => { 190 if (this.dpi <= 240) { 191 this.controllerShow.runJavaScript("changeSizeToRk()") 192 } else if (this.dpi <= 320 && this.dpi > 240) { 193 this.controllerShow.runJavaScript("changeSizeToPhone()") 194 } else { 195 this.controllerShow.runJavaScript("changeSizeToTablet()") 196 } 197 if (AppStorage.Get('breakPoint') !== 'sm') { 198 this.controllerShow.runJavaScript("hiddenButton()") 199 } 200 LogUtil.info(TAG, "finish loadurl") 201 if (this.selectedNoteData) { 202 let self = this 203 this.controllerShow.runJavaScript( 204 "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')", 205 () => { 206 // wait for the image in the note to load 207 setTimeout(function () { 208 self.restoreScrollTop() 209 self.restoreFocus() 210 }, 100) 211 } 212 ) 213 } 214 }) 215 .zoomAccess(false) 216 .imageAccess(true) 217 .onlineImageAccess(true) 218 .fileAccess(true) 219 .domStorageAccess(true) 220 .height('88%') 221 .width('100%') 222 .onScroll((event) => { 223 this.storeScrollTop(event.yOffset) 224 }) 225 .onClick(() => { 226 // 添加定时器:3s自动保存 227 if (timeID) { 228 clearInterval(timeID) 229 } 230 timeID = setInterval(() => { 231 this.controllerShow.runJavaScript("scheduledSaveContent()") 232 }, 3000) 233 LogUtil.info(TAG, "setInterval timeID : " + timeID) 234 this.issave = 0 235 this.editModel = true 236 }) 237 } 238 .margin({ left: 12, right: 24, top: 16 }) 239 } 240 .height(StyleConstants.PERCENTAGE_100) 241 } 242 .height(StyleConstants.PERCENTAGE_100) 243 .width(StyleConstants.PERCENTAGE_100) 244 } 245 246 aboutToAppear(): void { 247 LogUtil.info(TAG, "aboutToAppear") 248 } 249 250 aboutToDisappear(): void { 251 AppStorage.Set("refreshCurrentNote", true) 252 NoteUtil.refreshAll() 253 clearInterval(timeID) 254 LogUtil.info(TAG, "aboutToDisappear") 255 } 256} 257 258@Component 259export struct ToolBarComp { 260 @Consume('SelectedNoteData') selectedNoteData: NoteData 261 @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') 262 @Consume('Issave') issave: number 263 @Consume('EditModel') editModel: boolean 264 controllerShow: WebviewController 265 editContentDialogCtl: CustomDialogController = new CustomDialogController({ 266 builder: EditContentDialog({ confirm: this.confirm.bind(this) }), 267 alignment: DialogAlignment.Bottom, 268 autoCancel: true, 269 customStyle: true, 270 }) 271 272 confirm(excuteJs: string) { 273 this.controllerShow.runJavaScript(excuteJs) 274 } 275 276 build() { 277 Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, 278 justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { 279 Image($r('app.media.narrow')) 280 .height(24) 281 .width(24) 282 .onClick(() => { 283 this.controllerShow.runJavaScript("RICH_EDITOR.setInputEnabled(false)") 284 this.controllerShow.runJavaScript("getHtmlContent()") 285 // 清除定时器 286 if (timeID != undefined) { 287 LogUtil.info(TAG, "zoom, clearInterval timeID : " + timeID) 288 clearInterval(timeID) 289 } 290 AppStorage.Set("refreshCurrentNote", true) 291 router.back() 292 NoteUtil.refreshAll() 293 }) 294 .visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible) 295 296 if (this.editModel == false) { 297 Row({ space: StyleConstants.SPACE_24 }) { 298 Image(this.selectedNoteData.is_favorite == Favorite.Yes ? $r('app.media.favorite') : $r('app.media.favorite_cancel')) 299 .height(24).width(24) 300 .onClick(() => { 301 this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes) 302 // update note to db 303 let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) 304 predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) 305 RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) 306 // save continue data 307 let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) 308 AppStorage.SetOrCreate<string>('ContinueNote', continueNote) 309 LogUtil.info(TAG, 'ToolBarComp, set continue note success') 310 NoteUtil.refreshAll() 311 }) 312 }.width(36) 313 .visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible) 314 } else { 315 Row({ space: StyleConstants.SPACE_6 }) { 316 Button({ type: ButtonType.Normal, stateEffect: true }) { 317 Image($r('app.media.circle_tick1')) 318 .height(24) 319 .width(24) 320 .onClick(() => { 321 // 退出键盘 322 // @ts-ignore 323 inputMethod.getController().stopInputSession(); 324 // 清单 325 this.controllerShow.runJavaScript("javascript:RICH_EDITOR.setTodo()") 326 }) 327 }.width(42) 328 .height(42) 329 .borderRadius(8) 330 .backgroundColor($r('app.color.color_fffffB')) 331 332 Button({ type: ButtonType.Normal, stateEffect: true }) { 333 Image($r('app.media.font_style')) 334 .height(24) 335 .width(24) 336 .onClick(() => { 337 // 退出键盘 338 // @ts-ignore 339 inputMethod.getController().stopInputSession(); 340 LogUtil.info(TAG, 'editContentDialogCtl start') 341 this.editContentDialogCtl.open() 342 }) 343 }.width(42) 344 .height(42) 345 .borderRadius(8) 346 .backgroundColor($r('app.color.color_fffffB')) 347 348 Button({ type: ButtonType.Normal, stateEffect: true }) { 349 Image($r('app.media.picture_white')).height(24).width(24) 350 .onClick(async () => { 351 // 退出键盘 352 // @ts-ignore 353 inputMethod.getController().stopInputSession(); 354 LogUtil.info(TAG, 'startAbility start') 355 await globalThis.noteContext.startAbilityForResult({ 356 parameters: { uri: "singleselect" }, 357 bundleName: "com.ohos.photos", 358 abilityName: "com.ohos.photos.MainAbility", 359 }) 360 .then(v => { 361 let want = v['want']; 362 if (want != null && want != undefined) { 363 let param = want['parameters']; 364 let imageUri = "" 365 if (param != null && param != undefined) { 366 let uri = param['select-item-list']; 367 imageUri = uri[0]; 368 } 369 // 拷贝 370 if (imageUri != null && imageUri != "") { 371 OperationUtils.copy(imageUri).then((uriPath) => { 372 var path = "file://" + uriPath 373 LogUtil.info(TAG, 'image uri is:' + path) 374 this.controllerShow.runJavaScript( 375 "javascript:RICH_EDITOR.insertImage('" + path + "')" 376 ) 377 this.issave = 1 378 // 保存笔记信息到数据库 379 this.controllerShow.runJavaScript("getHtmlContent()") 380 }) 381 } 382 } 383 }); 384 }) 385 }.width(42) 386 .height(42) 387 .borderRadius(8) 388 .backgroundColor($r('app.color.color_fffffB')) 389 390 Button({ type: ButtonType.Normal, stateEffect: true }) { 391 Image($r('app.media.undo')) 392 .height(24) 393 .width(24) 394 .onClick(() => { 395 // 退出键盘 396 // @ts-ignore 397 inputMethod.getController().stopInputSession(); 398 this.controllerShow.runJavaScript("RICH_EDITOR.undo()") 399 }) 400 }.width(42) 401 .height(42) 402 .borderRadius(8) 403 .backgroundColor($r('app.color.color_fffffB')) 404 405 Button({ type: ButtonType.Normal, stateEffect: true }) { 406 Image($r('app.media.todo')) 407 .height(24) 408 .width(24) 409 .onClick(() => { 410 // 退出键盘 411 // @ts-ignore 412 inputMethod.getController().stopInputSession(); 413 this.controllerShow.runJavaScript("RICH_EDITOR.redo()") 414 }) 415 }.width(42) 416 .height(42) 417 .borderRadius(8) 418 .backgroundColor($r('app.color.color_fffffB')) 419 420 421 Button({ type: ButtonType.Normal, stateEffect: true }) { 422 Image($r('app.media.tick_thick')) 423 .height(24) 424 .width(24) 425 .fillColor(this.issave == 0 ? Color.Black : Color.Grey) 426 .onClick(() => { 427 this.issave = 1 428 // 保存笔记信息到数据库 429 this.controllerShow.runJavaScript("getHtmlContent()") 430 }) 431 }.width(42) 432 .height(42) 433 .borderRadius(8) 434 .backgroundColor($r('app.color.color_fffffB')) 435 }.width(274) 436 } 437 } 438 .width(StyleConstants.PERCENTAGE_100) 439 .height(80) 440 } 441} 442 443@Component 444export struct NoteContentOverViewComp { 445 @Consume('SelectedNoteData') selectedNoteData: NoteData 446 @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] 447 @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] 448 @StorageLink('isUpdate') isUpdate: boolean = false 449 editTitleDialogCtl: CustomDialogController = new CustomDialogController({ 450 builder: EditTitleDialog({ confirm: this.confirm.bind(this) }), 451 alignment: DialogAlignment.Center, 452 autoCancel: false, 453 customStyle: true, 454 }) 455 456 confirm(newTitle: string) { 457 this.selectedNoteData.title = newTitle 458 this.selectedNoteData.modified_time = new Date().getTime() 459 let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) 460 predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) 461 RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) 462 // save continue data 463 let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) 464 AppStorage.SetOrCreate<string>('ContinueNote', continueNote) 465 LogUtil.info(TAG, "NoteContentOverViewComp confirm, set continue note success") 466 NoteUtil.refreshAll() 467 } 468 469 @Builder MenuBuilder() { 470 Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { 471 List() { 472 ForEach(this.AllFolderArray, (item) => { 473 ListItem() { 474 NoteDataMoveItemComp({ folderItem: item }) 475 } 476 .onClick(() => { 477 this.selectedNoteData.folder_uuid = item.uuid 478 let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) 479 predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) 480 RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) 481 // save continue data 482 let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) 483 AppStorage.SetOrCreate<string>('ContinueNote', continueNote) 484 LogUtil.info(TAG, "NoteContentOverViewComp MenuBuilder, set continue note success") 485 NoteUtil.refreshAll() 486 }) 487 }, noteItem => JSON.stringify(noteItem)) 488 }.listDirection(Axis.Vertical) 489 .edgeEffect(EdgeEffect.Spring) 490 .height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56) 491 } 492 .width(148) 493 .backgroundColor($r("app.color.color_fffffB")) 494 .padding({ left: 24, right: 24 }) 495 } 496 497 build() { 498 if (this.selectedNoteData) { 499 Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, 500 justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { 501 Row() { 502 Text(this.selectedNoteData.title) 503 .id(this.isUpdate + '') 504 .fontSize(30) 505 .margin({ left: 12, right: 24 }) 506 .onClick(() => { 507 clearInterval(timeID) 508 this.editTitleDialogCtl.open() 509 }) 510 }.height(40) 511 .width(StyleConstants.PERCENTAGE_100) 512 513 Row() { 514 Text(DateUtil.formateDateForNoteContent(new Date(this.selectedNoteData.modified_time))) 515 .id(this.isUpdate + '') 516 .fontSize(12) 517 .padding({ top: 4, bottom: 4 }) 518 .fontColor($r("app.color.modified_time_font_color")) 519 .margin({ left: 12 }) 520 Row() { 521 Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid)) == 522 folderTextMap["sys_def_myFavorites_uuid"] ? folderTextMap["sys_def_unClassified_uuid"] : 523 FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid))) 524 .id(this.isUpdate + '') 525 .fontSize(12) 526 .fontColor($r("app.color.list_modified_time_font_color")) 527 Image($r('app.media.triangle')) 528 .width(6) 529 .height(12) 530 .margin({ left: 4 }) 531 } 532 .padding({ left: 8, right: 8, top: 4, bottom: 4 }) 533 .margin({ left: 8 }) 534 .borderRadius(16) 535 .backgroundColor(NoteUtil.getNoteBgColor(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid, SysDefFolderUuid.AllNotes, false)) 536 .bindMenu(this.MenuBuilder) 537 }.alignItems(VerticalAlign.Top).height(40).width(StyleConstants.PERCENTAGE_100) 538 } 539 .opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1) 540 .width(StyleConstants.PERCENTAGE_100) 541 .height(80) 542 } 543 } 544} 545 546@Component 547struct NoteDataMoveItemComp { 548 @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] 549 @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] 550 private folderItem: FolderData 551 552 build() { 553 Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.Center }) { 554 Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) { 555 Image(FolderUtil.getFolderIcon(this.folderItem.uuid)) 556 .objectFit(ImageFit.Fill) 557 .width(24) 558 .height(24) 559 .flexShrink(0) 560 .fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false)) 561 } 562 .width(24) 563 564 Column() { 565 Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) { 566 Text(FolderUtil.getFolderText(this.folderItem)) 567 .fontSize(16) 568 .fontColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false)) 569 .textAlign(TextAlign.Center) 570 .maxLines(1) 571 .textOverflow({ overflow: TextOverflow.Ellipsis }) 572 .flexShrink(1) 573 } 574 .width('100%') 575 .height(55) 576 577 Divider() 578 .color($r("app.color.divider_color_e4e4e4")) 579 .strokeWidth(1) 580 } 581 .padding({ left: 16 }) 582 } 583 .width('100%') 584 .height(56) 585 .visibility(FolderUtil.isFolderMoveIn(this.folderItem) ? Visibility.Visible : Visibility.None) 586 } 587}