From c26732895f937f5602244016f2a0af7c512a24ae Mon Sep 17 00:00:00 2001 From: honoka5 Date: Tue, 20 Aug 2024 05:28:17 +0900 Subject: [PATCH 1/6] =?UTF-8?q?Columm=E3=82=92LazyColumn=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../droidkaigi/confsched/favorites/section/FavoriteSheet.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt index 3fabc9006..d8ad8ad2d 100644 --- a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt +++ b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt @@ -39,6 +39,7 @@ import kotlinx.collections.immutable.persistentListOf import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview + const val FavoritesScreenEmptyViewTestTag = "FavoritesScreenEmptyViewTestTag" sealed interface FavoritesSheetUiState { @@ -103,7 +104,7 @@ fun FavoriteSheet( @Composable private fun EmptyView(modifier: Modifier = Modifier) { - Column( + LazyColumm( modifier = modifier.testTag(FavoritesScreenEmptyViewTestTag).fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, From df4da1238f41505c7227f2300e2d3c29bac4b556 Mon Sep 17 00:00:00 2001 From: honoka5 Date: Wed, 21 Aug 2024 04:10:49 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Columm=E3=82=92LazyColumn=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../droidkaigi/confsched/favorites/section/FavoriteSheet.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt index d8ad8ad2d..f94f8f952 100644 --- a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt +++ b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt @@ -104,7 +104,7 @@ fun FavoriteSheet( @Composable private fun EmptyView(modifier: Modifier = Modifier) { - LazyColumm( + LazyColumn( modifier = modifier.testTag(FavoritesScreenEmptyViewTestTag).fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, From 80ca72fe7ec243d371db4c58adf7685f337c16bc Mon Sep 17 00:00:00 2001 From: honoka5 Date: Wed, 21 Aug 2024 05:48:17 +0900 Subject: [PATCH 3/6] Corrected the error.Added item. --- .../favorites/section/FavoriteSheet.kt | 69 +++++++++++-------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt index f94f8f952..344d22bdd 100644 --- a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt +++ b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size +import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Favorite @@ -105,40 +106,52 @@ fun FavoriteSheet( @Composable private fun EmptyView(modifier: Modifier = Modifier) { LazyColumn( - modifier = modifier.testTag(FavoritesScreenEmptyViewTestTag).fillMaxSize(), + modifier = modifier + .testTag(FavoritesScreenEmptyViewTestTag) + .fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, ) { - Box( - modifier = Modifier - .background( - color = MaterialTheme.colorScheme.onPrimary, - shape = RoundedCornerShape(24.dp), + item { + Box( + modifier = Modifier + .background( + color = MaterialTheme.colorScheme.onPrimary, + shape = RoundedCornerShape(24.dp), + ) + .size(84.dp), + contentAlignment = Alignment.Center, + ) { + Icon( + modifier = Modifier.size(36.dp), + imageVector = Icons.Filled.Favorite, + contentDescription = null, + tint = Color.Green, ) - .size(84.dp), - contentAlignment = Alignment.Center, - ) { - Icon( - modifier = Modifier.size(36.dp), - imageVector = Icons.Filled.Favorite, - contentDescription = null, - tint = Color.Green, + } + } + item { + Spacer(Modifier.height(12.dp)) + } + item { + Text( + text = stringResource(FavoritesRes.string.empty_description), + style = MaterialTheme.typography.titleLarge, + color = MaterialTheme.colorScheme.onSurface, + textAlign = TextAlign.Center, + ) + } + item { + Spacer(Modifier.height(6.dp)) + } + item { + Text( + text = stringResource(FavoritesRes.string.empty_guide), + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onSurfaceVariant, + textAlign = TextAlign.Center, ) } - Spacer(Modifier.height(12.dp)) - Text( - text = stringResource(FavoritesRes.string.empty_description), - style = MaterialTheme.typography.titleLarge, - color = MaterialTheme.colorScheme.onSurface, - textAlign = TextAlign.Center, - ) - Spacer(Modifier.height(6.dp)) - Text( - text = stringResource(FavoritesRes.string.empty_guide), - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant, - textAlign = TextAlign.Center, - ) } } From 599bd9031366a4bf58956cc9063f7c50bb213cb1 Mon Sep 17 00:00:00 2001 From: honoka5 Date: Thu, 22 Aug 2024 04:53:06 +0900 Subject: [PATCH 4/6] =?UTF-8?q?LazyColumn=E3=82=92Column=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=97=E3=81=A6.veticalScroll=E3=82=92=E4=BD=BF?= =?UTF-8?q?=E3=81=84=E3=81=BE=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../favorites/section/FavoriteSheet.kt | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt index 344d22bdd..d0d7766c9 100644 --- a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt +++ b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt @@ -10,7 +10,9 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Favorite import androidx.compose.material3.Icon @@ -105,14 +107,14 @@ fun FavoriteSheet( @Composable private fun EmptyView(modifier: Modifier = Modifier) { - LazyColumn( + Column( modifier = modifier .testTag(FavoritesScreenEmptyViewTestTag) - .fillMaxSize(), + .fillMaxSize() + .verticalScroll(rememberScrollState()), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, ) { - item { Box( modifier = Modifier .background( @@ -129,22 +131,15 @@ private fun EmptyView(modifier: Modifier = Modifier) { tint = Color.Green, ) } - } - item { Spacer(Modifier.height(12.dp)) } - item { Text( text = stringResource(FavoritesRes.string.empty_description), style = MaterialTheme.typography.titleLarge, color = MaterialTheme.colorScheme.onSurface, textAlign = TextAlign.Center, ) - } - item { Spacer(Modifier.height(6.dp)) - } - item { Text( text = stringResource(FavoritesRes.string.empty_guide), style = MaterialTheme.typography.bodyMedium, @@ -152,8 +147,6 @@ private fun EmptyView(modifier: Modifier = Modifier) { textAlign = TextAlign.Center, ) } - } -} @Composable @Preview From 98d8d3bdd89953d38bdeeea6a1c4ea57383b380a Mon Sep 17 00:00:00 2001 From: honoka5 Date: Sat, 24 Aug 2024 08:52:53 +0900 Subject: [PATCH 5/6] =?UTF-8?q?}=E3=81=AE=E4=BD=8D=E7=BD=AE=E3=82=92?= =?UTF-8?q?=E5=85=83=E3=81=AB=E6=88=BB=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../favorites/section/FavoriteSheet.kt | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt index e5dbc10a3..b880f0043 100644 --- a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt +++ b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt @@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size -import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll @@ -45,7 +44,6 @@ import kotlinx.collections.immutable.persistentMapOf import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview - const val FavoritesScreenEmptyViewTestTag = "FavoritesScreenEmptyViewTestTag" sealed interface FavoritesSheetUiState { @@ -124,17 +122,15 @@ private fun EmptyView(modifier: Modifier = Modifier) { .testTag(FavoritesScreenEmptyViewTestTag) .fillMaxSize() .verticalScroll(rememberScrollState()), - horizontalAlignment = Alignment.CenterHorizontally, - verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center, ) { Box( modifier = Modifier - .background( - color = MaterialTheme.colorScheme.onPrimary, - shape = RoundedCornerShape(24.dp), - ) + .background(color = MaterialTheme.colorScheme.onPrimary, + shape = RoundedCornerShape(24.dp),) .size(84.dp), - contentAlignment = Alignment.Center, + contentAlignment = Alignment.Center, ) { Icon( modifier = Modifier.size(36.dp), @@ -144,21 +140,21 @@ private fun EmptyView(modifier: Modifier = Modifier) { ) } Spacer(Modifier.height(12.dp)) - } - Text( - text = stringResource(FavoritesRes.string.empty_description), - style = MaterialTheme.typography.titleLarge, - color = MaterialTheme.colorScheme.onSurface, - textAlign = TextAlign.Center, + Text( + text = stringResource(FavoritesRes.string.empty_description), + style = MaterialTheme.typography.titleLarge, + color = MaterialTheme.colorScheme.onSurface, + textAlign = TextAlign.Center, ) Spacer(Modifier.height(6.dp)) - Text( - text = stringResource(FavoritesRes.string.empty_guide), - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant, - textAlign = TextAlign.Center, + Text( + text = stringResource(FavoritesRes.string.empty_guide), + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onSurfaceVariant, + textAlign = TextAlign.Center, ) } + } @Composable @Preview From a298a12ea48c22da233fd8f2c2f66bd9fad07e7c Mon Sep 17 00:00:00 2001 From: honoka5 Date: Mon, 26 Aug 2024 09:10:51 +0900 Subject: [PATCH 6/6] =?UTF-8?q?./gradlew=20detekt=20--auto-correct?= =?UTF-8?q?=E5=AE=9F=E8=A1=8C=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../favorites/section/FavoriteSheet.kt | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt index b880f0043..2b4fd4fa7 100644 --- a/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt +++ b/feature/favorites/src/commonMain/kotlin/io/github/droidkaigi/confsched/favorites/section/FavoriteSheet.kt @@ -122,39 +122,41 @@ private fun EmptyView(modifier: Modifier = Modifier) { .testTag(FavoritesScreenEmptyViewTestTag) .fillMaxSize() .verticalScroll(rememberScrollState()), - horizontalAlignment = Alignment.CenterHorizontally, - verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center, ) { - Box( - modifier = Modifier - .background(color = MaterialTheme.colorScheme.onPrimary, - shape = RoundedCornerShape(24.dp),) - .size(84.dp), - contentAlignment = Alignment.Center, - ) { - Icon( - modifier = Modifier.size(36.dp), - imageVector = Icons.Filled.Favorite, - contentDescription = null, - tint = Color.Green, + Box( + modifier = Modifier + .background( + color = MaterialTheme.colorScheme.onPrimary, + shape = RoundedCornerShape(24.dp), ) - } - Spacer(Modifier.height(12.dp)) - Text( - text = stringResource(FavoritesRes.string.empty_description), - style = MaterialTheme.typography.titleLarge, - color = MaterialTheme.colorScheme.onSurface, - textAlign = TextAlign.Center, - ) - Spacer(Modifier.height(6.dp)) - Text( - text = stringResource(FavoritesRes.string.empty_guide), - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant, - textAlign = TextAlign.Center, + .size(84.dp), + contentAlignment = Alignment.Center, + ) { + Icon( + modifier = Modifier.size(36.dp), + imageVector = Icons.Filled.Favorite, + contentDescription = null, + tint = Color.Green, ) } + Spacer(Modifier.height(12.dp)) + Text( + text = stringResource(FavoritesRes.string.empty_description), + style = MaterialTheme.typography.titleLarge, + color = MaterialTheme.colorScheme.onSurface, + textAlign = TextAlign.Center, + ) + Spacer(Modifier.height(6.dp)) + Text( + text = stringResource(FavoritesRes.string.empty_guide), + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onSurfaceVariant, + textAlign = TextAlign.Center, + ) } +} @Composable @Preview