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

[FIX/#194] 온보딩 플로우 전화번호 입력 제거 #195

Merged
merged 2 commits into from
Dec 11, 2024
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
Expand Up @@ -9,8 +9,8 @@ object Constants {
const val minSdk = 28
const val targetSdk = 34

const val versionCode = 23
const val versionName = "2.1.0"
const val versionCode = 24
const val versionName = "2.1.1"

const val jvmVersion = "17"
val JAVA_VERSION = JavaVersion.VERSION_17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class SignupActivity : BaseActivity<ActivitySignupBinding>(R.layout.activity_sig
initSubmitBtnListener()
observePostSignupState()
observeYearInputState()
observePhoneInputState()
}

private fun initView() {
Expand All @@ -54,9 +53,7 @@ class SignupActivity : BaseActivity<ActivitySignupBinding>(R.layout.activity_sig
when (state) {
is UiState.Success -> {
setAmplitudeUserProperty(state)
Intent(this, OnboardingActivity::class.java).apply {
startActivity(this)
}
startActivity(Intent(this, OnboardingActivity::class.java))
finish()
}

Expand All @@ -69,18 +66,7 @@ class SignupActivity : BaseActivity<ActivitySignupBinding>(R.layout.activity_sig
private fun observeYearInputState() {
viewModel.isYearAllSelected.flowWithLifecycle(lifecycle).distinctUntilChanged()
.onEach { isAllSelected ->
if (isAllSelected) {
hideKeyboard(binding.root)
}
}.launchIn(lifecycleScope)
}

private fun observePhoneInputState() {
viewModel.isPhoneAllSelected.flowWithLifecycle(lifecycle).distinctUntilChanged()
.onEach { isAllSelected ->
if (isAllSelected) {
hideKeyboard(binding.root)
}
if (isAllSelected) hideKeyboard(binding.root)
}.launchIn(lifecycleScope)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ constructor(
private val _isYearAllSelected = MutableStateFlow<Boolean>(false)
val isYearAllSelected: StateFlow<Boolean> = _isYearAllSelected

val selectedPhone = MutableLiveData<String?>()
val isPhoneSelected = MutableLiveData<Boolean>(false)

private val _isPhoneAllSelected = MutableStateFlow<Boolean>(false)
val isPhoneAllSelected: StateFlow<Boolean> = _isPhoneAllSelected

val isAllSelected = MutableLiveData<Boolean>(false)

private val _postSignupState = MutableStateFlow<UiState<SignUpUserModel>>(UiState.Empty)
Expand All @@ -55,11 +49,6 @@ constructor(
checkAllSelected()
}

fun checkPhone() {
isPhoneSelected.value = selectedPhone.value?.isNotEmpty()
_isPhoneAllSelected.value = selectedPhone.value?.length == 11
}

private fun checkAllSelected() {
isAllSelected.value = isGenderSelected.value == true && isYearAllSelected.value == true
}
Expand All @@ -71,7 +60,7 @@ constructor(
SignupRequestModel(
selectedYear.value.toString(),
selectedGender.value.toString(),
selectedPhone.value
null
),
).onSuccess {
userRepository.setUserRole(ROLE_USER)
Expand Down
44 changes: 0 additions & 44 deletions presentation/src/main/res/layout/activity_signup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,50 +204,6 @@
app:layout_constraintTop_toBottomOf="@id/et_signup_birth_year"
tools:background="@drawable/shape_green_gradation_fill_100_rect" />

<TextView
android:id="@+id/tv_signup_phone_title"
style="@style/TextAppearance.Genti.Body_14_Bold"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:gravity="center"
android:text="@string/signup_tv_phone_title"
android:textColor="@color/genti_green"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/et_signup_birth_year" />

<EditText
android:id="@+id/et_signup_phone_year"
style="@style/TextAppearance.Genti.Subtitle2_16_Bold"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:afterTextChanged="@{(text) -> vm.checkPhone()}"
android:background="@null"
android:gravity="center"
android:hint="@string/signup_tv_phone_hint"
android:inputType="phone"
android:maxLength="11"
android:paddingVertical="16dp"
android:text="@={vm.selectedPhone}"
android:textColor="@color/white"
android:textColorHint="@color/white_40"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_signup_phone_title" />

<View
android:layout_width="0dp"
android:layout_height="4dp"
android:layout_marginHorizontal="41dp"
android:layout_marginTop="-8dp"
android:background="@{vm.isPhoneSelected ? @drawable/shape_green_gradation_fill_100_rect : @drawable/shape_white40_fill_100_rect}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/et_signup_phone_year"
tools:background="@drawable/shape_green_gradation_fill_100_rect" />


</androidx.constraintlayout.widget.ConstraintLayout>

<TextView
Expand Down
Loading