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, DeleteDialog, 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 prompt from '@system.prompt' 33import featureAbility from '@ohos.ability.featureAbility' 34import { LogUtil } from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' 35import OperationUtils from '@ohos/utils/src/main/ets/default/baseUtil/OperationUtils' 36import mediaquery from '@ohos.mediaquery' 37import router from '@system.router'; 38import inputMethod from '@ohos.inputMethod'; 39import { folderTextMap } from '@ohos/utils/src/main/ets/default/model/NoteBaseData' 40 41const TAG = "NoteContent" 42 43var timeID: number 44 45@Component 46export struct NoteContent { 47 @Provide('SelectedNoteData') selectedNoteData: NoteData = AppStorage.Get('NewNote') 48 @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') 49 @Provide('Issave') issave: number = 0 50 @Provide('EditModel') editModel: boolean = false 51 @StorageLink('dpi') dpi: number = 240 52 controllerShow: WebController 53 private editContentFlag = false 54 @StorageLink('ScrollTopPercent') scrollTopPercent: number = 0.0 55 56 storeScrollTop(scrollTop: number) { 57 if (scrollTop < 0) { 58 return 59 } 60 } 61 62 restoreScrollTop() { 63 if (!AppStorage.Has('remoteScrollTopPercent')) { 64 return 65 } 66 var scrollTopPercent = AppStorage.Get<number>('remoteScrollTopPercent') 67 if (scrollTopPercent < 0) { 68 return 69 } 70 AppStorage.Delete('remoteScrollTopPercent') 71 } 72 73 restoreFocus() { 74 if (!AppStorage.Has('isRemoteFocusOnSearch')) { 75 return 76 } 77 let isRemoteFocusOnSearch = AppStorage.Get<boolean>('isRemoteFocusOnSearch') 78 if (isRemoteFocusOnSearch) { 79 focusControl.requestFocus('searchInput') 80 } 81 AppStorage.Delete('isRemoteFocusOnSearch') 82 } 83 84 noteContent = { 85 callbackhtml: (html) => { 86 LogUtil.info(TAG, 'note uuid is:' + this.selectedNoteData.uuid) 87 this.selectedNoteData.content_text = html 88 this.selectedNoteData.modified_time = new Date().getTime() 89 let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) 90 predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) 91 RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) 92 LogUtil.info(TAG, 'update note success:' + this.selectedNoteData.uuid) 93 AppStorage.SetOrCreate<NoteData>('NewNote', this.selectedNoteData) 94 AppStorage.SetOrCreate<boolean>('needRefresh', true) 95 // save continue data 96 let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) 97 AppStorage.SetOrCreate<string>('ContinueNote', continueNote) 98 LogUtil.info(TAG, "callbackhtml, set continue note success") 99 }, 100 callbackImagePath: (imgName) => { 101 // updata note image 102 LogUtil.info(TAG, 'note imgPath is:' + imgName) 103 this.selectedNoteData.content_img = imgName 104 }, 105 106 callbackScheduledSave: (html) => { 107 LogUtil.info(TAG, 'callbackScheduledSave') 108 if (this.selectedNoteData.content_text == html) { 109 LogUtil.info(TAG, 'callbackScheduledSave the same value return') 110 return; 111 } 112 this.selectedNoteData.content_text = html 113 this.selectedNoteData.modified_time = new Date().getTime() 114 let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) 115 predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) 116 RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) 117 LogUtil.info(TAG, 'callbackScheduledSave, update note success:' + this.selectedNoteData.uuid) 118 // save continue data 119 let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) 120 LogUtil.info(TAG, 'continueNote content', continueNote) 121 AppStorage.SetOrCreate<string>('ContinueNote', continueNote) 122 LogUtil.info(TAG, 'callbackScheduledSave, set continue note success') 123 }, 124 callbackPasteImage: (html) => { 125 if (html) { 126 LogUtil.info(TAG, 'paste info' + html) 127 let realHtml = "" 128 let base64regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/ 129 if (html && html.indexOf("base64") > 0) { 130 LogUtil.info(TAG, " getSrcFromHtml, src[1] : " + html) 131 let imgData = html.split(',')[1]; 132 let imgType = 'png' 133 if (html.indexOf("jpeg") > 0) { 134 imgType = 'jpg' 135 } else if (html.indexOf("gif") > 0) { 136 imgType = 'gif' 137 } 138 let filePath = "" 139 if (base64regex.test(imgData)) { 140 let base64 = new util.Base64() 141 let decodeArr = base64.decodeSync(imgData) 142 filePath = OperationUtils.saveImageData(decodeArr, imgType) 143 } else { 144 filePath = OperationUtils.saveImage(imgData, imgType) 145 } 146 realHtml = "file://" + filePath 147 } 148 LogUtil.info(TAG, 'paste info11' + realHtml) 149 this.controllerShow.runJavaScript({ script: "javascript:RICH_EDITOR.insertImageHtml('" + realHtml + "')" }) 150 } else { 151 LogUtil.info(TAG, 'paste info22223') 152 } 153 }, 154 callbackGetSize: (fontSize) => { 155 if (fontSize === 16) { 156 this.selectedNoteData.slider_value = 0 157 } else if (fontSize === 18) { 158 this.selectedNoteData.slider_value = 4 159 } else if (fontSize === 24) { 160 this.selectedNoteData.slider_value = 8 161 } else if (fontSize === 32) { 162 this.selectedNoteData.slider_value = 12 163 } else if (fontSize === 48) { 164 this.selectedNoteData.slider_value = 16 165 } 166 } 167 } 168 169 build() { 170 Stack({ alignContent: Alignment.Bottom }) { 171 Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, 172 alignItems: ItemAlign.Start, alignContent: FlexAlign.SpaceAround }) { 173 Column() { 174 ToolBarComp({ controllerShow: this.controllerShow }) 175 }.margin({ left: 24, right: 24 }) 176 177 Column() { 178 NoteContentOverViewComp() 179 180 Web({ src: $rawfile('editor.html'), controller: this.controllerShow }) 181 .javaScriptAccess(true) 182 .javaScriptProxy({ 183 object: this.noteContent, 184 name: "callBackToApp", // html--> name.method 185 methodList: ["callbackhtml", "callbackScheduledSave", "callbackPasteImage", "callbackImagePath", "callbackGetSize"], 186 controller: this.controllerShow 187 }) 188 .onPageEnd((e) => { 189 if (this.dpi <= 240) { 190 this.controllerShow.runJavaScript({ script: "changeSizeToRk()" }) 191 } else if (this.dpi <= 320 && this.dpi > 240) { 192 this.controllerShow.runJavaScript({ script: "changeSizeToPhone()" }) 193 } else { 194 this.controllerShow.runJavaScript({ script: "changeSizeToTablet()" }) 195 } 196 if (AppStorage.Get('breakPoint') !== 'sm') { 197 this.controllerShow.runJavaScript({ script: "hiddenButton()" }) 198 } 199 LogUtil.info(TAG, "finish loadurl") 200 if (this.selectedNoteData) { 201 let self = this 202 this.controllerShow.runJavaScript({ 203 script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')", 204 callback: () => { 205 // wait for the image in the note to load 206 setTimeout(function () { 207 self.restoreScrollTop() 208 self.restoreFocus() 209 }, 100) 210 } 211 }) 212 } 213 }) 214 .zoomAccess(false) 215 .imageAccess(true) 216 .onlineImageAccess(true) 217 .fileAccess(true) 218 .domStorageAccess(true) 219 .height('70%') 220 .width('100%') 221 .onScroll((event) => { 222 this.storeScrollTop(event.yOffset) 223 }) 224 .onClick(() => { 225 // 添加定时器:3s自动保存 226 if (timeID) { 227 clearInterval(timeID) 228 } 229 timeID = setInterval(() => { 230 this.controllerShow.runJavaScript({ script: "scheduledSaveContent()" }) 231 }, 3000) 232 LogUtil.info(TAG, "setInterval timeID : " + timeID) 233 this.issave = 0 234 this.editModel = true 235 }) 236 } 237 .margin({ left: 12, right: 24, top: 16 }) 238 .width(StyleConstants.PERCENTAGE_100) 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: WebController 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({ script: 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({ script: "RICH_EDITOR.setInputEnabled(false)" }) 284 this.controllerShow.runJavaScript({ script: "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({ script: "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; 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 script: "javascript:RICH_EDITOR.insertImage('" + path + "')" 376 }) 377 this.issave = 1 378 // 保存笔记信息到数据库 379 this.controllerShow.runJavaScript({ script: "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({ script: "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({ script: "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({ script: "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}