Только кнопка текст нормально не ставится, а так в целом норм

This commit is contained in:
Кашин Максим 2023-10-27 19:45:36 +04:00
parent c39dc24599
commit 2b698baef4
3 changed files with 23 additions and 9 deletions

View File

@ -10,12 +10,14 @@ 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
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Button
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.Card
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
@ -30,14 +32,18 @@ import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.scale
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.Role.Companion.Button
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.labwork.R
import com.example.labwork.ui.theme.DarkBluePolitech
import com.example.labwork.ui.theme.LightBluePolitech
@Composable
@ -65,21 +71,28 @@ fun ListProduct(item: ItemProduct) {
.shadow(2.dp)
)
Button(
colors = ButtonDefaults.buttonColors(backgroundColor = LightBluePolitech),
modifier = Modifier
.padding(9.dp)
.padding(start = 9.dp, bottom = 9.dp)
.size(height = 32.dp, width = 95.dp),
onClick = {
isFullAbout = !isFullAbout
},
shape = RoundedCornerShape(15.dp)
) {
Text("Подробнее", fontSize = 10.sp)
Text(
text = "Подробнее",
color = Color.White,
modifier = Modifier.fillMaxSize(),
textAlign = TextAlign.Center,
)
}
}
Column {
Text(text = item.name,
fontSize = if (isFullAbout) 18.sp else 14.sp,
fontWeight = if (isFullAbout) FontWeight.Bold else FontWeight.Normal,
color = DarkBluePolitech,
fontSize = if (isFullAbout) 18.sp else 24.sp,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth().padding(top = 8.dp)
)
@ -90,11 +103,12 @@ fun ListProduct(item: ItemProduct) {
modifier = Modifier.scale(scale)
) {
Text(
color = DarkBluePolitech,
text = item.about,
maxLines = 10,
fontSize = 14.sp,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth().padding(top = 8.dp)
modifier = Modifier.fillMaxWidth().padding(bottom = 8.dp)
)
}
}

View File

@ -10,5 +10,5 @@ val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260)
val LightBluePolitech = Color(0xFF004890)
val DarkBluePolitech = Color(0xFF0D2D4F)
val LightBluePolitech = Color(0xFF0158AF)
val DarkBluePolitech = Color(0xFF123E6D)

View File

@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Thu Oct 26 18:54:01 GMT+04:00 2023
sdk.dir=C\:\\android-sdk
#Fri Oct 27 18:44:58 GMT+04:00 2023
sdk.dir=C\:\\Users\\kashi\\AppData\\Local\\Android\\Sdk