Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

가게 등록 기능 마무리 #300

Merged
merged 2 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Expand Up @@ -57,9 +57,10 @@ fun FinalCheckStoreScreen(

FinalCheckStoreScreenImpl(
state = state,
goToFinishScreen = {
navigateToFinishScreen = {
viewModel.registerStore()
}
},
onBackPressed = onBackPressed
)

HandleSideEffects(viewModel, navigateToFinishScreen)
Expand All @@ -69,7 +70,7 @@ fun FinalCheckStoreScreen(
@Composable
fun FinalCheckStoreScreenImpl(
modifier: Modifier = Modifier,
goToFinishScreen: () -> Unit = {},
navigateToFinishScreen: () -> Unit = {},
onBackPressed: () -> Unit = {},
state: FinalCheckStoreScreenState = FinalCheckStoreScreenState()
) {
Expand Down Expand Up @@ -125,7 +126,7 @@ fun FinalCheckStoreScreenImpl(
item {
NameTextField(
textString = stringResource(id = R.string.category),
outputString = state.storeCategory.toString(),
outputString = state.storeCategory.toCategory(),
paddingTopValue = 32.dp
)
}
Expand Down Expand Up @@ -235,7 +236,7 @@ fun FinalCheckStoreScreenImpl(

item {
Button(
onClick = goToFinishScreen,
onClick = navigateToFinishScreen,
colors = ButtonDefaults.buttonColors(ColorPrimary),
shape = RectangleShape,
modifier = Modifier
Expand Down Expand Up @@ -312,8 +313,7 @@ private fun HandleSideEffects(viewModel: FinalCheckStoreScreenViewModel, navigat
viewModel.collectSideEffect { sideEffect ->
when (sideEffect) {
is FinalCheckStoreScreenSideEffect.GoToFinishScreen -> navigateToFinishScreen()
is FinalCheckStoreScreenSideEffect.GoToFinishScreen -> ToastUtil.getInstance().makeShort(R.string.insert_store_null_store_phone_number)
else -> {}
is FinalCheckStoreScreenSideEffect.FailRegisterStore -> ToastUtil.getInstance().makeShort(R.string.insert_store_fail_register_store)
}
}
}
Expand All @@ -325,4 +325,19 @@ fun PreviewStartInsertScreen(){
FinalCheckStoreScreenImpl(
modifier = Modifier
)
}

fun Int.toCategory() :String{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stringResource에 등록해서 사용해주세요.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 저 코드는 사용하지 않는 코드입니다! 지웠는데 어째서인지 남아있네요...

return when(this){
2 -> "치킨"
3 -> "피자"
4 -> "도시락"
5 -> "족발"
6 -> "중국집"
7 -> "일반음식점"
8 -> "카페"
9 -> "뷰"
10 -> "기타/콜벤"
else -> "전체보기"
hsgo2430 marked this conversation as resolved.
Show resolved Hide resolved
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package `in`.koreatech.business.feature.insertstore.finalcheckstore

import `in`.koreatech.business.feature.insertstore.selectcategory.SelectCategoryScreenSideEffect

sealed class FinalCheckStoreScreenSideEffect {
object GoToFinishScreen: FinalCheckStoreScreenSideEffect()
object FailRegisterStore: FinalCheckStoreScreenSideEffect()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
package `in`.koreatech.business.feature.insertstore.finishregisterstore

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material.Button
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import `in`.koreatech.koin.core.R
import `in`.koreatech.business.ui.theme.Blue1
import `in`.koreatech.business.ui.theme.ColorPrimary

@Composable
fun FinishRegisterScreen(
modifier: Modifier = Modifier,
goToMainScreen: () -> Unit,
onBackPressed: () -> Unit
) {
Column(
modifier = modifier.fillMaxSize()
) {
Box(
modifier = modifier
.padding(top = 56.dp, start = 10.dp , bottom = 18.dp)
.width(40.dp)
.height(40.dp)
.clickable { onBackPressed }

) {
Image(
painter = painterResource(R.drawable.ic_arrow_left),
contentDescription = "backArrow",
modifier = modifier
.width(40.dp)
.height(40.dp)
.clickable { }
)
}

Image(
painter = painterResource(id = R.drawable.ic_finish_check),
contentDescription = "finish_mark",
alignment = Alignment.Center,
modifier = modifier
.fillMaxWidth()
.padding(top = 103.dp, bottom = 30.dp)
.height(55.dp)
.width(55.dp)
)

Text(
text = stringResource(R.string.insert_store_finish),
fontSize = 24.sp,
color = ColorPrimary,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Center,
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 46.dp)
.padding(bottom = 16.dp)
)

Text(
text = stringResource(R.string.insert_store_finish_guide),
fontSize = 16.sp,
color = Blue1,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Center,
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 46.dp)
.padding(bottom = 51.dp)
)

Button(
onClick = goToMainScreen,
colors = ButtonDefaults.buttonColors(ColorPrimary),
shape = RectangleShape,
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 33.dp)
.height(44.dp)
) {
Text(
text = stringResource(id = R.string.go_to_main_screen),
fontSize = 15.sp,
fontWeight = FontWeight.Bold,
color = Color.White
)
}
}
}


@Preview
@Composable
fun PreviewStartInsertScreen(){
FinishRegisterScreen(
modifier = Modifier,
goToMainScreen = {} ,
onBackPressed = {}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.navigation.compose.rememberNavController
import androidx.navigation.navArgument
import `in`.koreatech.business.feature.insertstore.finalcheckstore.FinalCheckStoreScreen
import `in`.koreatech.business.feature.insertstore.finalcheckstore.FinalCheckStoreScreenImpl
import `in`.koreatech.business.feature.insertstore.finishregisterstore.FinishRegisterScreen
import `in`.koreatech.business.feature.insertstore.insertdetailinfo.InsertDetailInfoScreen
import `in`.koreatech.business.feature.insertstore.insertdetailinfo.InsertDetailInfoScreenState
import `in`.koreatech.business.feature.insertstore.insertdetailinfo.InsertDetailInfoScreenViewModel
Expand Down Expand Up @@ -131,7 +132,22 @@ fun InsertStoreNavigator(
onBackPressed = {
navController.navigateUp()
},
navigateToFinishScreen = {}
navigateToFinishScreen = {
navController.navigate(InsertStoreRoute.FINISH_SCREEN.name)
}
)
}

composable(
route = InsertStoreRoute.FINISH_SCREEN.name,
) {
FinishRegisterScreen(
goToMainScreen = {

},
onBackPressed = {
navController.navigateUp()
}
)
}
}
Expand Down
17 changes: 17 additions & 0 deletions core/src/main/res/drawable/ic_finish_check.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="55dp"
android:height="55dp"
android:viewportWidth="55"
android:viewportHeight="55">
<path
android:pathData="M27.5,27.5m-26,0a26,26 0,1 1,52 0a26,26 0,1 1,-52 0"
android:strokeWidth="3"
android:fillColor="#00000000"
android:strokeColor="#F7941E"/>
<path
android:pathData="M14.781,26.813L23.719,35.75L40.219,19.25"
android:strokeWidth="3"
android:fillColor="#00000000"
android:strokeColor="#F7941E"
android:strokeLineCap="round"/>
</vector>
5 changes: 5 additions & 0 deletions core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<string name="day_off">휴일</string>
<string name="store_open_time">개점시간</string>
<string name="store_close_time">폐점시간</string>
<string name="go_to_main_screen">메인 화면 바로가기</string>

<!--left drawer menu -->
<string name="home">홈</string>
Expand Down Expand Up @@ -126,4 +127,8 @@

<string name="insert_store_check_store_info">4. 가게 정보 확인</string>
<string name="insert_store_check_info">입력하신 정보가 맞습니까?</string>
<string name="insert_store_fail_register_store">가게를 등록하는데 실패하였습니다.</string>

<string name="insert_store_finish">가게 등록 완료</string>
<string name="insert_store_finish_guide">가게 등록이 완료되었습니다.\n업체 정보 수정은 내 상점에서 가능합니다.</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class UploadImageLocalDataSource @Inject constructor(
ExifInterface.ORIENTATION_ROTATE_90 -> bitmap?.rotateBitmap(90f)
ExifInterface.ORIENTATION_ROTATE_180 -> bitmap?.rotateBitmap(180f)
ExifInterface.ORIENTATION_ROTATE_270 -> bitmap?.rotateBitmap(270f)
else -> bitmap?.rotateBitmap(90f)
else -> bitmap
}
if(rotatedBitmap != null){
imageBitmap = rotatedBitmap
Expand Down
Loading