Skip to content

Commit

Permalink
Merge pull request #168 from depromeet/fix/#104-1st-qa-minseo
Browse files Browse the repository at this point in the history
[FIX/#158] 2차 mvp QA 오류 수정
  • Loading branch information
Mnseo committed Feb 16, 2024
2 parents f1673a6 + 86dba99 commit 8aebaeb
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.util.Log
import androidx.core.app.NotificationCompat
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ class MoimFragment :
ScreenState.Success -> {
context?.defaultToast("모임 생성이 완료되었습니다")
delay(2000)
viewModel.initializeState()
}
ScreenState.BookMarkSuccess -> {
context?.defaultToast("모임 저장을 성공했습니다")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class MoimViewModel @Inject constructor(

val characterList: HashMap<Int, Int> = hashMapOf(
0 to R.drawable.ic_ghost,
1 to R.drawable.ic_star,
1 to R.drawable.ic_star_character,
2 to R.drawable.ic_bear,
3 to R.drawable.ic_raccoon,
4 to R.drawable.ic_cat,
Expand Down Expand Up @@ -262,7 +262,6 @@ class MoimViewModel @Inject constructor(
if (isOverSizeImageFound) {
viewModelScope.launch {
_snackbarEvent.emit(SnackbarEvent.FILE_OVER_10MB)
Log.d("snackbarEvent", _snackbarEvent.toString())
}
}
_imageUri.value = currentList.take(5)
Expand Down Expand Up @@ -333,13 +332,12 @@ class MoimViewModel @Inject constructor(
var timeInput = _time.value

val isAfternoon = _isAfternoon.value == "오후"
val (hourString, minute) = timeInput.split(":")
val (hourString, minuteString) = timeInput.split(":")
var hour = hourString.toInt()
val minute = if (minuteString.length == 1) "0$minuteString" else minuteString

if (isAfternoon && hour < 12) { hour += 12 }
else if (!isAfternoon && hour == 12) {
hour = 0
}
else if (!isAfternoon && hour == 12) { hour = 0 }

timeInput = "$hour:$minute"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fun MoimAddress(viewModel: MoimViewModel, navController: NavController, onClick:
Column(
modifier = Modifier
.fillMaxSize()
.background(color = TmtmColorPalette.current.GreyWhite),
.background(color = TmtmColorPalette.current.color_background),
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.Top,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ fun MoimHostRow(viewModel: MoimViewModel) {
modifier = Modifier
.width(147.dp)
.height(40.dp)
.clickable { }
.padding(start = 20.dp),
verticalAlignment = Alignment.CenterVertically
) {
Expand Down Expand Up @@ -606,7 +607,7 @@ fun MoimHostBtn(
modifier = Modifier
.fillMaxWidth()
.height(80.dp)
.padding(horizontal = 20.dp, vertical = 12.dp),
.padding(horizontal = 20.dp, vertical = 10.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
androidx.compose.material3.Button(
Expand Down Expand Up @@ -679,8 +680,7 @@ fun MoimCancelBtn(
androidx.compose.material3.Button(
modifier = Modifier
.fillMaxWidth()
.height(76.dp)
.padding(horizontal = 20.dp, vertical = 10.dp),
.height(76.dp),
onClick = {
viewModel.updateSheetEvent(ScreenState.Cancel)
},
Expand Down Expand Up @@ -729,11 +729,11 @@ fun MoimJoinBtn(
androidx.compose.material3.Button(
modifier = Modifier
.fillMaxWidth()
.height(76.dp)
.padding(horizontal = 20.dp, vertical = 10.dp),
.height(76.dp),
onClick = {
onJoinGroupClick(meetingsId)
},
enabled = moimJoinUsers.size < people,
colors = ButtonDefaults.buttonColors(containerColor = TmtmColorPalette.current.color_button_active),
shape = RoundedCornerShape(size = 4.dp)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import com.teumteum.base.component.compose.theme.TmtmColorPalette
import com.teumteum.teumteum.presentation.moim.MoimViewModel
import com.teumteum.teumteum.presentation.moim.ScreenState
import com.teumteum.teumteum.presentation.moim.TopicType
import kotlinx.coroutines.delay

@Composable
fun MoimCreateTopic(viewModel: MoimViewModel, onClick: ()->Unit) {
Expand Down Expand Up @@ -93,6 +94,7 @@ fun MoimCreateBtn(
viewModel.createMoim()
} else if (screenState == ScreenState.Success) {
navController?.navigate(R.id.fragment_home)
viewModel.initializeState()
}
else {
viewModel.goToNextScreen() }}
Expand Down Expand Up @@ -141,7 +143,6 @@ fun CreateTopicContent(viewModel: MoimViewModel, topicIndex: MutableState<Int>)
onItemSelected = {
topicIndex.value = index
viewModel.updateTopic(topicType)
Log.d("moim_topic", topicType.toString())
}
)
TmMarginVerticalSpacer(size = 12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fun MoimDateTime(viewModel: MoimViewModel, onClick: ()->Unit) {
Column(
modifier = Modifier
.fillMaxSize()
.background(color = TmtmColorPalette.current.GreyWhite),
.background(color = TmtmColorPalette.current.color_background),
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.Top,
) {
Expand Down Expand Up @@ -185,7 +185,10 @@ fun MoimDateColumn(viewModel: MoimViewModel) {

private fun updateTimeIfComplete(hour: String, minute: String, viewModel: MoimViewModel) {
if (hour.isNotEmpty() && minute.isNotEmpty()) {
val time = "$hour:$minute"
val formattedHour = if (hour.length == 1) "0$hour" else hour
val formattedMinute = if (minute.length == 1) "0$minute" else minute

val time = "$formattedHour:$formattedMinute"
viewModel.updateTime(time)
}
}
Expand Down Expand Up @@ -259,7 +262,7 @@ fun MoimTimeColumn(viewModel: MoimViewModel) {
)
},
onValueChange = { newText ->
timeAText = newText.take(1)
timeAText = newText.take(2)
updateTimeIfComplete(timeAText, timeBText, viewModel)
},
singleLine = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.teumteum.teumteum.presentation.moim.compose
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -27,26 +28,35 @@ import com.teumteum.teumteum.presentation.moim.MoimViewModel

@Composable
fun MoimFinish(viewModel: MoimViewModel, navController: NavController) {
TmScaffold(onClick = { viewModel.goPreviousScreen()}) {
Column(
TmScaffold(onClick = { viewModel.goPreviousScreen() }) {
Box(
modifier = Modifier
.fillMaxSize()
.background(color = TmtmColorPalette.current.color_background),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Top,
.background(color = TmtmColorPalette.current.color_background)
) {
TmMarginVerticalSpacer(size = 218)
MoimFinishColumn()
Spacer(modifier = Modifier.weight(1f))
TeumDivider()
MoimCreateBtn(
text = stringResource(id = R.string.moim_finish_btn),
viewModel = viewModel,
navController= navController
)
Column(
modifier = Modifier
.align(Alignment.Center)
.padding(horizontal = 20.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
MoimFinishColumn()
}
Column(
modifier = Modifier
.align(Alignment.BottomCenter)
.fillMaxWidth()
) {
TeumDivider()
MoimCreateBtn(
text = stringResource(id = R.string.moim_finish_btn),
viewModel = viewModel,
navController = navController
)
}
}
}

}

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fun MoimPeople(viewModel: MoimViewModel, onClick: () -> Unit) {
Column(
modifier = Modifier
.fillMaxSize()
.background(color = TmtmColorPalette.current.GreyWhite),
.background(color = TmtmColorPalette.current.color_background),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Top,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import com.teumteum.teumteum.presentation.mypage.setting.viewModel.Recommend
import com.teumteum.teumteum.presentation.mypage.setting.viewModel.RecommendDetailViewModel
import com.teumteum.teumteum.presentation.mypage.setting.viewModel.UserInfoUiState
import com.teumteum.teumteum.presentation.mypage.setting.viewModel.toRecommend
import com.teumteum.teumteum.util.SignupUtils
import com.teumteum.teumteum.util.SignupUtils.CHARACTER_CARD_FRIEND


@Composable
Expand Down Expand Up @@ -124,7 +124,7 @@ fun RecommendItem(recommend: Recommend, myPageViewModel: MyPageViewModel, navCon
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
RecommendRow(recommend = recommend, list= SignupUtils.CHARACTER_FRIEND_LIST)
RecommendRow(recommend = recommend, list= CHARACTER_CARD_FRIEND)
recommend.jobName?.let {
Text(
text = it,
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/teumteum/teumteum/util/SignupUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ object SignupUtils {
11 to R.drawable.ic_card_back_panda
)

val CHARACTER_FRIEND_LIST: HashMap<Int, Int> = hashMapOf(
val CHARACTER_CARD_FRIEND: HashMap<Int, Int> = hashMapOf(
0 to R.drawable.ic_ghost,
1 to R.drawable.ic_star_character,
2 to R.drawable.ic_bear,
Expand All @@ -52,6 +52,7 @@ object SignupUtils {
11 to R.drawable.ic_panda
)


const val JOB_DESIGN = "디자인"
const val JOB_DEVELOPMENT = "개발"
const val JOB_PLANNING = "기획"
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/drawable-night/ic_heart_default.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="22dp"
android:viewportWidth="24"
android:viewportHeight="22">
android:width="32dp"
android:height="33dp"
android:viewportWidth="32"
android:viewportHeight="33">
<path
android:pathData="M6.763,0C1.334,0 -2.109,6.306 1.458,11.994C3.965,15.991 8.581,19.654 10.804,21.418L10.812,21.424C10.936,21.522 11.052,21.614 11.16,21.7C11.234,21.761 11.313,21.813 11.397,21.855C11.779,22.051 12.23,22.046 12.603,21.855C12.687,21.813 12.766,21.761 12.84,21.7C12.95,21.612 13.069,21.518 13.196,21.418C15.419,19.654 20.035,15.991 22.542,11.994C26.109,6.306 22.666,0 17.237,0C14.751,0 13.052,1.025 12,2.171C10.948,1.025 9.249,0 6.763,0Z"
android:pathData="M12.241,6.318H8.39L4.667,10.042V15.931L16.083,27.188L27.333,15.928V10.085L24.32,6.318H19.758L16,9.451L12.241,6.318Z"
android:fillColor="#333333"/>
</vector>
10 changes: 5 additions & 5 deletions app/src/main/res/drawable-night/ic_heart_fill.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="22dp"
android:viewportWidth="24"
android:viewportHeight="22">
android:width="32dp"
android:height="33dp"
android:viewportWidth="32"
android:viewportHeight="33">
<path
android:pathData="M6.763,0C1.334,0 -2.109,6.306 1.458,11.994C3.965,15.991 8.581,19.654 10.804,21.418L10.812,21.424C10.936,21.522 11.052,21.614 11.16,21.7C11.234,21.761 11.313,21.813 11.397,21.855C11.779,22.051 12.23,22.046 12.603,21.855C12.687,21.813 12.766,21.761 12.84,21.7C12.95,21.612 13.069,21.518 13.196,21.418C15.419,19.654 20.035,15.991 22.542,11.994C26.109,6.306 22.666,0 17.237,0C14.751,0 13.052,1.025 12,2.171C10.948,1.025 9.249,0 6.763,0Z"
android:pathData="M12.241,6.318H8.39L4.667,10.042V15.931L16.083,27.188L27.333,15.928V10.085L24.32,6.318H19.758L16,9.451L12.241,6.318Z"
android:fillColor="#FC4E6D"/>
</vector>
12 changes: 6 additions & 6 deletions app/src/main/res/drawable/ic_heart_default.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="22dp"
android:viewportWidth="24"
android:viewportHeight="22">
android:width="32dp"
android:height="33dp"
android:viewportWidth="32"
android:viewportHeight="33">
<path
android:pathData="M6.763,0C1.334,0 -2.109,6.306 1.458,11.994C3.965,15.991 8.581,19.654 10.804,21.418L10.812,21.424C10.936,21.522 11.052,21.614 11.16,21.7C11.234,21.761 11.313,21.813 11.397,21.855C11.779,22.051 12.23,22.046 12.603,21.855C12.687,21.813 12.766,21.761 12.84,21.7C12.95,21.612 13.069,21.518 13.196,21.418C15.419,19.654 20.035,15.991 22.542,11.994C26.109,6.306 22.666,0 17.237,0C14.751,0 13.052,1.025 12,2.171C10.948,1.025 9.249,0 6.763,0Z"
android:fillColor="#DAE0E5"/>
android:pathData="M12.241,6.318H8.39L4.667,10.042V15.931L16.083,27.188L27.333,15.928V10.085L24.32,6.318H19.758L16,9.451L12.241,6.318Z"
android:fillColor="#333333"/>
</vector>
10 changes: 5 additions & 5 deletions app/src/main/res/drawable/ic_heart_fill.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="22dp"
android:viewportWidth="24"
android:viewportHeight="22">
android:width="32dp"
android:height="33dp"
android:viewportWidth="32"
android:viewportHeight="33">
<path
android:pathData="M6.763,0C1.334,0 -2.109,6.306 1.458,11.994C3.965,15.991 8.581,19.654 10.804,21.418L10.812,21.424C10.936,21.522 11.052,21.614 11.16,21.7C11.234,21.761 11.313,21.813 11.397,21.855C11.779,22.051 12.23,22.046 12.603,21.855C12.687,21.813 12.766,21.761 12.84,21.7C12.95,21.612 13.069,21.518 13.196,21.418C15.419,19.654 20.035,15.991 22.542,11.994C26.109,6.306 22.666,0 17.237,0C14.751,0 13.052,1.025 12,2.171C10.948,1.025 9.249,0 6.763,0Z"
android:pathData="M12.241,6.318H8.39L4.667,10.042V15.931L16.083,27.188L27.333,15.928V10.085L24.32,6.318H19.758L16,9.451L12.241,6.318Z"
android:fillColor="#FC4E6D"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/navigation/nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@
app:argType="long" />
</action>

<action
android:id="@+id/action_fragment_moim_to_fragment_recommend_detail"
app:destination="@id/fragment_recommend_detail"
app:enterAnim="@anim/slide_out_left"
app:popExitAnim="@anim/slide_in_right">
<argument
android:name="meetingId"
app:argType="long" />
</action>

</fragment>

<fragment
Expand Down

0 comments on commit 8aebaeb

Please sign in to comment.