From fb051ccbf28e67df1f826ba3b5384cd8691f625a Mon Sep 17 00:00:00 2001 From: chixel Date: Tue, 11 Oct 2022 14:47:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/view/RenameDialog.ets | 85 ++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 entry/src/main/ets/view/RenameDialog.ets diff --git a/entry/src/main/ets/view/RenameDialog.ets b/entry/src/main/ets/view/RenameDialog.ets new file mode 100644 index 0000000..6fe659f --- /dev/null +++ b/entry/src/main/ets/view/RenameDialog.ets @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import prompt from '@ohos.prompt' + +//@Entry +@CustomDialog +export struct RenameDialog { + private controller: CustomDialogController + //private action: (title: string) => void + //private title: string = '' + + + aboutToAppear() + { + console.log( `RenameDialog aboutToAppear `) + } + + build() { + Column() { + Text($r('app.string.rename_file')) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + //TextInput({ placeholder: 'input new name', text: this.title }) + TextInput({ placeholder: 'input new name' }) + .type(InputType.Normal) + .placeholderColor(Color.Gray) + .maxLength(100) + .height(100) + .fontSize(19) + .margin({ left: 10, top: 15 }) + .onChange((value: string) => { + //this.title = value + }) +// Row() { +// Button() { +// Text($r('app.string.yes')) +// .fontColor(Color.Red) +// .fontSize(17) +// } +// .layoutWeight(7) +// .backgroundColor(Color.White) +// .margin(5) +// .onClick(() => { +// if (this.title === '') { +// prompt.showToast({ message: 'please input the file name', duration: 1000 }) +// return +// } +// //this.action(this.title) +// }) +// +// Divider() +// .height(30) +// .vertical(true) +// .strokeWidth(1) +// .color('#8F8F8F') +// Button() { +// Text($r('app.string.cancel')) +// .fontColor(Color.Blue) +// .fontSize(17) +// } +// .layoutWeight(7) +// .backgroundColor(Color.White) +// .margin(5) +// .onClick(() => { +// this.controller.close() +// }) +// } +// .width('80%') +// .margin({ top: '3%' }) + }.padding(15) + } +} \ No newline at end of file -- Gitee