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