Skip to content

Commit

Permalink
[Fix]#69 1차 배포 전 QA 사항 반영 (#70)
Browse files Browse the repository at this point in the history
* [FIX] #69-포킷 수정 중 수정 전 포킷 이름도 닉네임 중복 검사에 포함되던 문제 수정

* [FIX] #69-미분류 링크 목록에서 링크 상세 조회시 읽은 처리가 안되는 문제

* [FIX] #69-포킷 상세 화면에 진입시 포킷 내 링크 개수가 0으로 표시되는 문제 수정

* [FIX] #69-포킷 상세, 닉네임 설정, 설정화면의 헤더 영역의 위치를 링크 추가 화면의 헤더 영역의 위치로 통일

* [UI] #69-알림함 화면에서 알림이 비었을 때 표시되는 UI 추가 및 적용

* [FIX] #69-bottomSheet 그림자 수정 및 포킷 상세에서 포킷 목록 bottomSheet 조회시 bottomSheet가 화면 전체를 채우는 문제 수정

* [FIX] #69-링크 상세 bottomSheet에 수정/삭제 클릭 이벤트 누락 추가

* [FIX] #69-검색 화면에서 링크 조회시 안읽음 처리가 변경되지 않는 문제 수정

* [FIX] #69-링크 수정시 간혹 링크 이미지가 안보이는 문제 수정

* [CHORE] #69-ktlint 적용

* [CHORE] #69-ktlint 적용

* [CHORE] #69-푸키 캐릭터 영문명 수정 (pokki -> pooki)

* [CHORE] #69-modifier에서 height, width가 동일한 경우 size를 사용하도록 수정
  • Loading branch information
l5x5l authored Sep 6, 2024
1 parent b45db2c commit 13d61ad
Show file tree
Hide file tree
Showing 48 changed files with 331 additions and 97 deletions.
11 changes: 9 additions & 2 deletions app/src/main/java/pokitmons/pokit/navigation/RootDestination.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,15 @@ object AddPokit {
object PokitDetail {
val route: String = "pokitDetail"
val pokitIdArg = "pokit_id"
val routeWithArgs = "$route/{$pokitIdArg}"
var arguments = listOf(navArgument(pokitIdArg) { defaultValue = "-" })
val pokitCountQuery = "pokit_count"
val routeWithArgs = "$route/{$pokitIdArg}?$pokitCountQuery={$pokitCountQuery}"
var arguments = listOf(
navArgument(pokitIdArg) { defaultValue = "-" },
navArgument(pokitCountQuery) {
nullable = true
type = NavType.StringType
}
)
}

object Search {
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/pokitmons/pokit/navigation/RootNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ fun RootNavHost(
viewModel = viewModel,
onNavigateToSearch = { navHostController.navigate(Search.route) },
onNavigateToSetting = { navHostController.navigate(Setting.route) },
onNavigateToPokitDetail = { navHostController.navigate("${PokitDetail.route}/$it") },
onNavigateToPokitDetail = { pokitId, linkCount ->
navHostController.navigate(
"${PokitDetail.route}/$pokitId?${PokitDetail.pokitCountQuery}=$linkCount"
)
},
onNavigateAddLink = { navHostController.navigate(AddLink.route) },
onNavigateAddPokit = { navHostController.navigate(AddPokit.route) },
onNavigateToLinkModify = { navHostController.navigate("${AddLink.route}?${AddLink.linkIdArg}=$it") },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.launch
import pokitmons.pokit.core.ui.theme.PokitTheme
Expand Down Expand Up @@ -65,6 +66,7 @@ fun PokitBottomSheet(
visibility = false
}
},
shape = RectangleShape,
sheetState = bottomSheetState,
scrimColor = Color.Transparent,
containerColor = Color.Transparent,
Expand All @@ -75,7 +77,7 @@ fun PokitBottomSheet(
Surface(
shape = RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp),
color = PokitTheme.colors.backgroundBase,
shadowElevation = 20.dp
shadowElevation = 8.dp
) {
Column(
modifier = Modifier.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package pokitmons.pokit.core.ui.components.template.pooki

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import pokitmons.pokit.core.ui.R
import pokitmons.pokit.core.ui.theme.PokitTheme

@Composable
fun Pooki(
modifier: Modifier = Modifier,
title: String,
sub: String,
) {
Box(
modifier = modifier,
contentAlignment = Alignment.Center
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally
) {
Image(
modifier = Modifier
.size(180.dp),
painter = painterResource(id = R.drawable.pooki),
contentDescription = "pooki"
)

Spacer(modifier = Modifier.height(16.dp))

Text(text = title, style = PokitTheme.typography.title2.copy(color = PokitTheme.colors.textPrimary))

Spacer(modifier = Modifier.height(8.dp))

Text(text = sub, style = PokitTheme.typography.body2Medium.copy(color = PokitTheme.colors.textSecondary))
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package pokitmons.pokit.core.ui.components.template.pooki

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import pokitmons.pokit.core.ui.theme.PokitTheme

@Preview(showBackground = true)
@Composable
private fun Preview() {
PokitTheme {
Surface(modifier = Modifier.fillMaxSize()) {
Pooki(title = "저장된 포킷이 없어요!", sub = "포킷을 생성해 링크를 저장해보세요")
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package pokitmons.pokit.core.ui.components.template.pokkiempty
package pokitmons.pokit.core.ui.components.template.pookiempty

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
Expand All @@ -16,7 +16,7 @@ import pokitmons.pokit.core.ui.R
import pokitmons.pokit.core.ui.theme.PokitTheme

@Composable
fun EmptyPokki(
fun EmptyPooki(
modifier: Modifier = Modifier,
title: String,
sub: String,
Expand All @@ -30,9 +30,8 @@ fun EmptyPokki(
) {
Image(
modifier = Modifier
.height(180.dp)
.width(180.dp),
painter = painterResource(id = R.drawable.empty_pokki),
.size(180.dp),
painter = painterResource(id = R.drawable.empty_pooki),
contentDescription = "empty"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pokitmons.pokit.core.ui.components.template.pokkiempty
package pokitmons.pokit.core.ui.components.template.pookiempty

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Surface
Expand All @@ -12,7 +12,7 @@ import pokitmons.pokit.core.ui.theme.PokitTheme
private fun Preview() {
PokitTheme {
Surface(modifier = Modifier.fillMaxSize()) {
EmptyPokki(title = "저장된 포킷이 없어요!", sub = "포킷을 생성해 링크를 저장해보세요")
EmptyPooki(title = "저장된 포킷이 없어요!", sub = "포킷을 생성해 링크를 저장해보세요")
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package pokitmons.pokit.core.ui.components.template.pokkierror
package pokitmons.pokit.core.ui.components.template.pookierror

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
Expand All @@ -22,9 +22,9 @@ import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonType
import pokitmons.pokit.core.ui.theme.PokitTheme

@Composable
fun ErrorPokki(
fun ErrorPooki(
modifier: Modifier = Modifier,
pokkiSize: Dp = 180.dp,
pookiSize: Dp = 180.dp,
title: String,
sub: String,
onClickRetry: (() -> Unit)? = null,
Expand All @@ -38,9 +38,8 @@ fun ErrorPokki(
) {
Image(
modifier = Modifier
.height(pokkiSize)
.width(pokkiSize),
painter = painterResource(id = R.drawable.cry_pokki),
.size(pookiSize),
painter = painterResource(id = R.drawable.cry_pooki),
contentDescription = "empty"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pokitmons.pokit.core.ui.components.template.pokkierror
package pokitmons.pokit.core.ui.components.template.pookierror

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Surface
Expand All @@ -12,8 +12,8 @@ import pokitmons.pokit.core.ui.theme.PokitTheme
private fun Preview() {
PokitTheme {
Surface(modifier = Modifier.fillMaxSize()) {
ErrorPokki(title = "오류가 발생했어요", sub = "조금 뒤 다시 접속해주세요", onClickRetry = null)
// ErrorPokki(title = "오류가 발생했어요", sub = "조금 뒤 다시 접속해주세요", onClickRetry = {})
ErrorPooki(title = "오류가 발생했어요", sub = "조금 뒤 다시 접속해주세요", onClickRetry = null)
// ErrorPooki(title = "오류가 발생했어요", sub = "조금 뒤 다시 접속해주세요", onClickRetry = {})
}
}
}
Binary file added core/ui/src/main/res/drawable-hdpi/pooki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/ui/src/main/res/drawable-mdpi/pooki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/ui/src/main/res/drawable-xhdpi/pooki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/ui/src/main/res/drawable-xxhdpi/pooki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/ui/src/main/res/drawable-xxxhdpi/pooki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions core/ui/src/main/res/values/string.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@

<string name="title_empty_search">검색된 링크가 없어요</string>
<string name="sub_empty_search">검색어를 다시 확인해주세요</string>

<string name="title_empty_alarms">아직 알람이 없어요</string>
<string name="sub_empty_alarms">리마인드 알림을 설정하세요</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class AddLinkViewModel @Inject constructor(
val linkArg = LinkArg(
id = responseLink.id,
title = responseLink.title,
thumbnail = responseLink.thumbnail,
thumbnail = currentState.link.imageUrl ?: responseLink.thumbnail,
domain = responseLink.domain,
createdAt = responseLink.createdAt,
pokitId = currentSelectedPokit.id.toInt()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class AddPokitViewModel @Inject constructor(
private val _pokitIamges = MutableStateFlow<List<PokitImage>>(emptyList())
val pokitImages: StateFlow<List<PokitImage>> = _pokitIamges.asStateFlow()

private var existingPokitName: String? = null

init {
initPokitList()
loadPokitImages()
Expand Down Expand Up @@ -114,6 +116,7 @@ class AddPokitViewModel @Inject constructor(
state.copy(isModify = true, pokitImage = PokitImage.fromDomainPokitImage(response.result.image))
}
_pokitName.update { response.result.name }
existingPokitName = response.result.name
} else {
postSideEffect(AddPokitSideEffect.OnNavigationBack)
}
Expand All @@ -137,7 +140,9 @@ class AddPokitViewModel @Inject constructor(

fun savePokit() = intent {
// todo 에러 코드 파싱 수정시 제거 필요
if (pokitPaging.pagingData.value.find { it.title == pokitName.value } != null) {
val needNicknameCheck = (pokitName.value != existingPokitName)
val nicknameDuplicated = (pokitPaging.pagingData.value.find { it.title == pokitName.value } != null)
if (needNicknameCheck && nicknameDuplicated) {
val errorMessage = errorMessageProvider.errorCodeToMessage(PokitErrorCode.ALREADY_USED_POKIT_NAME)
reduce { state.copy(errorToastMessage = errorMessage) }
return@intent
Expand Down
68 changes: 52 additions & 16 deletions feature/alarm/src/main/java/pokitmons/pokit/alarm/AlarmScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import pokitmons.pokit.alarm.components.alarmitem.AlarmItem
import pokitmons.pokit.alarm.components.toolbar.Toolbar
import pokitmons.pokit.alarm.model.Alarm
import pokitmons.pokit.alarm.paging.SimplePagingState
import pokitmons.pokit.core.ui.components.atom.loading.LoadingProgress
import pokitmons.pokit.core.ui.components.template.pooki.Pooki
import pokitmons.pokit.core.ui.components.template.pookierror.ErrorPooki
import pokitmons.pokit.core.ui.R.string as coreString

@Composable
fun AlarmScreenContainer(
Expand All @@ -40,7 +44,8 @@ fun AlarmScreenContainer(
onClickAlarmRemove = viewModel::removeAlarm,
alarms = alarms,
alarmsState = alarmsState,
loadNextAlarms = viewModel::loadNextAlarms
loadNextAlarms = viewModel::loadNextAlarms,
refreshAlarms = viewModel::refreshAlarms
)
}

Expand All @@ -53,6 +58,7 @@ fun AlarmScreen(
alarms: List<Alarm> = emptyList(),
alarmsState: SimplePagingState = SimplePagingState.IDLE,
loadNextAlarms: () -> Unit = {},
refreshAlarms: () -> Unit = {},
) {
Column(
modifier = Modifier.fillMaxSize()
Expand All @@ -77,23 +83,53 @@ fun AlarmScreen(
}
}

LazyColumn(
modifier = Modifier
.fillMaxWidth()
.weight(1f),
state = alarmLazyColumnListState
) {
items(
items = alarms,
key = { alarm -> alarm.id }
) { alarm ->
AlarmItem(
modifier = Modifier.animateItemPlacement(),
alarm = alarm,
onClickAlarm = onClickAlarm,
onClickRemove = onClickAlarmRemove
when {
alarmsState == SimplePagingState.LOADING_INIT -> {
LoadingProgress(
modifier = Modifier
.fillMaxWidth()
.weight(1f)
)
}
alarmsState == SimplePagingState.FAILURE_INIT -> {
ErrorPooki(
modifier = Modifier
.fillMaxWidth()
.weight(1f),
title = stringResource(id = coreString.title_error),
sub = stringResource(id = coreString.sub_error),
onClickRetry = refreshAlarms
)
}
alarms.isEmpty() -> {
Pooki(
modifier = Modifier
.fillMaxWidth()
.weight(1f),
title = stringResource(id = coreString.title_empty_alarms),
sub = stringResource(id = coreString.sub_empty_alarms)
)
}
else -> {
LazyColumn(
modifier = Modifier
.fillMaxWidth()
.weight(1f),
state = alarmLazyColumnListState
) {
items(
items = alarms,
key = { alarm -> alarm.id }
) { alarm ->
AlarmItem(
modifier = Modifier.animateItemPlacement(),
alarm = alarm,
onClickAlarm = onClickAlarm,
onClickRemove = onClickAlarmRemove
)
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ class AlarmViewModel @Inject constructor(
}
}

fun refreshAlarms() {
viewModelScope.launch {
alarmPaging.refresh()
}
}

fun readAlarm(alarmId: String) {
val targetAlarm = alarms.value.find { it.id == alarmId } ?: return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import pokitmons.pokit.home.remind.RemindScreen
@Composable
fun HomeScreen(
viewModel: PokitViewModel,
onNavigateToPokitDetail: (String) -> Unit,
onNavigateToPokitDetail: (String, Int) -> Unit,
onNavigateToSearch: () -> Unit,
onNavigateToSetting: () -> Unit,
onNavigateAddLink: () -> Unit,
Expand Down
Loading

0 comments on commit 13d61ad

Please sign in to comment.