From d62447dc0cae240d4a03491e902df911e9ffc29a Mon Sep 17 00:00:00 2001 From: easyhz Date: Thu, 26 Sep 2024 14:13:29 +0900 Subject: [PATCH] =?UTF-8?q?:wrench:=20fix:=20=EC=95=A0=EB=8B=88=EB=A9=94?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=88=98=EC=A0=95=20(#18)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classroom/ClassroomNavigation.kt | 2 +- .../classroom/view/ClassroomScreen.kt | 27 +++++++++++++------ .../classroom/view/ClassroomTopBar.kt | 8 ++++-- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/afs/tutrd/navigation/classroom/ClassroomNavigation.kt b/app/src/main/java/com/afs/tutrd/navigation/classroom/ClassroomNavigation.kt index 3d8e40a..7f46640 100644 --- a/app/src/main/java/com/afs/tutrd/navigation/classroom/ClassroomNavigation.kt +++ b/app/src/main/java/com/afs/tutrd/navigation/classroom/ClassroomNavigation.kt @@ -13,7 +13,7 @@ internal fun NavGraphBuilder.classroomScreen( modifier: Modifier = Modifier ) { composable { - ClassroomScreen() + ClassroomScreen(modifier) } } diff --git a/app/src/main/java/com/afs/tutrd/presentation/classroom/view/ClassroomScreen.kt b/app/src/main/java/com/afs/tutrd/presentation/classroom/view/ClassroomScreen.kt index 8fd209d..7a601c6 100644 --- a/app/src/main/java/com/afs/tutrd/presentation/classroom/view/ClassroomScreen.kt +++ b/app/src/main/java/com/afs/tutrd/presentation/classroom/view/ClassroomScreen.kt @@ -1,26 +1,37 @@ package com.afs.tutrd.presentation.classroom.view import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.afs.tutrd.component.scaffold.TutrdScaffold @Composable -fun ClassroomScreen() { +fun ClassroomScreen( + modifier: Modifier = Modifier, +) { + val scrollState = rememberScrollState() TutrdScaffold( - topBar = { ClassroomTopBar(title = "과목 관리") { } } + topBar = { + ClassroomTopBar( + title = "과목 관리" + ) { } + } ) { paddingValues -> - LazyColumn( - modifier = Modifier.padding(paddingValues).padding(horizontal = 20.dp).fillMaxWidth(), + Column( + modifier = modifier + .verticalScroll(scrollState) + .padding(paddingValues) + .padding(20.dp) + .fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(20.dp), - contentPadding = PaddingValues(vertical = 20.dp) ) { - items(3) { + repeat(10) { ClassroomCard { } } } diff --git a/app/src/main/java/com/afs/tutrd/presentation/classroom/view/ClassroomTopBar.kt b/app/src/main/java/com/afs/tutrd/presentation/classroom/view/ClassroomTopBar.kt index 799c4ce..933ad5d 100644 --- a/app/src/main/java/com/afs/tutrd/presentation/classroom/view/ClassroomTopBar.kt +++ b/app/src/main/java/com/afs/tutrd/presentation/classroom/view/ClassroomTopBar.kt @@ -1,5 +1,6 @@ package com.afs.tutrd.presentation.classroom.view +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth @@ -12,14 +13,17 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.afs.tutrd.theme.Heading1 +import com.afs.tutrd.theme.TutrdBackground @Composable internal fun ClassroomTopBar( + modifier: Modifier = Modifier, title: String, onClickTitle: () -> Unit ) { Box( - modifier = Modifier + modifier = modifier + .background(TutrdBackground) .height(56.dp) .fillMaxWidth() .padding(horizontal = 20.dp) @@ -39,7 +43,7 @@ internal fun ClassroomTopBar( } @Preview(showBackground = true) @Composable -private fun previewHomeTopBar() { +private fun PreviewHomeTopBar() { ClassroomTopBar(title = "과목 관리") { }