Skip to content

Commit

Permalink
Merge pull request #135 from YAPP-Github/feature/jaino/#128
Browse files Browse the repository at this point in the history
#128, #130 : 프로필 수정화면 수정 및 푸시 알림 버그 수정
  • Loading branch information
jeongjaino authored Aug 25, 2024
2 parents 9818575 + 3ec4d5e commit e896564
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 70 deletions.
10 changes: 1 addition & 9 deletions app/src/main/kotlin/com/bff/wespot/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,6 @@ private fun navigateScreenFromNavArgs(navArgs: MainScreenNavArgs, navigator: Not
private fun NavController.navigateToNavGraph(navGraph: NavGraphSpec) {
this.navigate(navGraph) {
launchSingleTop = true
restoreState = when (navGraph.route) {
AppNavGraphs.message.route,
AppNavGraphs.notification.route -> false
else -> true
}

popUpTo(this@navigateToNavGraph.graph.findStartDestination().id ) {
saveState = true
}
popUpTo(this@navigateToNavGraph.graph.findStartDestination().id)
}
}
45 changes: 24 additions & 21 deletions core/ui/src/main/kotlin/com/bff/wespot/ui/ReservedMessageItem.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.bff.wespot.ui

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.FilterChip
import androidx.compose.material3.FilterChipDefaults
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -81,25 +80,29 @@ fun ReservedMessageItem(
)
}

FilterChip(
shape = WeSpotThemeManager.shapes.extraLarge,
onClick = { onClick() },
selected = false,
label = {
Text(
text = if (chipEnabled) chipText else chipDisabledText,
style = StaticTypeScale.Default.body6,
)
},
enabled = chipEnabled,
border = null,
colors = FilterChipDefaults.filterChipColors(
containerColor = WeSpotThemeManager.colors.secondaryBtnColor,
labelColor = Color(0xFFF7F7F8),
disabledContainerColor = Gray600,
disabledLabelColor = Gray400,
),
)
Box(
modifier = Modifier
.clip(WeSpotThemeManager.shapes.extraLarge)
.clickable { onClick() }
.let {
if (chipEnabled) {
it.background(WeSpotThemeManager.colors.secondaryBtnColor)
} else {
it.background(Gray600)
}
},
) {
Text(
modifier = Modifier.padding(horizontal = 10.dp, vertical = 5.dp),
text = if (chipEnabled) chipText else chipDisabledText,
style = StaticTypeScale.Default.body9,
color = if (chipEnabled) {
Color(0xFFF7F7F8)
} else {
Gray400
},
)
}
}

HorizontalDivider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import com.bff.wespot.designsystem.R
import com.bff.wespot.designsystem.theme.Primary400
import com.bff.wespot.designsystem.theme.StaticTypeScale
import com.bff.wespot.designsystem.theme.WeSpotTheme
import com.bff.wespot.designsystem.theme.WeSpotThemeManager
Expand Down Expand Up @@ -170,7 +171,7 @@ fun WSBanner(
if (hasBorder) {
it.border(
width = 1.dp,
color = WeSpotThemeManager.colors.primaryColor,
color = Primary400,
shape = WeSpotThemeManager.shapes.medium,
)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.bff.wespot.entire.screen

import android.graphics.Color.parseColor
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand All @@ -12,9 +13,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilterChip
import androidx.compose.material3.FilterChipDefaults
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
Expand Down Expand Up @@ -52,7 +50,6 @@ interface EntireNavigator {
fun navigateToProfileEditScreen(args: ProfileEditNavArgs)
}

@OptIn(ExperimentalMaterial3Api::class)
@Destination
@Composable
internal fun EntireScreen(
Expand Down Expand Up @@ -230,21 +227,18 @@ fun ProfileContent(
)
}

FilterChip(
shape = WeSpotThemeManager.shapes.extraLarge,
onClick = { onClick() },
selected = false,
label = {
Text(
text = stringResource(R.string.profile_edit),
style = StaticTypeScale.Default.body9,
)
},
border = null,
colors = FilterChipDefaults.filterChipColors(
containerColor = WeSpotThemeManager.colors.secondaryBtnColor,
labelColor = WeSpotThemeManager.colors.txtTitleColor,
),
)
Box(
modifier = Modifier
.clip(WeSpotThemeManager.shapes.extraLarge)
.clickable { onClick() }
.background(WeSpotThemeManager.colors.secondaryBtnColor),
) {
Text(
modifier = Modifier.padding(horizontal = 10.dp, vertical = 5.dp),
text = stringResource(R.string.profile_edit),
style = StaticTypeScale.Default.body9,
color = Color(0xFFF7F7F8),
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,15 @@ fun ProfileEditScreen(
.verticalScroll(scrollState),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Box(modifier = Modifier.clickable { navigator.navigateToCharacterEditScreen() }) {
Box(
modifier = Modifier
.padding(top = 16.dp)
.clickable { navigator.navigateToCharacterEditScreen() },
) {
Box(
modifier = Modifier
.size(90.dp)
.clip(CircleShape)
.padding(top = 16.dp)
.background(hexToColor(state.profile.profileCharacter.backgroundColor)),
contentAlignment = Alignment.Center,
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.bff.wespot.entire.screen.setting

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
Expand All @@ -27,6 +25,7 @@ import com.bff.wespot.designsystem.theme.WeSpotThemeManager
import com.bff.wespot.entire.R
import com.bff.wespot.entire.screen.state.notification.NotificationSettingAction
import com.bff.wespot.entire.viewmodel.NotificationSettingViewModel
import com.bff.wespot.ui.LoadingAnimation
import com.bff.wespot.util.OnLifecycleEvent
import com.ramcosta.composedestinations.annotation.Destination
import org.orbitmvi.orbit.compose.collectAsState
Expand All @@ -46,9 +45,7 @@ fun NotificationSettingScreen(
val state by viewModel.collectAsState()

if (state.isLoading) {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
CircularProgressIndicator()
}
LoadingAnimation()
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Text
Expand Down Expand Up @@ -60,6 +59,7 @@ import com.bff.wespot.message.viewmodel.MessageViewModel
import com.bff.wespot.model.ToastState
import com.bff.wespot.model.message.request.MessageType
import com.bff.wespot.model.notification.NotificationType
import com.bff.wespot.ui.LoadingAnimation
import com.bff.wespot.ui.WSBottomSheet
import com.bff.wespot.ui.WSHomeChipGroup
import kotlinx.collections.immutable.persistentListOf
Expand Down Expand Up @@ -330,9 +330,7 @@ fun MessageStorageScreen(
}

if (state.isLoading) {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
CircularProgressIndicator()
}
LoadingAnimation()
}

LaunchedEffect(Unit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ fun MessageEditScreen(
}
}

Spacer(modifier = Modifier.weight(1f))
Spacer(modifier = Modifier.height(68.dp))
}

Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.BottomCenter) {
WSButton(
onClick = {
if (state.isReservedMessage) {
Expand All @@ -206,12 +208,6 @@ fun MessageEditScreen(
reserveDialog = true
}
},
paddingValues = PaddingValues(
start = 20.dp,
end = 20.dp,
top = 32.dp,
bottom = 12.dp,
),
text = stringResource(
if (state.isReservedMessage) R.string.edit_done else R.string.message_send,
),
Expand All @@ -224,6 +220,7 @@ fun MessageEditScreen(
SendExitDialog(
isReservedMessage = state.isReservedMessage,
okButtonClick = {
exitDialog = false
navigator.navigateMessageScreen(args = MessageScreenArgs(isMessageSent = false))
},
cancelButtonClick = { exitDialog = false },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ fun MessageWriteScreen(
SendExitDialog(
isReservedMessage = state.isReservedMessage,
okButtonClick = {
dialogState = false
navigator.navigateMessageScreen(args = MessageScreenArgs(isMessageSent = false))
},
cancelButtonClick = { dialogState = false },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ fun ReceiverSelectionScreen(
SendExitDialog(
isReservedMessage = state.isReservedMessage,
okButtonClick = {
dialogState = false
navigator.navigateMessageScreen(args = MessageScreenArgs(isMessageSent = false))
},
cancelButtonClick = { dialogState = false },
Expand Down
2 changes: 1 addition & 1 deletion feature/message/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<string name="send_exit_dialog_ok_button">네 그만할래요</string>
<string name="receiver">받는 사람</string>
<string name="message_write_title">쪽지 내용을 작성해주세요\n상대에게 익명으로 전달해 드릴게요</string>
<string name="message_write_text_holder">오늘 바나나 우유 고마웠어! 점심 시간에 경기하는 거 봤는데 잘 하더라! 다치지 말고 화이팅 해!</string>
<string name="message_write_text_holder">나랑 등교 같이할래?</string>
<string name="message_length_limit">200자 이내로 입력해 주세요</string>
<string name="write_done">작성 완료</string>
<string name="toast_error_name_edit">닉네임은 직접 수정이 어려워요</string>
Expand Down

0 comments on commit e896564

Please sign in to comment.