1 /* <lambda>null2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.avatarpicker.ui.info 18 19 import androidx.compose.foundation.Image 20 import androidx.compose.foundation.layout.padding 21 import androidx.compose.foundation.layout.size 22 import androidx.compose.material3.MaterialTheme 23 import androidx.compose.material3.Text 24 import androidx.compose.runtime.Composable 25 import androidx.compose.ui.Modifier 26 import androidx.compose.ui.graphics.ColorFilter 27 import androidx.compose.ui.res.painterResource 28 import androidx.compose.ui.res.stringResource 29 import androidx.compose.ui.unit.dp 30 31 @Composable 32 fun InfoCard(model: InfoViewModel) { 33 Image( 34 painter = painterResource(id = model.icon), 35 contentDescription = null, 36 colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.primary), 37 modifier = Modifier.size(48.dp) 38 ) 39 Text( 40 modifier = Modifier.padding(top = 24.dp), 41 text = stringResource(id = model.titleId), 42 style = MaterialTheme.typography.displayMedium, 43 ) 44 (model.description).value?.let { desc -> 45 Text( 46 modifier = Modifier.padding(top = 24.dp), 47 text = desc, 48 style = MaterialTheme.typography.bodyLarge, 49 ) 50 } 51 }