Skip to content

Commit

Permalink
chore:TOP-96 코딩 컨벤션 체크
Browse files Browse the repository at this point in the history
  • Loading branch information
taewooyo committed Jul 11, 2024
1 parent 29787be commit bdc6476
Show file tree
Hide file tree
Showing 22 changed files with 29 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package tht.feature.signin.religion
import android.os.Bundle
import android.view.View
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
Expand All @@ -18,7 +17,7 @@ import tht.feature.signin.signup.SignupBaseComposeFragment
import tht.feature.signin.signup.SignupRootViewModel

@AndroidEntryPoint
class ReligionFragment: SignupBaseComposeFragment<ReligionViewModel>() {
class ReligionFragment : SignupBaseComposeFragment<ReligionViewModel>() {
override val viewModel: ReligionViewModel by viewModels()

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ data class ReligionUiState(
Extra;

fun toDomain(): SignupUserModel.Religion {
return when(this) {
return when (this) {
None -> SignupUserModel.Religion.NONE
Christianity -> SignupUserModel.Religion.CHRISTIAN
Buddhism -> SignupUserModel.Religion.BUDDHISM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ import androidx.navigation.findNavController
import androidx.navigation.fragment.NavHostFragment
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import tht.core.navigation.HomeNavigation
import tht.core.ui.delegate.viewBinding
import tht.core.ui.extension.repeatOnStarted
import tht.core.ui.extension.showToast
import tht.feature.signin.R
import tht.feature.signin.databinding.ActivitySignupRootBinding
import tht.feature.signin.signup.signupcomplete.SignupCompleteActivity
import javax.inject.Inject

@AndroidEntryPoint
class SignupRootActivity : AppCompatActivity() {
Expand Down Expand Up @@ -118,7 +116,9 @@ class SignupRootActivity : AppCompatActivity() {
}
SignupRootViewModel.SignupRootSideEffect.SuccessSignup -> {
// 회원 가입 이후 지인 차단 기능
findNavController(binding.fcNavHost.id).navigate(R.id.action_locationFragment_to_blockContactsFragment)
findNavController(binding.fcNavHost.id).navigate(
R.id.action_locationFragment_to_blockContactsFragment
)
}
is SignupRootViewModel.SignupRootSideEffect.ShowToast -> {
showToast(it.message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import tht.core.ui.base.SideEffect
import javax.inject.Inject

@HiltViewModel
class BlockContactsViewModel @Inject constructor(

) : BaseStateViewModel<BlockContactsUiState, BlockContactsViewModel.BlockContactsSideEffect>() {
class BlockContactsViewModel @Inject constructor() :
BaseStateViewModel<BlockContactsUiState, BlockContactsViewModel.BlockContactsSideEffect>() {

sealed interface BlockContactsSideEffect : SideEffect {
object NavigateNextScreen : BlockContactsSideEffect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ internal fun BlockContactsScreen(
onClick = onLaterClick,
text = stringResource(id = tht.feature.signin.R.string.later),
enable = btnEnable,
colors = ButtonDefaults.buttonColors(
colors = ButtonDefaults.buttonColors(
backgroundColor = colorResource(id = R.color.black_222222),
contentColor = Color.Transparent,
disabledBackgroundColor = colorResource(id = R.color.black_222222),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import android.view.ContextThemeWrapper
import android.widget.NumberPicker
import tht.feature.signin.R


class HeightSelectNumberPicker @JvmOverloads constructor(
context: Context?,
attrs: AttributeSet? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class HeightViewModel @Inject constructor(
}
}


fun onClickHeightInput() {
viewModelScope.launch {
_uiStateFlow.update { it.copy(heightSelectModalShow = true) }
Expand All @@ -85,7 +84,6 @@ class HeightViewModel @Inject constructor(
}

fun onHeightSelectModalShow() {

}

fun onHeightSelectModalHide() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ internal fun HeightScreen(
HeightSelectModel(
modifier = Modifier.fillMaxSize(),
modalBottomSheetState = modalBottomSheetState,
onSelectHeight = onSelectHeight,
onSelectHeight = onSelectHeight
) {
HeightScreenContent(
modifier = Modifier.fillMaxSize(),
Expand Down Expand Up @@ -140,7 +140,7 @@ private fun HeightScreenContent(
Spacer(modifier = Modifier.height(16.dp))
SignupDescription(
modifier = Modifier.fillMaxWidth(),
description = stringResource(id = tht.feature.signin.R.string.message_can_change_in_my_page),
description = stringResource(id = tht.feature.signin.R.string.message_can_change_in_my_page)
)

Spacer(modifier = Modifier.weight(1f))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class MoreInfoFragment : SignupBaseComposeFragment<MoreInfoViewModel>() {
onDrinkClick = viewModel::onDrinkClick,
onNextClick = viewModel::onNextClick
)

}

override fun setProgress() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class MoreInfoUiState(
SomeTime,
Almost;
fun toDomain(): SignupUserModel.Smoke {
return when(this) {
return when (this) {
None -> SignupUserModel.Smoke.NONE
SomeTime -> SignupUserModel.Smoke.SOMETIMES
Almost -> SignupUserModel.Smoke.FREQUENTLY
Expand All @@ -35,14 +35,14 @@ data class MoreInfoUiState(
SomeTime,
Almost;
fun toDomain(): SignupUserModel.Drink {
return when(this) {
return when (this) {
None -> SignupUserModel.Drink.NONE
SomeTime -> SignupUserModel.Drink.SOMETIMES
Almost -> SignupUserModel.Drink.FREQUENTLY
}
}
companion object {
fun from(drink: SignupUserModel.Drink?): Drink?{
fun from(drink: SignupUserModel.Drink?): Drink? {
return when (drink) {
SignupUserModel.Drink.NONE -> None
SignupUserModel.Drink.SOMETIMES -> SomeTime
Expand All @@ -51,7 +51,6 @@ data class MoreInfoUiState(
}
}
}

}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class MoreInfoViewModel @Inject constructor(
object NavigateNextView : MoreInfoSideEffect
}


override val _uiStateFlow: MutableStateFlow<MoreInfoUiState> = MutableStateFlow(MoreInfoUiState.default)

fun fetchSavedData(phone: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ internal fun MoreInfoScreen(
buildAnnotatedString {
append(context.getString(R.string.title_more_info))
addStyle(
style = SpanStyle(color = Color(context.resources.getColor(tht.core.ui.R.color.white_f9fafa, null))),
style = SpanStyle(
color = Color(context.resources.getColor(tht.core.ui.R.color.white_f9fafa, null))
),
start = 0,
end = 4
)
Expand All @@ -64,14 +66,15 @@ internal fun MoreInfoScreen(
color = colorResource(id = tht.core.ui.R.color.gray_666666)
)


Spacer(modifier = Modifier.height(38.dp))
ThtHeadline4(
text = remember {
buildAnnotatedString {
append(context.getString(R.string.title_smoke_info))
addStyle(
style = SpanStyle(color = Color(context.resources.getColor(tht.core.ui.R.color.white_f9fafa, null))),
style = SpanStyle(
color = Color(context.resources.getColor(tht.core.ui.R.color.white_f9fafa, null))
),
start = 0,
end = 3
)
Expand Down Expand Up @@ -117,7 +120,9 @@ internal fun MoreInfoScreen(
buildAnnotatedString {
append(context.getString(R.string.title_drink_info))
addStyle(
style = SpanStyle(color = Color(context.resources.getColor(tht.core.ui.R.color.white_f9fafa, null))),
style = SpanStyle(
color = Color(context.resources.getColor(tht.core.ui.R.color.white_f9fafa, null))
),
start = 0,
end = 3
)
Expand Down Expand Up @@ -160,7 +165,7 @@ internal fun MoreInfoScreen(
Spacer(modifier = Modifier.height(16.dp))
SignupDescription(
modifier = Modifier.fillMaxWidth(),
description = stringResource(id = R.string.message_can_change_in_my_page),
description = stringResource(id = R.string.message_can_change_in_my_page)
)

Spacer(modifier = Modifier.weight(1f))
Expand All @@ -179,4 +184,3 @@ internal fun MoreInfoScreen(
)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class SignupCompleteActivity : AppCompatActivity() {
}
}


companion object {
fun getIntent(context: Context, phone: String): Intent {
return Intent(context, SignupCompleteActivity::class.java).apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import javax.inject.Inject
class SignupCompleteViewModel @Inject constructor(
savedStateHandle: SavedStateHandle,
fetchSignupUserUseCase: FetchSignupUserUseCase,
private val removeSignupUserUseCase: RemoveSignupUserUseCase,
private val removeSignupUserUseCase: RemoveSignupUserUseCase
) : BaseStateViewModel<SignupCompleteViewModel.SignupCompleteState, SignupCompleteViewModel.SignupSideEffect>() {

private val phone: String? = savedStateHandle[EXTRA_KEY_PHONE]
Expand All @@ -29,7 +29,7 @@ class SignupCompleteViewModel @Inject constructor(
data class SignupCompleteState(
val loading: Boolean,
val profileImage: String?,
val error: Throwable? = null,
val error: Throwable? = null
) : UiState {
companion object {
val default: SignupCompleteState get() = SignupCompleteState(
Expand Down Expand Up @@ -80,7 +80,6 @@ class SignupCompleteViewModel @Inject constructor(
postSideEffect(SignupSideEffect.NavigateMain)
_uiStateFlow.update { it.copy(loading = false) }
}

}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class TermsContentActivity : AppCompatActivity() {
}
}


companion object {
fun getIntent(
context: Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package tht.feature.signin.terms
import android.content.Context
import android.util.AttributeSet
import androidx.constraintlayout.widget.ConstraintLayout
import com.tht.tht.domain.signup.model.TermsModel
import tht.core.ui.delegate.viewBinding
import tht.feature.signin.databinding.ItemTermsContentBinding

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package tht.feature.signin.terms
import android.content.Context
import android.util.AttributeSet
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isVisible
import com.tht.tht.domain.signup.model.TermsModel
import tht.core.ui.delegate.viewBinding
import tht.feature.signin.R
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ import com.example.compose_ui.component.spacer.Spacer
import com.example.compose_ui.component.text.headline.ThtHeadline5
import tht.core.ui.R


@Composable
internal fun SignupLargeSelectButton(
text: String,
isSelect: Boolean,
enable: Boolean,
onClick: () -> Unit,
modifier: Modifier = Modifier,
modifier: Modifier = Modifier
) {
Button(
modifier = modifier.fillMaxWidth(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal fun TermsRow(
) {
Column(
modifier = modifier.noRippleClickable(onClick)
){
) {
Row {
Icon(
modifier = Modifier
Expand Down Expand Up @@ -61,15 +61,14 @@ internal fun TermsRow(
lineHeight = 22.4.sp
)


if (!terms.link.isNullOrBlank()) {
Spacer(space = 12.dp)
Icon(
modifier = Modifier
.widthIn(18.dp)
.align(Alignment.Top)
.clickable(enabled = true, onClick = onRightArrowClick),
painter = painterResource(id = tht.feature.signin.R.drawable.ic_right_arrow_gray) ,
painter = painterResource(id = tht.feature.signin.R.drawable.ic_right_arrow_gray),
contentDescription = "ic_right_arrow_gray",
tint = Color.Unspecified
)
Expand Down Expand Up @@ -137,6 +136,5 @@ private fun TermsRowPreview() {
onClick = {},
onRightArrowClick = {}
)

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ internal fun SignupDescription(
private fun SignupDescriptionPreview() {
SignupDescription(
modifier = Modifier.fillMaxWidth(),
description = "Description",
description = "Description"
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@ private fun SignupSelectableButtonPreview() {
)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ private fun SignupSmallButtonEnablePreview() {
)
}


@Composable
@Preview
private fun SignupSmallButtonPreview() {
Expand Down

0 comments on commit bdc6476

Please sign in to comment.