Skip to content

Commit

Permalink
[chore] 코딩 컨벤션 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
jiwon2724 committed Jul 15, 2024
1 parent 69a57ca commit 58e9c05
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 35 deletions.
4 changes: 0 additions & 4 deletions app/src/main/java/pokitmons/pokit/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import pokitmons.pokit.core.ui.theme.PokitTheme
import pokitmons.pokit.keyword.KeywordScreen
import pokitmons.pokit.navigation.LoginNavHost
import pokitmons.pokit.nickname.InputNicknameScreen
import pokitmons.pokit.success.SignUpSuccessScreen
import pokitmons.pokit.terms.TermsOfServiceScreen

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fun PokitLoginButton(
modifier: Modifier = Modifier,
onClick: () -> Unit,
loginType: PokitLoginButtonType,
text: String
text: String,
) {
val loginResource: PokitLoginResource = getLoginResource(loginType)

Expand Down Expand Up @@ -76,14 +76,14 @@ private fun getLoginResource(loginType: PokitLoginButtonType): PokitLoginResourc
iconTintColor = Color.White,
textColor = Color.White,
backgroundColor = Gray700,
borderColor = Gray700,
borderColor = Gray700
)

PokitLoginButtonType.GOOGLE -> PokitLoginResource(
iconResourceId = R.drawable.icon_24_google,
textColor = Gray900,
backgroundColor = Color.White,
borderColor = Gray200,
borderColor = Gray200
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import pokitmons.pokit.core.ui.R as Ui
import pokitmons.pokit.core.ui.components.atom.button.PokitButton
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize
import pokitmons.pokit.core.ui.components.atom.chip.PokitChip
import pokitmons.pokit.core.ui.components.atom.chip.attributes.PokitChipSize
import pokitmons.pokit.core.ui.theme.PokitTheme
import pokitmons.pokit.core.ui.R as Ui
import pokitmons.pokit.login.R as LoginStringResource

@Composable
fun KeywordScreen(
onNavigateToSignUpScreen:() -> Unit,
popBackStack:() -> Unit
onNavigateToSignUpScreen: () -> Unit,
popBackStack: () -> Unit,
) {
Box(
modifier = Modifier
Expand Down Expand Up @@ -65,7 +65,7 @@ fun KeywordScreen(
stringResource(id = LoginStringResource.string.self_development),
stringResource(id = LoginStringResource.string.humor),
stringResource(id = LoginStringResource.string.music),
stringResource(id = LoginStringResource.string.job_info),
stringResource(id = LoginStringResource.string.job_info)
).chunked(3)

Row {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ fun LoginScreen(
// TODO 서버 api 개발완료 후 viewmodel 연동 및 아키텍처 구축
Box(
modifier = Modifier
.fillMaxSize(),
.fillMaxSize()
) {
Column(
modifier = Modifier
.align(Alignment.BottomCenter)
.padding(start = 20.dp, end = 20.dp, bottom = 32.dp),
.padding(start = 20.dp, end = 20.dp, bottom = 32.dp)
) {
PokitLoginButton(
loginType = PokitLoginButtonType.APPLE,
text = stringResource(id = R.string.apple_login),
onClick = { onNavigateToMainScreen() },
onClick = { onNavigateToMainScreen() }
)

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

PokitLoginButton(
loginType = PokitLoginButtonType.GOOGLE,
text = stringResource(id = R.string.google_login),
onClick = { onNavigateToTermsOfServiceScreen() },
onClick = { onNavigateToTermsOfServiceScreen() }
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fun LoginNavHost() {
composable(route = LoginRoute.LoginScreen.name) {
LoginScreen(
onNavigateToTermsOfServiceScreen = { navController.navigate(route = LoginRoute.TermsOfServiceScreen.name) },
onNavigateToMainScreen = { }, // TODO 메인 화면 구현후 수정
onNavigateToMainScreen = { } // TODO 메인 화면 구현후 수정
)
}

Expand All @@ -47,7 +47,7 @@ fun LoginNavHost() {

composable(route = LoginRoute.SignUpSuccessScreen.name) {
SignUpSuccessScreen(
onNavigateToMainScreen = { }, // TODO 메인 화면 구현후 수정
onNavigateToMainScreen = { } // TODO 메인 화면 구현후 수정
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ private const val NICKNAME_MIN_LENGTH = 1 // TODO 매직넘버를 포함하는
@Composable
fun InputNicknameScreen(
onNavigateToKeywordScreen: () -> Unit,
popBackStack: () -> Unit
popBackStack: () -> Unit,
) {
val inputNicknameViewModel: InputNicknameViewModel = viewModel() // TODO hiltViewModel 마이그레이션 예정
val inputNicknameState by inputNicknameViewModel.inputNicknameState.collectAsState()

Box(modifier = Modifier
.padding(start = 20.dp, end = 20.dp, top = 20.dp, bottom = 28.dp)
.fillMaxSize()
Box(
modifier = Modifier
.padding(start = 20.dp, end = 20.dp, top = 20.dp, bottom = 28.dp)
.fillMaxSize()
) {
Column() {
Icon(
Expand Down Expand Up @@ -74,7 +75,7 @@ fun InputNicknameScreen(
if (text.length <= NICKNAME_MAX_LENGTH) {
inputNicknameViewModel.inputText(text)
}
},
}
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ import pokitmons.pokit.login.R

@Composable
fun SignUpSuccessScreen(
onNavigateToMainScreen: () -> Unit
onNavigateToMainScreen: () -> Unit,
) {
Box(
modifier = Modifier
.padding(all = 20.dp)
.padding(bottom = 8.dp)
) {

Icon(
painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_left),
contentDescription = null
Expand All @@ -45,16 +44,14 @@ fun SignUpSuccessScreen(
.offset(y = (-110).dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
)
{
) {
Image(
painter = painterResource(id = R.drawable.ic_launcher_foreground),
contentDescription = "회원가입 완료 이미지"
)

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


Text(
style = PokitTheme.typography.title1,
text = stringResource(id = R.string.sign_up_success)
Expand All @@ -76,6 +73,7 @@ fun SignUpSuccessScreen(
text = stringResource(id = R.string.next),
icon = null,
size = PokitButtonSize.LARGE,
onClick = { onNavigateToMainScreen() })
onClick = { onNavigateToMainScreen() }
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import pokitmons.pokit.core.ui.theme.PokitTheme
fun TermsCheckBoxItem(
text: String,
isChecked: Boolean,
click:() -> Unit
click: () -> Unit,
) {
Box(modifier = Modifier.fillMaxWidth(),) {
Box(modifier = Modifier.fillMaxWidth()) {
Row(verticalAlignment = Alignment.CenterVertically) {
PokitCheckbox(
checked = isChecked,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ import pokitmons.pokit.login.R
@Composable
fun TermsOfServiceScreen(
onNavigateToInputNicknameScreen: () -> Unit,
popBackStack:() -> Unit,
popBackStack: () -> Unit,
) {
val termsViewModel: TermsViewModel = viewModel() // TODO hiltViewModel 마이그레이션 예정
val termsState by termsViewModel.termsState.collectAsState()

Box(
modifier = Modifier
.fillMaxSize()
.padding(start = 20.dp, end = 20.dp, top = 20.dp, bottom = 28.dp),
.padding(start = 20.dp, end = 20.dp, top = 20.dp, bottom = 28.dp)
) {
Column {
Icon(
painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_left),
contentDescription = "뒤로가기",
modifier = Modifier.clickable { popBackStack() },
modifier = Modifier.clickable { popBackStack() }
)

Spacer(modifier = Modifier.height(32.dp))
Expand Down Expand Up @@ -74,7 +74,7 @@ fun TermsOfServiceScreen(
PokitCheckbox(
style = PokitCheckboxStyle.STROKE,
checked = termsState.isAllChecked,
onClick = { termsViewModel.checkAllTerms() },
onClick = { termsViewModel.checkAllTerms() }
)
Text(
modifier = Modifier.padding(start = 16.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ data class TermsState(
val isAllChecked: Boolean = false,
val isPersonalDataChecked: Boolean = false,
val isServiceChecked: Boolean = false,
val isMarketingChecked: Boolean = false
val isMarketingChecked: Boolean = false,
)

0 comments on commit 58e9c05

Please sign in to comment.