Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#299] 플로팅 버튼 클릭 시 나오는 배경화면 수정 #303

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -41,6 +39,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.layout.ContentScale
Expand Down Expand Up @@ -99,7 +98,9 @@ fun GroupHomeScreen(

is GroupHomeUiState.GroupList -> {
GroupHomeScreen(
modifier = Modifier.fillMaxSize().padding(innerPadding),
modifier = Modifier
.fillMaxSize()
.padding(innerPadding),
groupList = (state as GroupHomeUiState.GroupList).groupList,
onClickGroupDetail = onClickGroupDetail,
onClickEventMake = onClickEventMake,
Expand Down Expand Up @@ -424,15 +425,14 @@ private fun GroupFloatingButton(
label = stringResource(R.string.floating_animate),
)

AnimatedOverlay(
visible = isExpanded,
onClick = { isExpanded = false },
)
Column(
modifier = modifier,
horizontalAlignment = Alignment.End,
) {
AnimatedVisibility(visible = isExpanded) {
AnimatedVisibility(
modifier = Modifier.shadow(5.dp, RoundedCornerShape(16.dp)),
visible = isExpanded,
) {
FloatingButtonContent(
modifier = Modifier
.background(
Expand All @@ -456,7 +456,7 @@ private fun GroupFloatingButton(
onClick = { isExpanded = !isExpanded },
shape = CircleShape,
containerColor = if (isExpanded) Color.White else Gray80,
elevation = FloatingActionButtonDefaults.elevation(0.dp),
elevation = FloatingActionButtonDefaults.elevation(if (isExpanded) 5.dp else 0.dp),
) {
StableImage(
modifier = Modifier
Expand All @@ -470,22 +470,6 @@ private fun GroupFloatingButton(
}
}

@Composable
private fun AnimatedOverlay(visible: Boolean, onClick: () -> Unit) {
AnimatedVisibility(
visible = visible,
enter = fadeIn(),
exit = fadeOut(),
) {
Spacer(
modifier = Modifier
.fillMaxSize()
.background(Color.Black.copy(alpha = 0.4f))
.noRippleClickable(onClick = onClick),
)
}
}

@Composable
private fun FloatingButtonContent(
modifier: Modifier,
Expand Down
Loading