From ae0052d5b04684be381c3038decd0e6c5e69f402 Mon Sep 17 00:00:00 2001 From: GunHyung Ham <54674781+ham2174@users.noreply.github.com> Date: Sat, 2 Nov 2024 02:58:48 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EB=AC=B8=EB=8B=B5,=20=EB=AC=B8?= =?UTF-8?q?=EB=8B=B5=20=EC=83=81=EC=84=B8=ED=99=94=EB=A9=B4=20=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=97=86=EC=96=B4?= =?UTF-8?q?=EC=A7=80=EB=8A=94=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?(#125)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [build] : cloudy 라이브러리 버전 업데이트 * [fix] : 문답 상세 - 소개 탭의 유저 이미지가 나오지 않는 오류 수정 * [fix] : 문답 - 문답 리스트의 유저 이미지가 나오지 않는 오류 수정 --- .../core/designsystem/components/etc/Profile.kt | 17 +++++++++-------- .../designsystem/components/etc/UserInfo.kt | 9 +++++++-- .../com/team/bottles/core/ui/BottleItem.kt | 3 ++- .../feat/pingpong/components/BottleList.kt | 11 ++++++++--- .../pingpong/detail/PingPongDetailScreen.kt | 4 ++++ .../detail/components/IntroductionContents.kt | 8 +++++++- gradle/libs.versions.toml | 2 +- 7 files changed, 38 insertions(+), 16 deletions(-) diff --git a/core/design-system/src/main/kotlin/com/team/bottles/core/designsystem/components/etc/Profile.kt b/core/design-system/src/main/kotlin/com/team/bottles/core/designsystem/components/etc/Profile.kt index 477740ea..71a2d2ae 100644 --- a/core/design-system/src/main/kotlin/com/team/bottles/core/designsystem/components/etc/Profile.kt +++ b/core/design-system/src/main/kotlin/com/team/bottles/core/designsystem/components/etc/Profile.kt @@ -14,6 +14,8 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.layer.GraphicsLayer +import androidx.compose.ui.graphics.rememberGraphicsLayer import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.Preview @@ -78,24 +80,23 @@ fun BottlesProfile( modifier: Modifier = Modifier, imageUrl: String, profileImageType: ProfileImageType, - isBlur: Boolean = true + isBlur: Boolean = true, + graphicsLayer: GraphicsLayer = rememberGraphicsLayer() ) { CoilImage( modifier = modifier .size(size = profileImageType.size) .clip(shape = CircleShape) - .then( - if (isBlur) { - Modifier.cloudy(radius = 5) - } else { - Modifier - } + .cloudy( + enabled = isBlur, + radius = 5, + graphicsLayer = graphicsLayer ), imageModel = { imageUrl }, - previewPlaceholder = painterResource(id = R.drawable.sample_image), imageOptions = ImageOptions( contentScale = ContentScale.Crop ), + previewPlaceholder = painterResource(id = R.drawable.sample_image), loading = { Box( modifier = Modifier diff --git a/core/design-system/src/main/kotlin/com/team/bottles/core/designsystem/components/etc/UserInfo.kt b/core/design-system/src/main/kotlin/com/team/bottles/core/designsystem/components/etc/UserInfo.kt index 1b497528..92393352 100644 --- a/core/design-system/src/main/kotlin/com/team/bottles/core/designsystem/components/etc/UserInfo.kt +++ b/core/design-system/src/main/kotlin/com/team/bottles/core/designsystem/components/etc/UserInfo.kt @@ -9,6 +9,8 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.layer.GraphicsLayer +import androidx.compose.ui.graphics.rememberGraphicsLayer import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview @@ -74,7 +76,8 @@ fun BottlesUserInfo( userName: String, userAge: Int, isBlur: Boolean = true, - profileImageType: ProfileImageType = ProfileImageType.LG + profileImageType: ProfileImageType = ProfileImageType.LG, + graphicsLayer: GraphicsLayer = rememberGraphicsLayer() ) { Column( modifier = modifier.fillMaxWidth(), @@ -86,7 +89,8 @@ fun BottlesUserInfo( BottlesProfile( imageUrl = imageUrl, profileImageType = profileImageType, - isBlur = isBlur + isBlur = isBlur, + graphicsLayer = graphicsLayer ) Row( @@ -127,6 +131,7 @@ private fun UserInfoPreview() { imageUrl = "", userName = "냥냥이", userAge = 15, + graphicsLayer = rememberGraphicsLayer() ) } } diff --git a/core/ui/src/main/kotlin/com/team/bottles/core/ui/BottleItem.kt b/core/ui/src/main/kotlin/com/team/bottles/core/ui/BottleItem.kt index 50cc2489..a2e7b77d 100644 --- a/core/ui/src/main/kotlin/com/team/bottles/core/ui/BottleItem.kt +++ b/core/ui/src/main/kotlin/com/team/bottles/core/ui/BottleItem.kt @@ -45,6 +45,7 @@ import com.team.bottles.core.ui.model.Bottle fun BottleItem( modifier: Modifier = Modifier, bottle: Bottle, + graphicsLayer: GraphicsLayer, onClickItem: () -> Unit, ) { Column( @@ -126,7 +127,7 @@ fun BottleItem( .clip(shape = CircleShape) .cloudy( radius = 5, - graphicsLayer = rememberGraphicsLayer() + graphicsLayer = graphicsLayer ), imageModel = { bottle.imageUrl }, previewPlaceholder = painterResource(id = R.drawable.sample_image), diff --git a/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/components/BottleList.kt b/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/components/BottleList.kt index 3924ae10..2c01c1d7 100644 --- a/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/components/BottleList.kt +++ b/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/components/BottleList.kt @@ -7,6 +7,7 @@ import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.rememberGraphicsLayer import androidx.compose.ui.tooling.preview.Preview import com.team.bottles.core.designsystem.theme.BottlesTheme import com.team.bottles.core.ui.BottleItem @@ -18,8 +19,10 @@ import kotlinx.collections.immutable.toImmutableList fun BottleList( modifier: Modifier = Modifier, bottles: ImmutableList, - onClickItem: (Bottle) -> Unit + onClickItem: (Bottle) -> Unit, ) { + val graphicsLayer = rememberGraphicsLayer() + LazyColumn( modifier = modifier.fillMaxSize(), contentPadding = PaddingValues( @@ -38,8 +41,10 @@ fun BottleList( ) { bottle -> BottleItem( bottle = bottle, - onClickItem = { onClickItem(bottle) }, - ) + graphicsLayer = graphicsLayer + ) { + onClickItem(bottle) + } } } } diff --git a/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/detail/PingPongDetailScreen.kt b/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/detail/PingPongDetailScreen.kt index 9f53e4f5..7ecfe55a 100644 --- a/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/detail/PingPongDetailScreen.kt +++ b/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/detail/PingPongDetailScreen.kt @@ -21,6 +21,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.rememberGraphicsLayer import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.platform.LocalFocusManager @@ -128,6 +129,8 @@ internal fun PingPongDetailScreen( .padding(innerPadding) .nestedScroll(connection = pullRefreshState.nestedScrollConnection) ) { + val graphicsLayer = rememberGraphicsLayer() + LazyColumn( modifier = Modifier.fillMaxSize(), state = when (uiState.currentTab) { @@ -151,6 +154,7 @@ internal fun PingPongDetailScreen( partnerLetter = uiState.partnerLetter, partnerKeyPoints = uiState.partnerKeyPoints, deleteAfterDay = uiState.deleteAfterDay, + graphicsLayer = graphicsLayer ) } diff --git a/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/detail/components/IntroductionContents.kt b/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/detail/components/IntroductionContents.kt index 5aa37421..27b8d1e6 100644 --- a/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/detail/components/IntroductionContents.kt +++ b/feat/ping-pong/src/main/kotlin/com/team/bottles/feat/pingpong/detail/components/IntroductionContents.kt @@ -10,6 +10,8 @@ import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.layer.GraphicsLayer +import androidx.compose.ui.graphics.rememberGraphicsLayer import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import com.team.bottles.core.designsystem.R @@ -27,6 +29,7 @@ internal fun LazyListScope.introductionContents( partnerProfile: UserProfile, partnerKeyPoints: List, partnerLetter: String, + graphicsLayer: GraphicsLayer ) { item(key = "Introduction Contents") { when (isStoppedPingPong) { @@ -34,7 +37,8 @@ internal fun LazyListScope.introductionContents( BottlesUserInfo( imageUrl = partnerProfile.imageUrl, userName = partnerProfile.userName, - userAge = partnerProfile.age + userAge = partnerProfile.age, + graphicsLayer = graphicsLayer ) Spacer(modifier = Modifier.height(height = BottlesTheme.spacing.extraLarge)) @@ -66,6 +70,7 @@ internal fun LazyListScope.introductionContents( @Composable private fun IntroductionContentsPreview() { BottlesTheme { + val graphicsLayer = rememberGraphicsLayer() LazyColumn( modifier = Modifier.fillMaxSize(), state = rememberLazyListState(), @@ -80,6 +85,7 @@ private fun IntroductionContentsPreview() { partnerProfile = UserProfile.sampleUserProfile(), partnerKeyPoints = UserKeyPoint.exampleUerKeyPoints(), partnerLetter = "편지내용입니다.", + graphicsLayer = graphicsLayer ) } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 50e49c93..ae024cfa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -54,7 +54,7 @@ okHttp = "4.12.0" kotlinx-serialization-converter = "1.0.0" # blur-effect -cloudy = "0.2.1" +cloudy = "0.2.3" # coil landscapist-coil-compose = "2.3.6"