diff --git a/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailProgramScreen.kt b/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailProgramScreen.kt index c48d6be..8e338e5 100644 --- a/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailProgramScreen.kt +++ b/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailProgramScreen.kt @@ -15,6 +15,7 @@ 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.layout.wrapContentWidth import androidx.compose.foundation.pager.HorizontalPager import androidx.compose.foundation.pager.PagerState import androidx.compose.foundation.pager.rememberPagerState @@ -31,6 +32,7 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel @@ -156,11 +158,11 @@ internal fun HomeDetailProgramScreen( Box( modifier = Modifier + .fillMaxWidth() .border( width = 1.dp, color = colors.gray200 ) - .fillMaxWidth() .padding( horizontal = 16.dp, vertical = 16.dp @@ -238,7 +240,8 @@ internal fun HomeDetailProgramScreen( is StandardProgramListUiState.Success -> { StandardProgramList( standardItem = standardProgramListUiState.data.toImmutableList(), - navigateToStandardProgramDetail = navigateToStandardProgramDetail + navigateToStandardProgramDetail = navigateToStandardProgramDetail, + horizontalScrollState = scrollState ) } @@ -294,7 +297,8 @@ internal fun HomeDetailProgramScreen( is TrainingProgramListUiState.Success -> { ProgramList( trainingItem = trainingProgramUiState.data.toImmutableList(), - navigateToTrainingProgramDetail = navigateToTrainingProgramDetail + navigateToTrainingProgramDetail = navigateToTrainingProgramDetail, + horizontalScrollState = scrollState ) } diff --git a/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailStandardProgramParticipantScreen.kt b/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailStandardProgramParticipantScreen.kt index 7e9c50b..5307be4 100644 --- a/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailStandardProgramParticipantScreen.kt +++ b/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailStandardProgramParticipantScreen.kt @@ -209,7 +209,7 @@ internal fun HomeDetailStandardProgramParticipantScreen( modifier = Modifier .fillMaxWidth() .padding(start = 16.dp) - .horizontalScroll(rememberScrollState()) + .horizontalScroll(scrollState) ) { Spacer(modifier = Modifier.width(20.dp)) @@ -270,7 +270,12 @@ internal fun HomeDetailStandardProgramParticipantScreen( ) { when (standardProgramAttendListUiState) { is StandardProgramAttendListUiState.Loading -> Unit - is StandardProgramAttendListUiState.Success -> HomeDetailStandardParticipantList(item = standardProgramAttendListUiState.data.toImmutableList()) + is StandardProgramAttendListUiState.Success -> { + HomeDetailStandardParticipantList( + item = standardProgramAttendListUiState.data.toImmutableList(), + horizontalScrollState = scrollState + ) + } is StandardProgramAttendListUiState.Error -> { Column( verticalArrangement = Arrangement.spacedBy( diff --git a/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailTrainingProgramParticipantScreen.kt b/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailTrainingProgramParticipantScreen.kt index 59765dc..7e4701e 100644 --- a/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailTrainingProgramParticipantScreen.kt +++ b/feature/home/src/main/java/com/school_of_company/home/view/HomeDetailTrainingProgramParticipantScreen.kt @@ -211,7 +211,7 @@ internal fun HomeDetailProgramParticipantScreen( modifier = Modifier .fillMaxWidth() .padding(start = 16.dp) - .horizontalScroll(rememberScrollState()) + .horizontalScroll(scrollState) ) { Spacer(modifier = Modifier.width(20.dp)) @@ -272,7 +272,12 @@ internal fun HomeDetailProgramParticipantScreen( ) { when (teacherTrainingProgramListUiState) { is TeacherTrainingProgramListUiState.Loading -> Unit - is TeacherTrainingProgramListUiState.Success -> HomeDetailProgramParticipantList(item = teacherTrainingProgramListUiState.data.toImmutableList()) + is TeacherTrainingProgramListUiState.Success -> { + HomeDetailProgramParticipantList( + item = teacherTrainingProgramListUiState.data.toImmutableList(), + horizontalScrollState = scrollState + ) + } is TeacherTrainingProgramListUiState.Error -> { Column( verticalArrangement = Arrangement.spacedBy( diff --git a/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailProgramParticipantList.kt b/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailProgramParticipantList.kt index 4f3cdf4..de40247 100644 --- a/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailProgramParticipantList.kt +++ b/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailProgramParticipantList.kt @@ -1,5 +1,6 @@ package com.school_of_company.home.view.component +import androidx.compose.foundation.ScrollState import androidx.compose.foundation.background import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding @@ -18,7 +19,8 @@ import kotlinx.collections.immutable.persistentListOf @Composable fun HomeDetailProgramParticipantList( modifier: Modifier = Modifier, - item: ImmutableList = persistentListOf() + item: ImmutableList = persistentListOf(), + horizontalScrollState: ScrollState ) { ExpoAndroidTheme { colors, _ -> LazyColumn( @@ -30,7 +32,8 @@ fun HomeDetailProgramParticipantList( itemsIndexed(item) { index, item -> HomeDetailProgramParticipantListItem( index = index + 1, - data = item + data = item, + horizontalScrollState = horizontalScrollState ) } } @@ -40,7 +43,8 @@ fun HomeDetailProgramParticipantList( @Composable fun HomeDetailStandardParticipantList( modifier: Modifier = Modifier, - item: ImmutableList = persistentListOf() + item: ImmutableList = persistentListOf(), + horizontalScrollState: ScrollState ) { ExpoAndroidTheme { colors, _ -> LazyColumn( @@ -52,7 +56,8 @@ fun HomeDetailStandardParticipantList( itemsIndexed(item) { index, item -> HomeDetailStandardProgramParticipantListItem( index = index + 1, - data = item + data = item, + horizontalScrollState = horizontalScrollState ) } } diff --git a/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailProgramParticipantListItem.kt b/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailProgramParticipantListItem.kt index bfcaf63..dfab388 100644 --- a/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailProgramParticipantListItem.kt +++ b/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailProgramParticipantListItem.kt @@ -25,7 +25,7 @@ fun HomeDetailProgramParticipantListItem( modifier: Modifier = Modifier, index: Int, data: TeacherTrainingProgramResponseEntity, - horizontalScrollState: ScrollState = rememberScrollState() + horizontalScrollState: ScrollState ) { ExpoAndroidTheme { colors, typography -> Spacer(modifier = Modifier.height(20.dp)) @@ -105,6 +105,7 @@ private fun HomeDetailProgramParticipantListItemPreview() { status = true, entryTime = "2024-09-12 T 08:30", leaveTime = "2024-09-12 T 08:30" - ) + ), + horizontalScrollState = rememberScrollState() ) } \ No newline at end of file diff --git a/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailStandardProgramParticipantListItem.kt b/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailStandardProgramParticipantListItem.kt index ba6a76a..c1f76a0 100644 --- a/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailStandardProgramParticipantListItem.kt +++ b/feature/home/src/main/java/com/school_of_company/home/view/component/HomeDetailStandardProgramParticipantListItem.kt @@ -25,7 +25,7 @@ fun HomeDetailStandardProgramParticipantListItem( modifier: Modifier = Modifier, index: Int, data: StandardAttendListResponseEntity, - horizontalScrollState: ScrollState = rememberScrollState() + horizontalScrollState: ScrollState ) { ExpoAndroidTheme { colors, typography -> Spacer(modifier = Modifier.height(20.dp)) diff --git a/feature/home/src/main/java/com/school_of_company/home/view/component/ProgramList.kt b/feature/home/src/main/java/com/school_of_company/home/view/component/ProgramList.kt index 5b212c4..641891a 100644 --- a/feature/home/src/main/java/com/school_of_company/home/view/component/ProgramList.kt +++ b/feature/home/src/main/java/com/school_of_company/home/view/component/ProgramList.kt @@ -1,10 +1,12 @@ package com.school_of_company.home.view.component +import androidx.compose.foundation.ScrollState import androidx.compose.foundation.background import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.itemsIndexed +import androidx.compose.foundation.rememberScrollState import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview @@ -19,7 +21,8 @@ import kotlinx.collections.immutable.persistentListOf fun ProgramList( modifier: Modifier = Modifier, trainingItem: ImmutableList = persistentListOf(), - navigateToTrainingProgramDetail: (Long) -> Unit + navigateToTrainingProgramDetail: (Long) -> Unit, + horizontalScrollState: ScrollState ) { ExpoAndroidTheme { colors, _ -> @@ -33,7 +36,8 @@ fun ProgramList( ProgramListItem( index = index + 1, data = item, - navigateToTrainingProgramDetail = navigateToTrainingProgramDetail + navigateToTrainingProgramDetail = navigateToTrainingProgramDetail, + horizontalScrollState = horizontalScrollState ) } } @@ -44,7 +48,8 @@ fun ProgramList( fun StandardProgramList( modifier: Modifier = Modifier, standardItem: ImmutableList = persistentListOf(), - navigateToStandardProgramDetail: (Long) -> Unit + navigateToStandardProgramDetail: (Long) -> Unit, + horizontalScrollState: ScrollState ) { ExpoAndroidTheme { colors, _ -> @@ -58,7 +63,8 @@ fun StandardProgramList( StandardProgramListItem( index = index + 1, data = item, - navigateToStandardProgramDetail = navigateToStandardProgramDetail + navigateToStandardProgramDetail = navigateToStandardProgramDetail, + horizontalScrollState = horizontalScrollState ) } } @@ -78,6 +84,7 @@ private fun ProgramListPreview() { category = "ESSENTIAL" ) ), - navigateToTrainingProgramDetail = {} + navigateToTrainingProgramDetail = {}, + horizontalScrollState = rememberScrollState() ) } \ No newline at end of file diff --git a/feature/home/src/main/java/com/school_of_company/home/view/component/ProgramListItem.kt b/feature/home/src/main/java/com/school_of_company/home/view/component/ProgramListItem.kt index 2f69fae..9f9ed82 100644 --- a/feature/home/src/main/java/com/school_of_company/home/view/component/ProgramListItem.kt +++ b/feature/home/src/main/java/com/school_of_company/home/view/component/ProgramListItem.kt @@ -31,7 +31,7 @@ fun ProgramListItem( index: Int, data: TrainingProgramListResponseEntity, navigateToTrainingProgramDetail: (Long) -> Unit, - horizontalScrollState: ScrollState = rememberScrollState() + horizontalScrollState: ScrollState ) { ExpoAndroidTheme { colors, typography -> @@ -137,6 +137,7 @@ private fun ProgramListItemPreview() { endedAt = "2024-09-12 T 08:30", category = "ESSENTIAL" ), - navigateToTrainingProgramDetail = {} + navigateToTrainingProgramDetail = {}, + horizontalScrollState = rememberScrollState() ) } \ No newline at end of file diff --git a/feature/home/src/main/java/com/school_of_company/home/view/component/StandardProgramListItem.kt b/feature/home/src/main/java/com/school_of_company/home/view/component/StandardProgramListItem.kt index 7c0e4b8..c9c14c1 100644 --- a/feature/home/src/main/java/com/school_of_company/home/view/component/StandardProgramListItem.kt +++ b/feature/home/src/main/java/com/school_of_company/home/view/component/StandardProgramListItem.kt @@ -30,7 +30,7 @@ fun StandardProgramListItem( index: Int, data: StandardProgramListResponseEntity, navigateToStandardProgramDetail: (Long) -> Unit, - horizontalScrollState: ScrollState = rememberScrollState() + horizontalScrollState: ScrollState ) { ExpoAndroidTheme { colors, typography -> @@ -108,6 +108,7 @@ private fun StandardProgramListItemPreview() { startedAt = "2024-09-12 T 08:30", endedAt = "2024-09-12 T 08:30", ), - navigateToStandardProgramDetail = {} + navigateToStandardProgramDetail = {}, + horizontalScrollState = rememberScrollState() ) } \ No newline at end of file