From 4cdd07220acf65ee3ed951ea3cfd200e8e2ffc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D1=88=D0=B8=D0=BD=20=D0=9C=D0=B0=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BC?= Date: Sat, 28 Oct 2023 01:09:25 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=BA?= =?UTF-8?q?=D1=80=D0=B0=D1=81=D0=B8=D0=B2=D1=83=D1=8E=20=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=BC=D0=B0=D1=86=D0=B8=D1=8E=20=D0=B1=D1=83=D0=BA=D0=BE=D0=B2?= =?UTF-8?q?=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/labwork/pages/ListProduct.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/example/labwork/pages/ListProduct.kt b/app/src/main/java/com/example/labwork/pages/ListProduct.kt index 2421bca..2c77304 100644 --- a/app/src/main/java/com/example/labwork/pages/ListProduct.kt +++ b/app/src/main/java/com/example/labwork/pages/ListProduct.kt @@ -1,6 +1,7 @@ package com.example.labwork.pages import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.core.animateDpAsState import androidx.compose.animation.core.animateFloatAsState import androidx.compose.animation.expandIn import androidx.compose.animation.fadeIn @@ -10,7 +11,6 @@ import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size @@ -20,9 +20,9 @@ import androidx.compose.material.ButtonDefaults import androidx.compose.material.Card import androidx.compose.material.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.remember import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -43,6 +43,7 @@ import com.example.labwork.ui.theme.LightBluePolitech fun ListProduct(item: ItemProduct) { var isFullAbout by remember { mutableStateOf(false) } val scale by animateFloatAsState(if (isFullAbout) 1f else 0f) + val textSize by animateDpAsState(if (isFullAbout) 18.dp else 24.dp) Card( modifier = Modifier @@ -76,15 +77,16 @@ fun ListProduct(item: ItemProduct) { Text( text = "Подробнее", color = Color.White, - modifier = Modifier.fillMaxSize(), + fontSize = 10.sp, textAlign = TextAlign.Center, ) } } Column { - Text(text = item.name, + Text( + text = item.name, color = Color.Black, - fontSize = if (isFullAbout) 18.sp else 24.sp, + fontSize = textSize.value.sp, fontWeight = FontWeight.Bold, textAlign = TextAlign.Center, modifier = Modifier.fillMaxWidth().padding(top = 8.dp) @@ -108,4 +110,4 @@ fun ListProduct(item: ItemProduct) { } } } -} \ No newline at end of file +}