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