1/* 2 * Copyright (c) 2025 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 { 17 Entry, 18 Component, 19 State, 20 Column, 21 Button, 22 Text, 23 Row, 24 TextAttribute, 25 ColumnAttribute, 26 AnimatableExtend, 27 $$, 28 ImageFit, 29} from '@kit.ArkUI'; 30 31import { Slider } from '@kit.ArkUI'; 32 33@Entry 34@Component 35struct Test { 36 @State num: number = 0.0 37 @State a: MyClassA = new MyClassA() 38 39 build() { 40 Column() { 41 Button('按钮') 42 .backgroundColor('#ffffff') 43 Circle() { 44 45 } 46 47 MyComponent1() { 48 49 } 50 51 Text("Test") 52 }.width("100%") 53 } 54} 55 56enum Color { 57 Green 58} 59 60function Circle() { 61 62} 63 64@Component 65struct MyComponent1 { 66 @State count: number = 0.0; 67 68 build() { 69 Row() { 70 Slider(){} 71 } 72 } 73} 74 75function cardStyle(this: TextAttribute): this { 76 this.backgroundColor(Color.Green); 77 return this; 78} 79 80@AnimatableExtend 81function animatableWidth(this: ColumnAttribute, width: number): this { 82 this.width(width); 83 return this; 84} 85 86@Component 87struct MyComponent2 { 88 @State value: number = 0.0; 89 90 build() { 91 Row() { 92 Slider({ 93 value: $$(this.value) 94 }) 95 } 96 } 97} 98 99class MyClassA {} 100 101function processImageFit(imageFit: ImageFit): void { 102} 103 104function Calendar() { 105 106}