From ccb5ad953e53943a30bf58415ade535d96212861 Mon Sep 17 00:00:00 2001 From: kwakjoohyeong Date: Sun, 16 Jun 2024 01:04:19 +0900 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EB=AC=B8=EA=B5=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/login/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/login/src/main/res/values/strings.xml b/feature/login/src/main/res/values/strings.xml index df149f9b..08abb381 100644 --- a/feature/login/src/main/res/values/strings.xml +++ b/feature/login/src/main/res/values/strings.xml @@ -4,5 +4,5 @@ 청하에 오신 것을 환영합니다 image_google_logo Google로 로그인하기 - 1인 가구의 모든 것\n 유용한 정보를 함께 공유해보세요! + 청년을 위한 모든 것\n 유익한 정보를 함께 공유해 보세요! \ No newline at end of file From bbe91bd8242f414c4f81d680c35b9593e5e53292 Mon Sep 17 00:00:00 2001 From: kwakjoohyeong Date: Sun, 16 Jun 2024 02:12:33 +0900 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=EB=B0=94=ED=85=80=20=EC=8B=9C?= =?UTF-8?q?=ED=8A=B8=20=EB=AA=A8=EB=8B=AC=20=EB=86=92=EC=9D=B4=20=EA=B3=A0?= =?UTF-8?q?=EC=A0=95=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/filtersetting/FilterBottomSheet.kt | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt index 82c4ea20..d31a1437 100644 --- a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt +++ b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt @@ -41,10 +41,10 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.withpeace.withpeace.core.designsystem.theme.WithpeaceTheme -import com.withpeace.withpeace.feature.home.R import com.withpeace.withpeace.core.ui.policy.ClassificationUiModel -import com.withpeace.withpeace.feature.home.filtersetting.uistate.FilterListUiState import com.withpeace.withpeace.core.ui.policy.RegionUiModel +import com.withpeace.withpeace.feature.home.R +import com.withpeace.withpeace.feature.home.filtersetting.uistate.FilterListUiState import com.withpeace.withpeace.feature.home.uistate.PolicyFiltersUiModel @Composable @@ -63,7 +63,11 @@ fun FilterBottomSheet( val screenHeight = configuration.screenHeightDp.dp var footerHeight by remember { mutableStateOf(0.dp) } val localDensity = LocalDensity.current - Box(modifier = modifier.heightIn(0.dp, screenHeight).background(WithpeaceTheme.colors.SystemWhite)) { + Box( + modifier = modifier + .heightIn(0.dp, screenHeight) + .background(WithpeaceTheme.colors.SystemWhite), + ) { FilterFooter( modifier = modifier .align(Alignment.BottomCenter) @@ -142,10 +146,21 @@ private fun ScrollableFilterSection( onRegionMoreViewClick: () -> Unit, scrollState: ScrollState, ) { + val scrollSectionHeight = remember { mutableStateOf(0.dp) } + val localDensity = LocalDensity.current + val columnModifier = modifier.padding(horizontal = 24.dp) Column( - modifier = modifier + modifier = + if (scrollSectionHeight.value == 0.dp) columnModifier + .onSizeChanged { + if (!filterListUiState.isRegionExpanded && !filterListUiState.isClassificationExpanded) { + scrollSectionHeight.value = with(localDensity) { it.height.toDp() } + } + } .verticalScroll(scrollState) - .padding(horizontal = 24.dp), + else columnModifier + .height(scrollSectionHeight.value) + .verticalScroll(scrollState), ) { Spacer(modifier = modifier.height(16.dp)) Text( @@ -325,3 +340,6 @@ private fun FilterFooter( } } } + +//TODO("최상단 스크롤 이벤트 완료 후 시트 닫히도록") +//TODO("하단 내릴시에 점핑 되는 것") From 09c4fcdbc41f8286db1ef2f10b86fd58afe45d2b Mon Sep 17 00:00:00 2001 From: kwakjoohyeong Date: Mon, 17 Jun 2024 15:15:18 +0900 Subject: [PATCH 3/5] =?UTF-8?q?chore:=20material=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../withpeace/feature/home/HomeScreen.kt | 21 +++++++++++++------ .../home/filtersetting/FilterBottomSheet.kt | 12 +++++------ .../registerpost/RegisterPostScreen.kt | 3 --- gradle/libs.versions.toml | 6 +++--- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/HomeScreen.kt b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/HomeScreen.kt index a72d7b0b..5df78778 100644 --- a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/HomeScreen.kt +++ b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/HomeScreen.kt @@ -15,6 +15,7 @@ import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding 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.material3.BottomSheetDefaults import androidx.compose.material3.Card @@ -34,6 +35,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color +import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow @@ -49,6 +51,7 @@ import androidx.paging.compose.collectAsLazyPagingItems import androidx.paging.compose.itemKey import com.withpeace.withpeace.core.designsystem.theme.WithpeaceTheme import com.withpeace.withpeace.core.designsystem.util.dropShadow +import com.withpeace.withpeace.core.designsystem.util.rememberBottomSheetNestedScrollInterceptor import com.withpeace.withpeace.core.ui.analytics.TrackScreenViewEvent import com.withpeace.withpeace.core.ui.policy.ClassificationUiModel import com.withpeace.withpeace.core.ui.policy.RegionUiModel @@ -190,13 +193,20 @@ private fun HomeHeader( var showBottomSheet by remember { mutableStateOf(false) } val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true) val scope = rememberCoroutineScope() + + val bottomSheetChildScrollState = rememberScrollState() + val bottomSheetScrollInterceptor = + rememberBottomSheetNestedScrollInterceptor(bottomSheetChildScrollState) + Box( modifier = modifier .fillMaxWidth() - .padding(horizontal = 24.dp).padding(bottom = 16.dp), + .padding(horizontal = 24.dp) + .padding(bottom = 16.dp), ) { Image( - modifier = modifier.align(Alignment.BottomCenter) + modifier = modifier + .align(Alignment.BottomCenter) .size(47.dp), painter = painterResource(id = R.drawable.ic_home_logo), contentDescription = stringResource(R.string.cheongha_logo), @@ -214,16 +224,17 @@ private fun HomeHeader( } if (showBottomSheet) { ModalBottomSheet( + modifier = modifier.nestedScroll(bottomSheetScrollInterceptor), dragHandle = null, onDismissRequest = { onDismissRequest() showBottomSheet = false }, sheetState = sheetState, - windowInsets = BottomSheetDefaults.windowInsets.only(WindowInsetsSides.Bottom), // 바텀시트시 상태바의 색깔도 ScopeOut 색으로 바꾸기 위함 ) { FilterBottomSheet( modifier = modifier, + scrollState = bottomSheetChildScrollState, selectedFilterUiState = selectedFilterUiState, onClassificationCheckChanged = onClassificationCheckChanged, onRegionCheckChanged = onRegionCheckChanged, @@ -379,6 +390,4 @@ fun HomePreview() { WithpeaceTheme { // HomeScreen() } -} -// TODO(바텀 시트 스크롤 고려) -// \ No newline at end of file +} \ No newline at end of file diff --git a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt index d31a1437..6d4a0f30 100644 --- a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt +++ b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt @@ -18,7 +18,6 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentHeight -import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll import androidx.compose.material3.ButtonColors @@ -28,10 +27,8 @@ import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged @@ -49,6 +46,7 @@ import com.withpeace.withpeace.feature.home.uistate.PolicyFiltersUiModel @Composable fun FilterBottomSheet( + scrollState: ScrollState, modifier: Modifier, selectedFilterUiState: PolicyFiltersUiModel, onClassificationCheckChanged: (ClassificationUiModel) -> Unit, @@ -58,10 +56,9 @@ fun FilterBottomSheet( onCloseFilter: () -> Unit, ) { val filterListUiState= remember { mutableStateOf(FilterListUiState().getStateByFilterState(selectedFilterUiState)) } - val scrollState = rememberScrollState() val configuration = LocalConfiguration.current val screenHeight = configuration.screenHeightDp.dp - var footerHeight by remember { mutableStateOf(0.dp) } + val footerHeight = remember { mutableStateOf(0.dp) } val localDensity = LocalDensity.current Box( modifier = modifier @@ -72,7 +69,7 @@ fun FilterBottomSheet( modifier = modifier .align(Alignment.BottomCenter) .onSizeChanged { - footerHeight = with(localDensity) { it.height.toDp() } + footerHeight.value = with(localDensity) { it.height.toDp() } }, onFilterAllOff = onFilterAllOff, onSearchWithFilter = onSearchWithFilter, @@ -80,7 +77,7 @@ fun FilterBottomSheet( Column( modifier = modifier .align(Alignment.TopCenter) - .padding(bottom = footerHeight), + .padding(bottom = footerHeight.value), ) { FilterHeader( modifier = modifier, @@ -149,6 +146,7 @@ private fun ScrollableFilterSection( val scrollSectionHeight = remember { mutableStateOf(0.dp) } val localDensity = LocalDensity.current val columnModifier = modifier.padding(horizontal = 24.dp) + Column( modifier = if (scrollSectionHeight.value == 0.dp) columnModifier diff --git a/feature/registerpost/src/main/java/com/withpeace/withpeace/feature/registerpost/RegisterPostScreen.kt b/feature/registerpost/src/main/java/com/withpeace/withpeace/feature/registerpost/RegisterPostScreen.kt index 046561f1..e514e019 100644 --- a/feature/registerpost/src/main/java/com/withpeace/withpeace/feature/registerpost/RegisterPostScreen.kt +++ b/feature/registerpost/src/main/java/com/withpeace/withpeace/feature/registerpost/RegisterPostScreen.kt @@ -337,9 +337,6 @@ fun RegisterPostTopic( containerColor = WithpeaceTheme.colors.SystemWhite, sheetState = bottomSheetState, onDismissRequest = { onShowBottomSheetChanged(false) }, - windowInsets = WindowInsets( - bottom = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding(), - ), shape = RoundedCornerShape(topStart = 20.dp,topEnd = 20.dp), ) { TopicBottomSheetContent( diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 365c04c0..dc383a05 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -53,9 +53,9 @@ ossLicensesPlugin = "0.10.6" androidxGlance = "1.0.0-beta01" glanceExperimentalTools = "0.2.2" junit = "1.1.5" -material = "1.11.0" -material3Android = "1.2.0" -material3 = "1.2.1" +material = "1.12.0" +material3Android = "1.3.0-beta03" +material3 = "1.3.0-beta03" multidex = "2.0.1" google-login = "1.1.0" From c250de215db79bfd947460e5d888e43b72db01d0 Mon Sep 17 00:00:00 2001 From: kwakjoohyeong Date: Tue, 18 Jun 2024 02:28:43 +0900 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=EB=B0=94=ED=85=80=20=EC=8B=9C?= =?UTF-8?q?=ED=8A=B8=20=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../withpeace/feature/home/HomeScreen.kt | 24 +++++++++++-------- .../home/filtersetting/FilterBottomSheet.kt | 8 ++++--- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/HomeScreen.kt b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/HomeScreen.kt index 5df78778..93983036 100644 --- a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/HomeScreen.kt +++ b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/HomeScreen.kt @@ -1,23 +1,22 @@ package com.withpeace.withpeace.feature.home import androidx.compose.foundation.Image +import androidx.compose.foundation.MutatePriority import androidx.compose.foundation.background import androidx.compose.foundation.clickable +import androidx.compose.foundation.gestures.stopScroll import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding 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.material3.BottomSheetDefaults import androidx.compose.material3.Card import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.ExperimentalMaterial3Api @@ -26,6 +25,7 @@ import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.Text import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -35,7 +35,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color -import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow @@ -51,7 +50,6 @@ import androidx.paging.compose.collectAsLazyPagingItems import androidx.paging.compose.itemKey import com.withpeace.withpeace.core.designsystem.theme.WithpeaceTheme import com.withpeace.withpeace.core.designsystem.util.dropShadow -import com.withpeace.withpeace.core.designsystem.util.rememberBottomSheetNestedScrollInterceptor import com.withpeace.withpeace.core.ui.analytics.TrackScreenViewEvent import com.withpeace.withpeace.core.ui.policy.ClassificationUiModel import com.withpeace.withpeace.core.ui.policy.RegionUiModel @@ -191,12 +189,18 @@ private fun HomeHeader( onCloseFilter: () -> Unit, ) { var showBottomSheet by remember { mutableStateOf(false) } - val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true) + val bottomSheetChildScrollState = rememberScrollState() + + val sheetState = rememberModalBottomSheetState( + skipPartiallyExpanded = true, + ) val scope = rememberCoroutineScope() - val bottomSheetChildScrollState = rememberScrollState() - val bottomSheetScrollInterceptor = - rememberBottomSheetNestedScrollInterceptor(bottomSheetChildScrollState) + LaunchedEffect(bottomSheetChildScrollState.canScrollBackward) { + if (bottomSheetChildScrollState.value == 0) { + bottomSheetChildScrollState.stopScroll(MutatePriority.PreventUserInput) + } + } Box( modifier = modifier @@ -224,7 +228,7 @@ private fun HomeHeader( } if (showBottomSheet) { ModalBottomSheet( - modifier = modifier.nestedScroll(bottomSheetScrollInterceptor), + modifier = modifier, dragHandle = null, onDismissRequest = { onDismissRequest() diff --git a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt index 6d4a0f30..5fe7e716 100644 --- a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt +++ b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/filtersetting/FilterBottomSheet.kt @@ -31,9 +31,11 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.rememberNestedScrollInteropConnection import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp @@ -55,7 +57,8 @@ fun FilterBottomSheet( onSearchWithFilter: () -> Unit, onCloseFilter: () -> Unit, ) { - val filterListUiState= remember { mutableStateOf(FilterListUiState().getStateByFilterState(selectedFilterUiState)) } + val filterListUiState = + remember { mutableStateOf(FilterListUiState().getStateByFilterState(selectedFilterUiState)) } val configuration = LocalConfiguration.current val screenHeight = configuration.screenHeightDp.dp val footerHeight = remember { mutableStateOf(0.dp) } @@ -158,7 +161,7 @@ private fun ScrollableFilterSection( .verticalScroll(scrollState) else columnModifier .height(scrollSectionHeight.value) - .verticalScroll(scrollState), + .verticalScroll(scrollState) ) { Spacer(modifier = modifier.height(16.dp)) Text( @@ -340,4 +343,3 @@ private fun FilterFooter( } //TODO("최상단 스크롤 이벤트 완료 후 시트 닫히도록") -//TODO("하단 내릴시에 점핑 되는 것") From 107ce364cd5b31dcb55e6f76f84f87fc29a5e984 Mon Sep 17 00:00:00 2001 From: kwakjoohyeong Date: Tue, 18 Jun 2024 02:44:14 +0900 Subject: [PATCH 5/5] =?UTF-8?q?chore:=20=EB=B2=84=EC=A0=84=20=EC=97=85?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 2 +- app/release/output-metadata.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 27f33512..4a421f4a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -10,7 +10,7 @@ android { defaultConfig { applicationId = "com.withpeace.withpeace" targetSdk = 34 - versionCode = 4 + versionCode = 5 versionName = "1.0.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 6e51644d..e3569d84 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -11,7 +11,7 @@ "type": "SINGLE", "filters": [], "attributes": [], - "versionCode": 3, + "versionCode": 5, "versionName": "1.0.0", "outputFile": "app-release.apk" }