Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.nexters.bandalart.feature.home

import androidx.compose.runtime.Composable
import androidx.compose.ui.text.input.TextFieldValue
import bandalart.core.designsystem.generated.resources.Res
import bandalart.core.designsystem.generated.resources.bandalart_list_empty_title
import com.nexters.bandalart.feature.home.model.BandalartUiModel
Expand Down Expand Up @@ -72,11 +73,11 @@ internal fun HomeBottomSheets(
private fun updateBandalartListTitles(list: List<BandalartUiModel>): List<BandalartUiModel> {
var counter = 1
return list.map { item ->
if (item.title.isNullOrEmpty()) {
if (!item.hasTitleText) {
val updatedTitle = stringResource(Res.string.bandalart_list_empty_title, counter)
counter += 1
item.copy(
title = updatedTitle,
title = TextFieldValue(updatedTitle),
isGeneratedTitle = true,
)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ internal fun HomeDialogs(
is DialogState.BandalartDelete -> {
uiState.bandalartData?.let { bandalart ->
BandalartDeleteAlertDialog(
title = if (bandalart.title.isNullOrEmpty()) {
title = if (bandalart.titleText.isEmpty()) {
stringResource(Res.string.delete_bandalart_dialog_empty_title)
} else {
stringResource(Res.string.delete_bandalart_dialog_title, bandalart.title)
stringResource(Res.string.delete_bandalart_dialog_title, bandalart.titleText)
},
message = stringResource(Res.string.delete_bandalart_dialog_message),
onDeleteClick = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nexters.bandalart.feature.home.mapper

import androidx.compose.ui.text.input.TextFieldValue
import com.nexters.bandalart.core.domain.entity.BandalartEntity
import com.nexters.bandalart.feature.home.model.BandalartUiModel

Expand All @@ -8,7 +9,7 @@ fun BandalartEntity.toUiModel() = BandalartUiModel(
mainColor = mainColor,
subColor = subColor,
profileEmoji = profileEmoji,
title = title,
title = title?.let { TextFieldValue(it) },
dueDate = dueDate,
isCompleted = isCompleted,
completionRatio = completionRatio,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
package com.nexters.bandalart.feature.home.model

import androidx.compose.ui.text.input.TextFieldValue

data class BandalartUiModel(
val id: Long = 0L,
val mainColor: String = "#3FFFBA",
val subColor: String = "#111827",
val profileEmoji: String? = "",
val title: String? = "",
val title: TextFieldValue? = TextFieldValue(""),
val cellId: Long = 0L,
val dueDate: String? = "",
val isCompleted: Boolean = false,
val completionRatio: Int = 0,
val isGeneratedTitle: Boolean = false,
)
) {
val titleText: String
get() = title?.text ?: ""

val hasTitleText: Boolean
get() = titleText.isNotEmpty()
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nexters.bandalart.feature.home.model.dummy

import androidx.compose.ui.text.input.TextFieldValue
import com.nexters.bandalart.core.ui.allColor
import com.nexters.bandalart.feature.home.model.BandalartUiModel
import kotlinx.datetime.Clock
Expand All @@ -9,7 +10,7 @@ val dummyBandalartData = BandalartUiModel(
mainColor = allColor[0].mainColor,
subColor = allColor[0].subColor,
profileEmoji = "😎",
title = "발전하는 예진",
title = TextFieldValue("발전하는 예진"),
cellId = 0L,
dueDate = Clock.System.now().toString(),
isCompleted = false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nexters.bandalart.feature.home.model.dummy

import androidx.compose.ui.text.input.TextFieldValue
import com.nexters.bandalart.core.ui.allColor
import com.nexters.bandalart.feature.home.model.BandalartUiModel
import kotlinx.datetime.Clock
Expand All @@ -10,7 +11,7 @@ val dummyBandalartList = listOf(
mainColor = allColor[0].mainColor,
subColor = allColor[0].subColor,
profileEmoji = "😎",
title = "발전하는 예진",
title = TextFieldValue("발전하는 예진"),
cellId = 0L,
dueDate = Clock.System.now().toString(),
isCompleted = false,
Expand All @@ -22,7 +23,7 @@ val dummyBandalartList = listOf(
mainColor = allColor[1].mainColor,
subColor = allColor[1].subColor,
profileEmoji = "🔥",
title = "발전하는 석규",
title = TextFieldValue("발전하는 석규"),
cellId = 0L,
dueDate = Clock.System.now().toString(),
isCompleted = false,
Expand All @@ -34,7 +35,7 @@ val dummyBandalartList = listOf(
mainColor = allColor[2].mainColor,
subColor = allColor[2].subColor,
profileEmoji = "❤️‍🔥",
title = "발전하는 지훈",
title = TextFieldValue("발전하는 지훈"),
cellId = 0L,
dueDate = Clock.System.now().toString(),
isCompleted = false,
Expand All @@ -46,7 +47,7 @@ val dummyBandalartList = listOf(
mainColor = allColor[3].mainColor,
subColor = allColor[3].subColor,
profileEmoji = "💛",
title = "발전하는 인혁",
title = TextFieldValue("발전하는 인혁"),
cellId = 0L,
dueDate = Clock.System.now().toString(),
isCompleted = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ fun HomeHeader(
.wrapContentHeight(),
) {
Text(
text = bandalartData.title ?: stringResource(Res.string.home_empty_title),
color = if (bandalartData.title.isNullOrEmpty()) Gray300 else Gray900,
text = bandalartData.titleText.ifEmpty { stringResource(Res.string.home_empty_title) },
color = if (bandalartData.titleText.isEmpty()) Gray300 else Gray900,
fontSize = 20.sp,
fontWeight = FontWeight.W700,
modifier = Modifier
.align(Alignment.Center)
.clickable {
onHomeUiAction(HomeUiAction.OnBandalartCellClick(CellType.MAIN, bandalartData.title.isNullOrEmpty(), cellData))
onHomeUiAction(HomeUiAction.OnBandalartCellClick(CellType.MAIN, bandalartData.titleText.isEmpty(), cellData))
},
letterSpacing = (-0.4).sp,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
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.Color.Companion.White
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import bandalart.core.designsystem.generated.resources.Res
Expand Down Expand Up @@ -120,6 +122,14 @@ fun BandalartBottomSheet(
derivedStateOf { scrollState.value < scrollState.maxValue }
}

val titleTextFieldValue = remember {
mutableStateOf(TextFieldValue(bottomSheetData.cellData.title ?: ""))
}

val descriptionTextFieldValue = remember {
mutableStateOf(TextFieldValue(bottomSheetData.cellData.description ?: ""))
}

ModalBottomSheet(
onDismissRequest = {
onHomeUiAction(HomeUiAction.OnDismiss)
Expand Down Expand Up @@ -201,11 +211,10 @@ fun BandalartBottomSheet(
}
Column(modifier = Modifier.padding(top = 10.dp)) {
BandalartTextField(
value = bottomSheetData.cellData.title ?: "",
value = titleTextFieldValue.value,
onValueChange = { title ->
onHomeUiAction(
HomeUiAction.OnCellTitleUpdate(title, getLocale()),
)
titleTextFieldValue.value = title
onHomeUiAction(HomeUiAction.OnCellTitleUpdate(title.text, getLocale()))
},
placeholder = stringResource(Res.string.bottomsheet_title_placeholder),
)
Expand Down Expand Up @@ -295,18 +304,18 @@ fun BandalartBottomSheet(
onDueDateSelect = { dueDateResult ->
onHomeUiAction(HomeUiAction.OnDueDateSelect(dueDateResult.toString()))
},
currentDueDate = bottomSheetData.cellData.dueDate?.toLocalDateTime()
?: LocalDateTime.now(),
currentDueDate = bottomSheetData.cellData.dueDate?.toLocalDateTime() ?: LocalDateTime.now(),
)
}
Spacer(modifier = Modifier.height(28.dp))
BottomSheetSubTitleText(text = stringResource(Res.string.bottomsheet_description))
Spacer(modifier = Modifier.height(12.dp))
Column {
BandalartTextField(
value = bottomSheetData.cellData.description ?: "",
value = descriptionTextFieldValue.value,
onValueChange = { description ->
onHomeUiAction(HomeUiAction.OnDescriptionUpdate(description))
descriptionTextFieldValue.value = description
onHomeUiAction(HomeUiAction.OnDescriptionUpdate(description.text))
},
placeholder = stringResource(Res.string.bottomsheet_description_placeholder),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ fun BandalartCell(
.background(getCellBackgroundColor(bandalartData, cellType, cellData))
.clickable {
when (cellType) {
CellType.MAIN -> onHomeUiAction(HomeUiAction.OnBandalartCellClick(CellType.MAIN, bandalartData.title.isNullOrEmpty(), cellData))
CellType.SUB -> onHomeUiAction(HomeUiAction.OnBandalartCellClick(CellType.SUB, bandalartData.title.isNullOrEmpty(), cellData))
else -> onHomeUiAction(HomeUiAction.OnBandalartCellClick(CellType.TASK, bandalartData.title.isNullOrEmpty(), cellData))
CellType.MAIN -> onHomeUiAction(HomeUiAction.OnBandalartCellClick(CellType.MAIN, bandalartData.titleText.isEmpty(), cellData))
CellType.SUB -> onHomeUiAction(HomeUiAction.OnBandalartCellClick(CellType.SUB, bandalartData.titleText.isEmpty(), cellData))
else -> onHomeUiAction(HomeUiAction.OnBandalartCellClick(CellType.TASK, bandalartData.titleText.isEmpty(), cellData))
}
},
contentAlignment = Alignment.Center,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ fun BandalartListItem(
}
}
Text(
text = bandalartItem.title ?: "",
text = bandalartItem.titleText,
color = if (bandalartItem.isGeneratedTitle) Gray300 else Gray900,
fontSize = 16.sp,
fontWeight = FontWeight.W700,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusManager
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.dp
import com.nexters.bandalart.core.common.extension.clearFocusOnKeyboardDismiss
import com.nexters.bandalart.core.designsystem.theme.BottomSheetContent

@Composable
internal fun BandalartTextField(
value: String,
onValueChange: (String) -> Unit,
value: TextFieldValue,
onValueChange: (TextFieldValue) -> Unit,
placeholder: String,
modifier: Modifier = Modifier,
focusManager: FocusManager = LocalFocusManager.current,
Expand All @@ -34,7 +35,7 @@ internal fun BandalartTextField(
maxLines = 1,
textStyle = BottomSheetContent(),
decorationBox = { innerTextField ->
if (value.isEmpty()) {
if (value.text.isEmpty()) {
BottomSheetContentPlaceholder(text = placeholder)
}
innerTextField()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nexters.bandalart.feature.home.viewmodel

import androidx.compose.ui.text.input.TextFieldValue
import com.nexters.bandalart.core.common.Locale
import com.nexters.bandalart.core.domain.entity.BandalartCellEntity
import com.nexters.bandalart.core.domain.entity.UpdateBandalartEmojiEntity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ class HomeViewModel(
private fun observeBandalartCompletion() {
viewModelScope.launch {
bandalartFlow.collect { bandalart ->
if (bandalart.isCompleted && !bandalart.title.isNullOrEmpty()) {
if (bandalart.isCompleted && bandalart.titleText.isNotEmpty()) {
val isBandalartCompleted = checkCompletedBandalartId(bandalart.id)
if (isBandalartCompleted) {
delay(500L)
requestCapture()
delay(500L)
navigateToComplete(
bandalart.id,
bandalart.title,
bandalart.titleText,
bandalart.profileEmoji.orEmpty(),
_uiState.value.bandalartChartUrl.orEmpty(),
)
Expand Down Expand Up @@ -408,9 +408,7 @@ class HomeViewModel(

_uiState.update {
val currentBottomSheet = (it.bottomSheet as? BottomSheetState.Cell) ?: return@update it
val validatedTitle = if (title.length > maxLength) {
currentBottomSheet.cellData.title ?: ""
} else title
val validatedTitle = if (title.length > maxLength) { currentBottomSheet.cellData.title ?: "" } else title

it.copy(
bottomSheet = currentBottomSheet.copy(
Expand Down
Binary file not shown.
6 changes: 2 additions & 4 deletions iosApp/iosApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>1.0.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<true/>
<string>2</string>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>NSPhotoLibraryAddUsageDescription</key>
Expand Down Expand Up @@ -54,7 +53,6 @@
<string>UIInterfaceOrientationLandscapeRight</string>
</array>

<!-- 추가된 항목 -->
<key>NSHumanReadableCopyright</key>
<string>© 2025 easyhooon</string>

Expand Down