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 16@Entry 17@Component 18struct Index { 19 build() { 20 Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { 21 Text('hello world') 22 .fontSize(50) 23 .fontWeight(FontWeight.Bold) 24 25 Button() { 26 Text('button1') 27 .fontSize(25) 28 .fontWeight(FontWeight.Bold) 29 }.type(ButtonType.Capsule) 30 .margin({ 31 top: 20 32 }) 33 .backgroundColor('#0D9FFB') 34 .onClick(() => { 35 console.log("WindowExtensionAbility, button1:"); 36 }) 37 38 TextInput() { 39 40 }.type(InputType.Number) 41 .margin({ 42 top: 20 43 }) 44 .backgroundColor('#0D9FFC') 45 46 47 Button() { 48 Text('button2') 49 .fontSize(25) 50 .fontWeight(FontWeight.Bold) 51 }.type(ButtonType.Capsule) 52 .margin({ 53 top: 20 54 }) 55 .backgroundColor('#0D9FFB') 56 .onClick(() => { 57 console.log("WindowExtensionAbility, button2:"); 58 }) 59 60 Button() { 61 Text('button3') 62 .fontSize(25) 63 .fontWeight(FontWeight.Bold) 64 }.type(ButtonType.Capsule) 65 .margin({ 66 top: 20 67 }) 68 .backgroundColor('#0D9FFB') 69 .onClick(() => { 70 console.log("WindowExtensionAbility, button3:"); 71 }) 72 } 73 .width('100%') 74 .height('100%') 75 .backgroundColor(1234) 76 } 77}