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

[DEV->RELEASE/1.2.0] 릴리즈 관련 패치 추가 #11

Merged
merged 7 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ GEM
xcpretty (~> 0.2, >= 0.0.7)

PLATFORMS
arm64-darwin-22
arm64-darwin-23
x86_64-darwin-19

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data class MainPageFeedModel(
data class MainPagePickerModel(
val memberId: String,
val imageUrl: String?,
val displayName: String,
val displayName: String?,
) : Parcelable

@Parcelize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ fun VerticalGrid(
val column = index % columns
val row = index / columns
placeable.placeRelative(
x = column * itemWidth + if(column > 0) gap else 0,
y = columnY[column] + if(row > 0) verticalGap else 0,
x = column * itemWidth + if (column > 0) gap else 0,
y = columnY[column] + if (row > 0) verticalGap else 0,
)
columnY[column] += placeable.height
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fun FlatButton(
modifier: Modifier = Modifier,
buttonColor: Color = MaterialTheme.bbibbiScheme.mainYellow,
textColor: Color = MaterialTheme.bbibbiScheme.backgroundPrimary,
contentPadding: PaddingValues = PaddingValues(
contentPadding: PaddingValues = PaddingValues(
start = 24.dp,
top = 12.dp,
end = 24.dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.no5ing.bbibbi.presentation.feature.uistate.post
import com.no5ing.bbibbi.data.model.BaseModel
import com.no5ing.bbibbi.data.model.member.Member
import com.no5ing.bbibbi.data.model.post.DailyCalendarElement
import com.no5ing.bbibbi.data.model.post.Post

data class CalendarFeedUiState(
val post: DailyCalendarElement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.AlertDialogDefaults
import androidx.compose.material3.BasicAlertDialog
import androidx.compose.material3.Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.AlertDialogDefaults
import androidx.compose.material3.BasicAlertDialog
import androidx.compose.material3.Button
Expand All @@ -17,23 +16,13 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.DialogProperties
import com.no5ing.bbibbi.R
import com.no5ing.bbibbi.presentation.feature.view.common.AlertDialogContent
import com.no5ing.bbibbi.presentation.feature.view.common.AlertDialogFlowRow
import com.no5ing.bbibbi.presentation.feature.view.common.ButtonsCrossAxisSpacing
import com.no5ing.bbibbi.presentation.feature.view.common.ButtonsMainAxisSpacing
import com.no5ing.bbibbi.presentation.theme.bbibbiScheme
import com.no5ing.bbibbi.presentation.theme.bbibbiTypo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,20 @@ fun PostTypeSwitchButton(
) {
val isSurvival = state.value == PostType.SURVIVAL
val widthMax = 138.dp.dpToPx()
val buttonPosition: Dp by animateDpAsState(targetValue =
if(isSurvival) 0.dp else 69.dp, animationSpec = tween(
durationMillis = 130,
easing = LinearEasing,
),
val buttonPosition: Dp by animateDpAsState(
targetValue =
if (isSurvival) 0.dp else 69.dp, animationSpec = tween(
durationMillis = 130,
easing = LinearEasing,
),
label = ""
)
val survivalButtonColor: Color by animateColorAsState(
targetValue =if(isSurvival) MaterialTheme.bbibbiScheme.backgroundPrimary else MaterialTheme.bbibbiScheme.gray500,
targetValue = if (isSurvival) MaterialTheme.bbibbiScheme.backgroundPrimary else MaterialTheme.bbibbiScheme.gray500,
label = "",
)
val missionButtonColor: Color by animateColorAsState(
targetValue = if(isSurvival) MaterialTheme.bbibbiScheme.gray500 else MaterialTheme.bbibbiScheme.backgroundPrimary,
targetValue = if (isSurvival) MaterialTheme.bbibbiScheme.gray500 else MaterialTheme.bbibbiScheme.backgroundPrimary,
label = "",
)
Box(
Expand All @@ -77,7 +78,7 @@ fun PostTypeSwitchButton(
Timber.d("offset: $offset")
}
}
//.padding(vertical = 8.dp, horizontal = 12.dp)
//.padding(vertical = 8.dp, horizontal = 12.dp)
) {
Box(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ import com.no5ing.bbibbi.presentation.component.snackBarWarning
import com.no5ing.bbibbi.presentation.feature.uistate.family.MainFeedUiState
import com.no5ing.bbibbi.presentation.feature.view.main.calendar.MainCalendarDay
import com.no5ing.bbibbi.presentation.feature.view.main.post_view.PostViewContent
import com.no5ing.bbibbi.presentation.feature.view_model.mission.GetMissionByIdViewModel
import com.no5ing.bbibbi.presentation.feature.view_model.post.AddPostReactionViewModel
import com.no5ing.bbibbi.presentation.feature.view_model.post.CalendarWeekViewModel
import com.no5ing.bbibbi.presentation.feature.view_model.post.FamilySwipePostsViewModel
Expand Down Expand Up @@ -95,7 +94,6 @@ fun CalendarDetailPage(
calendarWeekViewModel: CalendarWeekViewModel = hiltViewModel(),
familyPostsViewModel: FamilySwipePostsViewModel = hiltViewModel(),
) {
// val postState = familyPostViewModel.uiState.collectAsState()
val resources = localResources()
val snackBarState = LocalSnackbarHostState.current
val uiState = calendarWeekViewModel.uiState.collectAsState()
Expand Down Expand Up @@ -317,7 +315,10 @@ fun CalendarDetailPage(
CalendarDetailBody(
onTapProfile = onTapProfile,
onTapRealEmojiCreate = onTapRealEmojiCreate,
item = MainFeedUiState(item.post.toPost(), item.writer),
item = MainFeedUiState(
item.post.toPost(),
item.writer
),
familyPostReactionBarViewModel = familyPostReactionBarViewModel,
removePostReactionViewModel = removePostReactionViewModel,
addPostReactionViewModel = addPostReactionViewModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fun HomePage(
unsavedDialogUri.value = tempUri
unsavedDialogEnabled.value = true
}
if(isDayTime) {
if (isDayTime) {
mainPageViewModel.invoke(Arguments())
} else {
mainPageNightViewModel.invoke(Arguments())
Expand Down Expand Up @@ -135,7 +135,7 @@ fun HomePage(
isUploadAbleTime = remember { gapUntilNext() > 0 },
isAlreadyUploaded = !mainPageState.value.isReady() ||
mainPageState.value.data.isMeSurvivalUploadedToday,
pickers = if(mainPageState.value.isReady()) mainPageState.value.data.pickers
pickers = if (mainPageState.value.isReady()) mainPageState.value.data.pickers
else emptyList(),
)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fun HomePageContent(

val survivalFeedItems = if (mainPageModel.isReady())
mainPageModel.data.survivalFeeds
else emptyList()
else emptyList()
val missionFeedItems = if (mainPageModel.isReady())
mainPageModel.data.missionFeeds
else emptyList()
Expand Down Expand Up @@ -124,14 +124,14 @@ fun HomePageContent(
)
Spacer(modifier = Modifier.height(24.dp))
UploadCountDownBar(warningState = warningState)
if(postViewTypeState.value == PostType.SURVIVAL) {
if (postViewTypeState.value == PostType.SURVIVAL) {
SurvivalTextDescription(warningState = warningState)
} else {
MissionTextDescription(
warningState = warningState,
isMissionUnlocked = mainPageModel.isReady() && mainPageModel.data.isMissionUnlocked,
missionText = if(mainPageModel.isReady()) mainPageModel.data.dailyMissionContent else "",
remainingMemberCnt = if(mainPageModel.isReady()) mainPageModel.data.leftUploadCountUntilMissionUnlock else 0
missionText = if (mainPageModel.isReady()) mainPageModel.data.dailyMissionContent else "",
remainingMemberCnt = if (mainPageModel.isReady()) mainPageModel.data.leftUploadCountUntilMissionUnlock else 0
)
}

Expand Down Expand Up @@ -227,8 +227,10 @@ fun MissionFeedTab(
verticalArrangement = Arrangement.Center,
) {
Image(
painter = painterResource(if(isMissionUnlocked) R.drawable.bbibbi
else R.drawable.chest_bibbi),
painter = painterResource(
if (isMissionUnlocked) R.drawable.bbibbi
else R.drawable.chest_bibbi
),
contentDescription = null, // 필수 param
modifier = Modifier
.fillMaxWidth(),
Expand Down Expand Up @@ -257,7 +259,9 @@ fun MissionFeedTab(
@Composable
fun SurvivalTextDescription(warningState: MutableState<Int>) {
Row(
modifier = Modifier.fillMaxWidth().height(20.dp),
modifier = Modifier
.fillMaxWidth()
.height(20.dp),
horizontalArrangement = Arrangement.spacedBy(2.dp, Alignment.CenterHorizontally),
verticalAlignment = Alignment.CenterVertically,
) {
Expand Down Expand Up @@ -294,7 +298,9 @@ fun MissionTextDescription(
remainingMemberCnt: Int,
) {
Row(
modifier = Modifier.fillMaxWidth().height(20.dp),
modifier = Modifier
.fillMaxWidth()
.height(20.dp),
horizontalArrangement = Arrangement.spacedBy(2.dp, Alignment.CenterHorizontally),
verticalAlignment = Alignment.CenterVertically,
) {
Expand All @@ -305,7 +311,7 @@ fun MissionTextDescription(
}
append("만 더 올리면 미션 열쇠를 받아요!")
}
if(isMissionUnlocked) {
if (isMissionUnlocked) {
Text(
text = missionText,
color = MaterialTheme.bbibbiScheme.textSecondary,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import com.no5ing.bbibbi.R
import com.no5ing.bbibbi.presentation.component.MicroTextBubbleBox
import com.no5ing.bbibbi.presentation.theme.bbibbiScheme
import com.no5ing.bbibbi.presentation.theme.bbibbiTypo
import com.no5ing.bbibbi.util.asyncImagePainter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
Expand All @@ -30,32 +29,27 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.no5ing.bbibbi.R
import com.no5ing.bbibbi.data.model.APIResponse
import com.no5ing.bbibbi.data.model.member.Member
import com.no5ing.bbibbi.data.model.view.MainPageModel
import com.no5ing.bbibbi.data.model.view.MainPageTopBarModel
import com.no5ing.bbibbi.presentation.component.CircleProfileImage
import com.no5ing.bbibbi.presentation.feature.uistate.family.MainFeedStoryElementUiState
import com.no5ing.bbibbi.presentation.theme.bbibbiScheme
import com.no5ing.bbibbi.presentation.theme.bbibbiTypo
import com.no5ing.bbibbi.util.LocalSessionState
import com.no5ing.bbibbi.util.gapBetweenNow
import com.no5ing.bbibbi.util.gapUntilNext
import kotlinx.coroutines.flow.StateFlow

@Composable
fun HomePageStoryBar(
//mainPageState: StateFlow<APIResponse<MainPageModel>>,
items: List<MainPageTopBarModel>,
items: List<MainPageTopBarModel>,
deferredPickStateSet: StateFlow<Set<String>>,
onTapProfile: (String) -> Unit = {},
onTapPick: (MainPageTopBarModel) -> Unit = {},
onTapInvite: () -> Unit = {},
) {
val meId = LocalSessionState.current.memberId
// val mainPageModel by mainPageState.collectAsState()
// val mainPageModel by mainPageState.collectAsState()
val deferredPickSet = deferredPickStateSet.collectAsState()
// val items = if (mainPageModel.isReady()) mainPageModel.data.topBarElements else emptyList()
// val items = if (mainPageModel.isReady()) mainPageModel.data.topBarElements else emptyList()

if (items.size == 1) {
HomePageNoFamilyBar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.Canvas
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
Expand All @@ -30,7 +29,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Outline
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.Path
Expand All @@ -40,13 +38,11 @@ import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import coil.compose.AsyncImage
import com.no5ing.bbibbi.R
import com.no5ing.bbibbi.data.model.view.MainPagePickerModel
import com.no5ing.bbibbi.presentation.component.CircleProfileImage
import com.no5ing.bbibbi.presentation.component.button.CameraCaptureButton
import com.no5ing.bbibbi.presentation.theme.bbibbiScheme
import com.no5ing.bbibbi.presentation.theme.bbibbiTypo
Expand All @@ -72,7 +68,7 @@ fun BoxScope.HomePageSurvivalUploadButton(
exit = fadeOut(),
) {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
if(pickers.isNotEmpty() && isUploadAbleTime && !isAlreadyUploaded && !isLoading) {
if (pickers.isNotEmpty() && isUploadAbleTime && !isAlreadyUploaded && !isLoading) {
WaitingMembersPop(
pickers = pickers,
)
Expand Down Expand Up @@ -119,14 +115,14 @@ fun BoxScope.HomePageMissionUploadButton(
Column(horizontalAlignment = Alignment.CenterHorizontally) {
UploadHelperPop(
text =
if(!isMeUploadedToday)
"생존신고 후 미션 사진을 올릴 수 있어요"
if (!isMeUploadedToday)
stringResource(id = R.string.home_mission_survival_not_uploadable)
else if (!isMissionUnlocked)
"아직 미션 사진을 찍을 수 없어요"
stringResource(id = R.string.home_mission_not_uploadable)
else if (isMeMissionUploaded)
"오늘의 미션은 완료되었어요"
stringResource(id = R.string.home_mission_completed)
else
"미션 사진을 찍으러 가볼까요?"
stringResource(id = R.string.home_mission_upload_ready)
)
CameraCaptureButton(
onClick = onTap,
Expand Down Expand Up @@ -218,7 +214,7 @@ fun WaitingMembersPop(
Box {
pickersShattered.reversed().forEachIndexed { rawIdx, it ->
MiniCircledIcon(
noImageLetter = it.displayName.first().toString(),
noImageLetter = it.displayName?.first()?.toString() ?: "?",
imageUrl = it.imageUrl,
modifier = Modifier.offset(
x = 16.dp * (pickersShattered.size - 1 - rawIdx)
Expand All @@ -228,15 +224,21 @@ fun WaitingMembersPop(
}
Spacer(modifier = Modifier.width(16.dp.times(pickersShattered.size - 1)))
}
if(pickers.size == 1) {
if (pickers.size == 1) {
Text(
text = "${pickers.first().displayName}님이 기다리고 있어요",
text = stringResource(
id = R.string.home_someone_waiting_you,
pickers.first().displayName ?:""
),
style = MaterialTheme.bbibbiTypo.bodyTwoRegular,
color = MaterialTheme.bbibbiScheme.backgroundHover,
)
} else {
Text(
text = "${pickers.first().displayName}님이 외 ${pickers.size - 1}명이 기다리고 있어요",
text = stringResource(
id = R.string.home_some_people_waiting_you,
pickers.first().displayName ?: "", pickers.size - 1
),
style = MaterialTheme.bbibbiTypo.bodyTwoRegular,
color = MaterialTheme.bbibbiScheme.backgroundHover,
)
Expand Down
Loading
Loading