From 82fbccc4348760f5c9505399e994df8c464fda31 Mon Sep 17 00:00:00 2001 From: acclorite Date: Sat, 27 Apr 2024 17:44:48 +0300 Subject: [PATCH] Added Author icon to the left of the Book's Author in BookInfoScreen. (v1.0.0) --- .../components/BookInfoInfoSection.kt | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoInfoSection.kt b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoInfoSection.kt index b2495a7f..3b5193ae 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoInfoSection.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/screens/book_info/components/BookInfoInfoSection.kt @@ -14,12 +14,14 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.text.BasicTextField import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Image +import androidx.compose.material.icons.outlined.Person import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -143,17 +145,28 @@ fun BookInfoInfoSection( } } Spacer(modifier = Modifier.height(4.dp)) - SelectionContainer { - Text( - state.value.book.author.asString(), - color = MaterialTheme.colorScheme.onSurfaceVariant, - style = MaterialTheme.typography.bodyLarge, - modifier = Modifier - .fillMaxWidth(), - maxLines = 2, - overflow = TextOverflow.Ellipsis + + Row(verticalAlignment = Alignment.CenterVertically) { + Icon( + imageVector = Icons.Outlined.Person, + contentDescription = stringResource(id = R.string.author), + modifier = Modifier.size(18.dp), + tint = MaterialTheme.colorScheme.onSurfaceVariant ) + Spacer(modifier = Modifier.width(4.dp)) + SelectionContainer { + Text( + state.value.book.author.asString(), + color = MaterialTheme.colorScheme.onSurfaceVariant, + style = MaterialTheme.typography.bodyLarge, + modifier = Modifier + .fillMaxWidth(), + maxLines = 1, + overflow = TextOverflow.Ellipsis + ) + } } + } } } \ No newline at end of file