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 16import EnvironmentProp from '../../../feature/EnvironmentProp'; 17 18@Component 19export struct ImageItemLeft { 20 private mImage: Resource; 21 private moreFlag?: Boolean = false; 22 @LocalStorageProp('breakpoint') curBp: string = 'sm'; 23 24 build() { 25 Column() { 26 Image(this.mImage) 27 .objectFit(ImageFit.Contain) 28 .height($r("app.float.id_card_image_small")) 29 .width($r("app.float.id_card_image_small")) 30 .margin({ left: this.curBp === 'lg' ? $r("app.float.id_card_margin_max") : $r("app.float.id_card_margin_xl") }) 31 .fillColor(this.moreFlag 32 ? $r("sys.color.ohos_id_color_connected") 33 : $r("sys.color.ohos_id_color_secondary")) 34 } 35 .height($r("app.float.id_item_height_large")) 36 .alignItems(HorizontalAlign.Start) 37 .justifyContent(FlexAlign.Center) 38 .flexShrink(0) 39 } 40}