Skip to content

Commit 079ff18

Browse files
committed
feat: 변경사항 반영
1 parent 397e6f8 commit 079ff18

File tree

6 files changed

+317
-63
lines changed

6 files changed

+317
-63
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package com.no5ing.bbibbi.presentation.component
2+
3+
import androidx.compose.foundation.clickable
4+
import androidx.compose.foundation.layout.size
5+
import androidx.compose.material3.Icon
6+
import androidx.compose.material3.MaterialTheme
7+
import androidx.compose.material3.Text
8+
import androidx.compose.runtime.Composable
9+
import androidx.compose.ui.Modifier
10+
import androidx.compose.ui.res.painterResource
11+
import androidx.compose.ui.text.style.TextAlign
12+
import androidx.compose.ui.unit.dp
13+
import com.no5ing.bbibbi.R
14+
import com.no5ing.bbibbi.presentation.theme.bbibbiScheme
15+
import com.no5ing.bbibbi.presentation.theme.bbibbiTypo
16+
import com.skydoves.balloon.ArrowPositionRules
17+
import com.skydoves.balloon.BalloonAnimation
18+
import com.skydoves.balloon.BalloonSizeSpec
19+
import com.skydoves.balloon.compose.Balloon
20+
import com.skydoves.balloon.compose.rememberBalloonBuilder
21+
import com.skydoves.balloon.compose.setBackgroundColor
22+
23+
@Composable
24+
fun AIPhotoInfoBaloon() {
25+
val balloonColor = MaterialTheme.bbibbiScheme.button
26+
val builder = rememberBalloonBuilder {
27+
setArrowSize(10)
28+
setArrowPosition(0.5f)
29+
setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR)
30+
setWidth(BalloonSizeSpec.WRAP)
31+
setHeight(BalloonSizeSpec.WRAP)
32+
setMarginTop(12)
33+
setPaddingVertical(10)
34+
setPaddingHorizontal(16)
35+
setMarginHorizontal(12)
36+
setCornerRadius(12f)
37+
setBackgroundColor(balloonColor)
38+
// setBackgroundColorResource(balloonColor)
39+
setBalloonAnimation(BalloonAnimation.ELASTIC)
40+
}
41+
Balloon(
42+
builder = builder,
43+
balloonContent = {
44+
Text(
45+
text = "추석이 있는 한 달 동안만\n열리는 AI 가족사진관 이벤트입니다",
46+
textAlign = TextAlign.Center,
47+
color = MaterialTheme.bbibbiScheme.white,
48+
style = MaterialTheme.bbibbiTypo.bodyTwoRegular,
49+
)
50+
}
51+
) { baloon->
52+
Icon(
53+
painter = painterResource(id = R.drawable.warning_circle_icon),
54+
tint = MaterialTheme.bbibbiScheme.textSecondary,
55+
contentDescription = null,
56+
modifier = Modifier
57+
.size(16.dp)
58+
.clickable { baloon.showAlignBottom() }
59+
)
60+
}
61+
}

app/src/main/java/com/no5ing/bbibbi/presentation/feature/view/common/PostTypeSwitchButton.kt

Lines changed: 81 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ import androidx.compose.foundation.layout.Arrangement
1111
import androidx.compose.foundation.layout.Box
1212
import androidx.compose.foundation.layout.Row
1313
import androidx.compose.foundation.layout.fillMaxWidth
14+
import androidx.compose.foundation.layout.height
1415
import androidx.compose.foundation.layout.offset
1516
import androidx.compose.foundation.layout.padding
1617
import androidx.compose.foundation.layout.size
18+
import androidx.compose.foundation.layout.width
1719
import androidx.compose.foundation.shape.RoundedCornerShape
1820
import androidx.compose.material3.MaterialTheme
1921
import androidx.compose.material3.Text
@@ -45,83 +47,110 @@ fun PostTypeSwitchButton(
4547
isLocked: Boolean = true,
4648
state: MutableState<PostType> = remember { mutableStateOf(PostType.SURVIVAL) }
4749
) {
48-
val isSurvival = state.value == PostType.SURVIVAL
49-
val widthMax = 138.dp.dpToPx()
50+
//val isSurvival = state.value == PostType.SURVIVAL
51+
val widthMax = 230.dp.dpToPx()
5052
val buttonPosition: Dp by animateDpAsState(
5153
targetValue =
52-
if (isSurvival) 0.dp else 69.dp, animationSpec = tween(
54+
when(state.value) {
55+
PostType.SURVIVAL -> 0.dp
56+
PostType.MISSION -> 69.dp
57+
PostType.AI_IMAGE -> 140.dp
58+
}, animationSpec = tween(
5359
durationMillis = 130,
5460
easing = LinearEasing,
5561
),
5662
label = ""
5763
)
5864
val survivalButtonColor: Color by animateColorAsState(
59-
targetValue = if (isSurvival) MaterialTheme.bbibbiScheme.backgroundPrimary else MaterialTheme.bbibbiScheme.gray500,
65+
targetValue = if (state.value == PostType.SURVIVAL) MaterialTheme.bbibbiScheme.backgroundPrimary else MaterialTheme.bbibbiScheme.gray500,
6066
label = "",
6167
)
6268
val missionButtonColor: Color by animateColorAsState(
63-
targetValue = if (isSurvival) MaterialTheme.bbibbiScheme.gray500 else MaterialTheme.bbibbiScheme.backgroundPrimary,
69+
targetValue = if (state.value == PostType.MISSION) MaterialTheme.bbibbiScheme.backgroundPrimary else MaterialTheme.bbibbiScheme.gray500,
6470
label = "",
6571
)
66-
Box(
67-
contentAlignment = Alignment.Center,
68-
modifier = Modifier
69-
.size(width = 138.dp, height = 40.dp)
70-
.background(MaterialTheme.bbibbiScheme.backgroundHover, RoundedCornerShape(40.dp))
71-
.pointerInput(Unit) {
72-
detectTapGestures { offset ->
73-
if (widthMax / 2 > offset.x) {
74-
state.value = PostType.SURVIVAL
75-
} else {
76-
state.value = PostType.MISSION
77-
}
78-
Timber.d("offset: $offset")
79-
}
80-
}
81-
//.padding(vertical = 8.dp, horizontal = 12.dp)
82-
) {
72+
Box{
8373
Box(
74+
contentAlignment = Alignment.CenterStart,
8475
modifier = Modifier
85-
.align(Alignment.CenterStart)
86-
.offset(x = buttonPosition)
87-
.size(width = 70.dp, height = 40.dp)
88-
.background(MaterialTheme.bbibbiScheme.iconSelected, RoundedCornerShape(40.dp))
89-
)
90-
Row(
91-
modifier = Modifier
92-
.fillMaxWidth()
93-
.padding(
94-
start = 24.dp,
95-
end = if (isLocked) 14.dp else 24.dp
96-
),
97-
horizontalArrangement = Arrangement.SpaceBetween,
76+
.size(width = 230.dp, height = 40.dp)
77+
.background(MaterialTheme.bbibbiScheme.backgroundHover, RoundedCornerShape(40.dp))
78+
.pointerInput(Unit) {
79+
detectTapGestures { offset ->
80+
val divVal = widthMax / 3
81+
if (offset.x < divVal) {
82+
state.value = PostType.SURVIVAL
83+
} else if (offset.x < divVal * 2) {
84+
state.value = PostType.MISSION
85+
} else {
86+
state.value = PostType.AI_IMAGE
87+
}
88+
Timber.d("offset: $offset")
89+
}
90+
}
9891
) {
99-
Text(
100-
text = stringResource(id = R.string.post_type_survival),
101-
style = MaterialTheme.bbibbiTypo.bodyTwoBold,
102-
color = survivalButtonColor
92+
93+
Box(
94+
modifier = Modifier
95+
.align(Alignment.CenterStart)
96+
.offset(x = buttonPosition)
97+
.size(width = 70.dp, height = 40.dp)
98+
.background(MaterialTheme.bbibbiScheme.iconSelected, RoundedCornerShape(40.dp))
10399
)
104-
Row(
105-
verticalAlignment = Alignment.CenterVertically,
106-
horizontalArrangement = Arrangement.spacedBy(2.dp)
100+
Box(
101+
modifier = Modifier.width(138.dp),
102+
contentAlignment = Alignment.CenterStart
107103
) {
108-
Text(
109-
text = stringResource(id = R.string.post_type_mission),
110-
style = MaterialTheme.bbibbiTypo.bodyTwoBold,
111-
color = missionButtonColor,
112-
)
113-
if (isLocked) {
114-
Image(
115-
modifier = Modifier.size(12.dp),
116-
painter = painterResource(id = R.drawable.lock_icon),
117-
contentDescription = "locked"
104+
Row(
105+
modifier = Modifier
106+
.width(138.dp)
107+
.padding(
108+
start = 24.dp,
109+
end = if (isLocked) 14.dp else 24.dp
110+
),
111+
horizontalArrangement = Arrangement.SpaceBetween,
112+
) {
113+
Text(
114+
text = stringResource(id = R.string.post_type_survival),
115+
style = MaterialTheme.bbibbiTypo.bodyTwoBold,
116+
color = survivalButtonColor
118117
)
118+
Row(
119+
verticalAlignment = Alignment.CenterVertically,
120+
horizontalArrangement = Arrangement.spacedBy(2.dp)
121+
) {
122+
Text(
123+
text = stringResource(id = R.string.post_type_mission),
124+
style = MaterialTheme.bbibbiTypo.bodyTwoBold,
125+
color = missionButtonColor,
126+
)
127+
if (isLocked) {
128+
Image(
129+
modifier = Modifier.size(12.dp),
130+
painter = painterResource(id = R.drawable.lock_icon),
131+
contentDescription = "locked"
132+
)
133+
}
134+
}
119135
}
120136
}
121137

122138
}
139+
Box(
140+
modifier = Modifier.offset(x = 136.dp)
141+
) {
142+
Image(
143+
modifier = Modifier
144+
.background(Color.Transparent)
145+
.size(width = 94.dp, height = 40.dp),
146+
painter = painterResource(id = R.drawable.photo_studio),
147+
contentDescription = "photo studio",
148+
)
149+
}
150+
123151
}
124152

153+
125154
}
126155

127156
@Preview

app/src/main/java/com/no5ing/bbibbi/presentation/feature/view/main/family_studio/FamilyStudioPage.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
3636
import com.no5ing.bbibbi.R
3737
import com.no5ing.bbibbi.data.model.post.AIPost
3838
import com.no5ing.bbibbi.data.repository.Arguments
39+
import com.no5ing.bbibbi.presentation.component.AIPhotoInfoBaloon
3940
import com.no5ing.bbibbi.presentation.component.BBiBBiPreviewSurface
4041
import com.no5ing.bbibbi.presentation.component.BBiBBiSurface
4142
import com.no5ing.bbibbi.presentation.component.DisposableTopBar
@@ -115,17 +116,19 @@ fun FamilyStudioPage(
115116
.padding(vertical = 2.dp, horizontal = 6.dp)
116117
) {
117118
Text(
118-
text = "${LocalDate.now().monthValue}",
119+
text = "추석",
119120
color = MaterialTheme.bbibbiScheme.backgroundPrimary,
120121
style = MaterialTheme.bbibbiTypo.bodyTwoBold,
121122
)
122123
}
123124
Box(modifier = Modifier.width(6.dp))
124125
Text(
125-
text = "추석",
126+
text = "9/29~10/27",
126127
color = MaterialTheme.bbibbiScheme.textPrimary,
127128
style = MaterialTheme.bbibbiTypo.headTwoBold,
128129
)
130+
Spacer(modifier = Modifier.width(4.dp))
131+
AIPhotoInfoBaloon()
129132
}
130133
Text(
131134
text = "${photoCount}개의 추억",

app/src/main/java/com/no5ing/bbibbi/presentation/feature/view/main/home/HomePage.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ fun HomePage(
101101
.fillMaxWidth()
102102
.background(MaterialTheme.bbibbiScheme.backgroundPrimary)
103103
) {
104-
CTAButton(
105-
text = "gogo",
106-
onClick = { onTapFamilyStudio() },
107-
)
108104
if (isDayTime) {
109105
HomePageTopBar(
110106
onTapLeft = {
@@ -128,6 +124,7 @@ fun HomePage(
128124
onRefresh = {
129125
mainPageViewModel.invoke(Arguments())
130126
},
127+
onTapAi = onTapFamilyStudio,
131128
deferredPickStateSet = mainPageViewModel.deferredPickMembersSet
132129
)
133130
} else {
@@ -173,7 +170,7 @@ fun HomePage(
173170
}
174171
}
175172
)
176-
} else {
173+
} else if (postViewType == PostType.MISSION) {
177174
HomePageMissionUploadButton(
178175
onTap = onTapMissionUpload,
179176
isLoading = mainPageState.value.isLoading(),

0 commit comments

Comments
 (0)