Skip to content

Commit

Permalink
feat : add expand func
Browse files Browse the repository at this point in the history
  • Loading branch information
nohjunh committed Feb 19, 2025
1 parent d660fa1 commit a148ac4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ private fun DashboardBody(
onAddGoalClicked = navigateToAddGoal,
onGoalClicked = navigateToGoalDetail,
onTapSearchBar = navigateToSearchGoal,
onInfoCardClicked = {
coroutineScope.launch {
if (!isNotPartiallyExpanded) {
bottomSheetScaffoldState.bottomSheetState.expand()
}
}
},
modifier = Modifier
.padding(top = 8.dp),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.animation.fadeOut
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -62,6 +63,7 @@ internal fun GoalBottomSheetContent(
onGoalClicked: (Long) -> Unit,
onAddGoalClicked: () -> Unit,
onTapSearchBar: () -> Unit,
onInfoCardClicked: () -> Unit,
modifier: Modifier = Modifier,
) {
Box(
Expand All @@ -77,6 +79,7 @@ internal fun GoalBottomSheetContent(
goals = goals,
onGoalToggled = onGoalToggled,
onGoalClicked = onGoalClicked,
onInfoCardClicked = onInfoCardClicked,
modifier = Modifier.weight(1f),
)
if (isNotPartiallyExpanded) {
Expand Down Expand Up @@ -148,6 +151,7 @@ private fun GoalBottomSheetBody(
goals: List<Goal>,
onGoalToggled: (Long) -> Unit,
onGoalClicked: (Long) -> Unit,
onInfoCardClicked: () -> Unit,
modifier: Modifier = Modifier,
) {
Column(
Expand All @@ -169,13 +173,15 @@ private fun GoalBottomSheetBody(
count = goals.size,
icon = DobeDobeIcons.Year2025,
dropShadowColor = Color(0xFF6CD2FF),
onClick = onInfoCardClicked,
)
GoalInfoCard(
modifier = Modifier.weight(1f),
title = stringResource(R.string.feature_dashboard_label_completed_goal),
count = goals.filter { it.isCompleted }.size,
icon = DobeDobeIcons.Checked,
dropShadowColor = Color(0xFF58FF92),
onClick = onInfoCardClicked,
)
}

Expand Down Expand Up @@ -247,6 +253,7 @@ private fun GoalInfoCard(
@DrawableRes icon: Int,
dropShadowColor: Color,
count: Int,
onClick: () -> Unit,
modifier: Modifier = Modifier,
) {
Row(
Expand All @@ -260,6 +267,7 @@ private fun GoalInfoCard(
)
.clip(RoundedCornerShape(15.dp))
.background(DobeDobeTheme.colors.white)
.clickable(onClick = onClick)
.padding(16.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
Expand Down Expand Up @@ -320,5 +328,6 @@ private fun GoalBottomSheetContentPreview(
onGoalClicked = {},
onTapSearchBar = {},
onAddGoalClicked = {},
onInfoCardClicked = {},
)
}

0 comments on commit a148ac4

Please sign in to comment.