Skip to content

Commit 7d51c24

Browse files
committed
REFACTOR: 제보 작성 화면 관련 클래스의 이름을 Report~ 에서 ReportWrite~ 으로 수정
1 parent c5b6797 commit 7d51c24

File tree

7 files changed

+39
-39
lines changed

7 files changed

+39
-39
lines changed

app/src/main/java/com/threegap/bitnagil/MainNavHost.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import com.threegap.bitnagil.presentation.screen.reportdetail.ReportDetailScreen
1717
import com.threegap.bitnagil.presentation.screen.reportdetail.ReportDetailViewModel
1818
import com.threegap.bitnagil.presentation.screen.reportdetail.model.navarg.ReportDetailScreenArg
1919
import com.threegap.bitnagil.presentation.screen.reporthistory.ReportHistoryScreenContainer
20-
import com.threegap.bitnagil.presentation.screen.reportwrite.ReportScreenContainer
20+
import com.threegap.bitnagil.presentation.screen.reportwrite.ReportWriteScreenContainer
2121
import com.threegap.bitnagil.presentation.screen.routinelist.RoutineListScreenContainer
2222
import com.threegap.bitnagil.presentation.screen.routinewrite.WriteRoutineScreenContainer
2323
import com.threegap.bitnagil.presentation.screen.routinewrite.WriteRoutineViewModel
@@ -306,7 +306,7 @@ fun MainNavHost(
306306
}
307307

308308
composable<Route.Report> {
309-
ReportScreenContainer(
309+
ReportWriteScreenContainer(
310310
navigateToBack = {
311311
if (navigator.navController.previousBackStackEntry != null) {
312312
navigator.navController.popBackStack()

presentation/src/main/java/com/threegap/bitnagil/presentation/screen/reportwrite/ReportScreen.kt renamed to presentation/src/main/java/com/threegap/bitnagil/presentation/screen/reportwrite/ReportWriteScreen.kt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ import com.threegap.bitnagil.presentation.screen.reportwrite.component.ReportCat
6262
import com.threegap.bitnagil.presentation.screen.reportwrite.component.ReportField
6363
import com.threegap.bitnagil.presentation.screen.reportwrite.component.template.CompleteReportContent
6464
import com.threegap.bitnagil.presentation.screen.reportwrite.component.template.SubmittingReportContent
65-
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportSideEffect
66-
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportState
67-
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportState.Companion.MAX_IMAGE_COUNT
65+
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportWriteSideEffect
66+
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportWriteState
67+
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportWriteState.Companion.MAX_IMAGE_COUNT
6868
import com.threegap.bitnagil.presentation.screen.reportwrite.model.SubmitState
6969
import com.threegap.bitnagil.presentation.util.file.createCameraImageUri
7070
import com.threegap.bitnagil.presentation.util.permission.rememberPermissionHandler
@@ -74,18 +74,18 @@ import org.orbitmvi.orbit.compose.collectSideEffect
7474

7575
@OptIn(ExperimentalMaterial3Api::class, ExperimentalPermissionsApi::class)
7676
@Composable
77-
fun ReportScreenContainer(
77+
fun ReportWriteScreenContainer(
7878
navigateToBack: () -> Unit,
79-
viewModel: ReportViewModel = hiltViewModel(),
79+
viewModel: ReportWriteViewModel = hiltViewModel(),
8080
) {
8181
val context = LocalContext.current
8282
val uiState by viewModel.collectAsState()
8383
val contentFocusRequester = remember { FocusRequester() }
8484

8585
viewModel.collectSideEffect { sideEffect ->
8686
when (sideEffect) {
87-
is ReportSideEffect.NavigateToBack -> navigateToBack()
88-
is ReportSideEffect.FocusOnContent -> {
87+
is ReportWriteSideEffect.NavigateToBack -> navigateToBack()
88+
is ReportWriteSideEffect.FocusOnContent -> {
8989
delay(100)
9090
contentFocusRequester.requestFocus()
9191
}
@@ -175,7 +175,7 @@ fun ReportScreenContainer(
175175
) { submitState ->
176176
when (submitState) {
177177
SubmitState.IDLE -> {
178-
ReportScreen(
178+
ReportWriteScreen(
179179
uiState = uiState,
180180
contentFocusRequester = contentFocusRequester,
181181
onReportTitleChange = viewModel::updateReportTitle,
@@ -201,8 +201,8 @@ fun ReportScreenContainer(
201201

202202
@OptIn(ExperimentalMaterial3Api::class)
203203
@Composable
204-
private fun ReportScreen(
205-
uiState: ReportState,
204+
private fun ReportWriteScreen(
205+
uiState: ReportWriteState,
206206
contentFocusRequester: FocusRequester,
207207
onReportTitleChange: (String) -> Unit,
208208
onReportContentChange: (String) -> Unit,
@@ -281,7 +281,7 @@ private fun ReportScreen(
281281
)
282282

283283
Text(
284-
text = "${uiState.reportTitle.length} / ${ReportState.MAX_TITLE_LENGTH}",
284+
text = "${uiState.reportTitle.length} / ${ReportWriteState.MAX_TITLE_LENGTH}",
285285
style = BitnagilTheme.typography.caption1Medium,
286286
color = BitnagilTheme.colors.coolGray80,
287287
textAlign = TextAlign.End,
@@ -315,7 +315,7 @@ private fun ReportScreen(
315315
),
316316
placeholder = {
317317
Text(
318-
text = "어떤 위험인지 간단히 설명해주세요.(${ReportState.MAX_CONTENT_LENGTH}자 내외)",
318+
text = "어떤 위험인지 간단히 설명해주세요.(${ReportWriteState.MAX_CONTENT_LENGTH}자 내외)",
319319
style = BitnagilTheme.typography.body2Medium,
320320
color = BitnagilTheme.colors.coolGray80,
321321
)
@@ -324,7 +324,7 @@ private fun ReportScreen(
324324
)
325325

326326
Text(
327-
text = "${uiState.reportContent.length} / ${ReportState.MAX_CONTENT_LENGTH}",
327+
text = "${uiState.reportContent.length} / ${ReportWriteState.MAX_CONTENT_LENGTH}",
328328
style = BitnagilTheme.typography.caption1Medium,
329329
color = BitnagilTheme.colors.coolGray80,
330330
textAlign = TextAlign.End,
@@ -358,8 +358,8 @@ private fun ReportScreen(
358358
@Preview(showBackground = true)
359359
@Composable
360360
private fun Preview() {
361-
ReportScreen(
362-
uiState = ReportState.Init,
361+
ReportWriteScreen(
362+
uiState = ReportWriteState.Init,
363363
contentFocusRequester = remember { FocusRequester() },
364364
onReportTitleChange = {},
365365
onReportContentChange = {},

presentation/src/main/java/com/threegap/bitnagil/presentation/screen/reportwrite/ReportViewModel.kt renamed to presentation/src/main/java/com/threegap/bitnagil/presentation/screen/reportwrite/ReportWriteViewModel.kt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import com.threegap.bitnagil.domain.file.usecase.UploadReportImagesUseCase
88
import com.threegap.bitnagil.domain.report.model.Report
99
import com.threegap.bitnagil.domain.report.model.ReportCategory
1010
import com.threegap.bitnagil.domain.report.usecase.SubmitReportUseCase
11-
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportSideEffect
12-
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportState
13-
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportState.Companion.MAX_IMAGE_COUNT
11+
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportWriteSideEffect
12+
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportWriteState
13+
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportWriteState.Companion.MAX_IMAGE_COUNT
1414
import com.threegap.bitnagil.presentation.screen.reportwrite.model.SubmitState
1515
import com.threegap.bitnagil.presentation.util.file.convertUriToImageFile
1616
import dagger.hilt.android.lifecycle.HiltViewModel
@@ -25,25 +25,25 @@ import org.orbitmvi.orbit.viewmodel.container
2525
import javax.inject.Inject
2626

2727
@HiltViewModel
28-
class ReportViewModel @Inject constructor(
28+
class ReportWriteViewModel @Inject constructor(
2929
@ApplicationContext private val context: Context,
3030
private val fetchCurrentAddressUseCase: FetchCurrentAddressUseCase,
3131
private val uploadReportImagesUseCase: UploadReportImagesUseCase,
3232
private val submitReportUseCase: SubmitReportUseCase,
33-
) : ViewModel(), ContainerHost<ReportState, ReportSideEffect> {
33+
) : ViewModel(), ContainerHost<ReportWriteState, ReportWriteSideEffect> {
3434

35-
override val container: Container<ReportState, ReportSideEffect> = container(initialState = ReportState.Init)
35+
override val container: Container<ReportWriteState, ReportWriteSideEffect> = container(initialState = ReportWriteState.Init)
3636

3737
fun updateReportTitle(title: String) {
3838
intent {
39-
if (title.length > ReportState.MAX_TITLE_LENGTH) return@intent
39+
if (title.length > ReportWriteState.MAX_TITLE_LENGTH) return@intent
4040
reduce { state.copy(reportTitle = title) }
4141
}
4242
}
4343

4444
fun updateReportContent(content: String) {
4545
intent {
46-
if (content.length > ReportState.MAX_CONTENT_LENGTH) return@intent
46+
if (content.length > ReportWriteState.MAX_CONTENT_LENGTH) return@intent
4747
reduce { state.copy(reportContent = content) }
4848
}
4949
}
@@ -69,7 +69,7 @@ class ReportViewModel @Inject constructor(
6969
fun hideReportCategoryBottomSheet() {
7070
intent {
7171
reduce { state.copy(reportCategoryBottomSheetVisible = false) }
72-
postSideEffect(ReportSideEffect.FocusOnContent)
72+
postSideEffect(ReportWriteSideEffect.FocusOnContent)
7373
}
7474
}
7575

@@ -116,7 +116,7 @@ class ReportViewModel @Inject constructor(
116116

117117
fun navigateToBack() {
118118
intent {
119-
postSideEffect(ReportSideEffect.NavigateToBack)
119+
postSideEffect(ReportWriteSideEffect.NavigateToBack)
120120
}
121121
}
122122

@@ -131,7 +131,7 @@ class ReportViewModel @Inject constructor(
131131

132132
coroutineScope {
133133
val minDelayJob = async {
134-
delay(timeMillis = ReportState.MIN_LOADING_TIME)
134+
delay(timeMillis = ReportWriteState.MIN_LOADING_TIME)
135135
}
136136

137137
val processingJob = async {

presentation/src/main/java/com/threegap/bitnagil/presentation/screen/reportwrite/component/template/CompleteReportContent.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import com.threegap.bitnagil.designsystem.component.atom.BitnagilIcon
2525
import com.threegap.bitnagil.designsystem.component.atom.BitnagilTextButton
2626
import com.threegap.bitnagil.designsystem.component.atom.BitnagilTextButtonColor
2727
import com.threegap.bitnagil.presentation.screen.reportwrite.component.CompleteReportCard
28-
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportState
28+
import com.threegap.bitnagil.presentation.screen.reportwrite.contract.ReportWriteState
2929

3030
@Composable
3131
fun CompleteReportContent(
32-
uiState: ReportState,
32+
uiState: ReportWriteState,
3333
onConfirmClick: () -> Unit,
3434
modifier: Modifier = Modifier,
3535
) {
@@ -108,7 +108,7 @@ fun CompleteReportContent(
108108
@Composable
109109
private fun Preview() {
110110
CompleteReportContent(
111-
uiState = ReportState.Init,
111+
uiState = ReportWriteState.Init,
112112
onConfirmClick = {},
113113
)
114114
}

presentation/src/main/java/com/threegap/bitnagil/presentation/screen/reportwrite/contract/ReportSideEffect.kt

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.threegap.bitnagil.presentation.screen.reportwrite.contract
2+
3+
sealed interface ReportWriteSideEffect {
4+
data object NavigateToBack : ReportWriteSideEffect
5+
data object FocusOnContent : ReportWriteSideEffect
6+
}

presentation/src/main/java/com/threegap/bitnagil/presentation/screen/reportwrite/contract/ReportState.kt renamed to presentation/src/main/java/com/threegap/bitnagil/presentation/screen/reportwrite/contract/ReportWriteState.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import android.net.Uri
44
import com.threegap.bitnagil.domain.report.model.ReportCategory
55
import com.threegap.bitnagil.presentation.screen.reportwrite.model.SubmitState
66

7-
data class ReportState(
7+
data class ReportWriteState(
88
val reportImages: List<Uri>,
99
val reportTitle: String,
1010
val reportContent: String,
@@ -36,7 +36,7 @@ data class ReportState(
3636

3737
const val MAX_IMAGE_COUNT = 3
3838

39-
val Init = ReportState(
39+
val Init = ReportWriteState(
4040
reportImages = emptyList(),
4141
reportTitle = "",
4242
reportContent = "",

0 commit comments

Comments
 (0)