diff --git a/entry/src/main/ets/pages/MainPage.ets b/entry/src/main/ets/pages/MainPage.ets index b493c50e3baa1251cd56dbcf5521cbdfd149e37a..0195d7acbf67ae3f924e71e9e5b3a3cb09f2813f 100644 --- a/entry/src/main/ets/pages/MainPage.ets +++ b/entry/src/main/ets/pages/MainPage.ets @@ -21,17 +21,17 @@ import { TextInputComponent } from '../view/TextInputComponent'; @Entry @Component struct MainPage { - @State bottomPadding: number = Constants.MAIN_PAGE_INITIAL_PADDING; + @State bottomPadding: number = 210; aboutToAppear(): void { let event: emitter.InnerEvent = { - eventId: Constants.AVOID_EVENT_ID + eventId: 1 } emitter.on(event, (eventData: emitter.EventData) => { if (eventData.data) { let avoidHeight: number = eventData.data['avoidHeight']; if (avoidHeight === 0) { - this.bottomPadding = Constants.MAIN_PAGE_INITIAL_PADDING; + this.bottomPadding = 210; } else { this.bottomPadding = avoidHeight; } @@ -46,7 +46,7 @@ struct MainPage { Image($r('app.media.arkui_background')) .height($r('app.float.main_page_image_height')) .width('100%') - .borderRadius(Constants.IMAGE_BORDER) + .borderRadius(12) .padding({ left: $r('app.float.main_page_margin'), right: $r('app.float.main_page_margin') }) TextInputComponent() diff --git a/entry/src/main/ets/view/CustomKeyboard.ets b/entry/src/main/ets/view/CustomKeyboard.ets index db0d18ea9b3d7109c9da24c700c02acfa5f7895a..217f57ee5e9bcbd3e36148831ab717277763f5f2 100644 --- a/entry/src/main/ets/view/CustomKeyboard.ets +++ b/entry/src/main/ets/view/CustomKeyboard.ets @@ -18,12 +18,12 @@ import { KeyboardController } from '../model/KeyboardController'; import { EnglishKeyboard } from './EnglishKeyboard'; import { NumberKeyboard } from './NumberKeyboard'; -// [Start CustomKeyboard_start] +// [Start customKeyboard_start1] // [Start avoidHeight_start] @Component export struct CustomKeyboard { // [StartExclude avoidHeight_start] - // [StartExclude CustomKeyboard_start] + // [StartExclude customKeyboard_start1] @Consume isCustomKeyboardAttach: boolean; @Consume inputText: string; @Consume keyBoardController: KeyboardController; @@ -31,11 +31,11 @@ export struct CustomKeyboard { @Consume customKeyboardHeight: number; @Consume bottomRectHeight: number; // [EndExclude avoidHeight_start] - // [EndExclude CustomKeyboard_start] + // [EndExclude customKeyboard_start1] build() { Column() { // [StartExclude avoidHeight_start] - // [StartExclude CustomKeyboard_start] + // [StartExclude customKeyboard_start1] NumberKeyboard() .visibility(this.keyBoardController.keyBoardType === Constants.NUMBER_KEYBOARD ? Visibility.Visible : Visibility.None) @@ -45,10 +45,10 @@ export struct CustomKeyboard { .visibility(this.keyBoardController.keyBoardType === Constants.ENGLISH_KEYBOARD ? Visibility.Visible : Visibility.None) .margin({ top: $r('app.float.keyboard_margin_top') }) - // [EndExclude CustomKeyboard_start] + // [EndExclude customKeyboard_start1] // [EndExclude avoidHeight_start] } - // [StartExclude CustomKeyboard_start] + // [StartExclude customKeyboard_start1] .onAreaChange((oldValue: Area, newValue: Area) => { this.customKeyboardHeight = Number(newValue.height); let avoidHeight: number = (this.isCustomKeyboardAttach ? this.customKeyboardHeight : this.systemKeyboardHeight) @@ -57,15 +57,15 @@ export struct CustomKeyboard { }) // [StartExclude avoidHeight_start] .padding({ left: $r('app.float.keyboard_padding'), right: $r('app.float.keyboard_padding') }) - // [EndExclude CustomKeyboard_start] + // [EndExclude customKeyboard_start1] .height($r('app.float.keyboard_total_height')) - // [StartExclude CustomKeyboard_start] + // [StartExclude customKeyboard_start1] .width('100%') .backgroundColor($r('app.color.keyboard_background_color')) - // [EndExclude CustomKeyboard_start] + // [EndExclude customKeyboard_start1] // [EndExclude avoidHeight_start] } } -// [End CustomKeyboard_start] +// [End customKeyboard_start1] // [End avoidHeight_start] diff --git a/entry/src/main/ets/view/TextInputComponent.ets b/entry/src/main/ets/view/TextInputComponent.ets index e67d748d9bc5c471f88798034cb31ec3822fc0eb..88877c90f693b20ec29d61a3f2ca66c585565897 100644 --- a/entry/src/main/ets/view/TextInputComponent.ets +++ b/entry/src/main/ets/view/TextInputComponent.ets @@ -54,7 +54,7 @@ export struct TextInputComponent { // [Start TextInput_start] // [Start switchover_start] TextInput({ - placeholder: $r('app.string.textInput_placeholder_custom'), + placeholder: 'Bind Custom Keyboard', text: this.inputText, controller: this.textInputController })