fix register address

This commit is contained in:
shaulascr
2025-08-23 00:02:30 +07:00
parent 16a0a33f11
commit b3d2527ebc
3 changed files with 3 additions and 48 deletions

View File

@ -381,36 +381,4 @@ class RegisterStep2Fragment : Fragment() {
Log.d(TAG, "onDetach - final cleanup")
stopTimer()
}
}
// override fun onDestroyView() {
// super.onDestroyView()
// countDownTimer?.cancel()
// _binding = null
// }
// private fun startResendCooldown() {
// Log.d(TAG, "startResendCooldown called")
// timeRemaining = 30
// binding.tvResendOtp.isEnabled = false
// binding.tvResendOtp.setTextColor(ContextCompat.getColor(requireContext(), R.color.soft_gray))
//
// countDownTimer?.cancel()
// countDownTimer = object : CountDownTimer(30000, 1000) {
// override fun onTick(millisUntilFinished: Long) {
// timeRemaining = (millisUntilFinished / 1000).toInt()
// binding.tvTimer.text = "Kirim ulang OTP dalam waktu 00:${String.format("%02d", timeRemaining)}"
// if (timeRemaining % 5 == 0) {
// Log.d(TAG, "Cooldown remaining: $timeRemaining seconds")
// }
// }
//
// override fun onFinish() {
// Log.d(TAG, "Cooldown finished, enabling resend button")
// binding.tvTimer.text = "Dapat mengirim ulang kode OTP"
// binding.tvResendOtp.isEnabled = true
// binding.tvResendOtp.setTextColor(ContextCompat.getColor(requireContext(), R.color.blue1))
// timeRemaining = 0
// }
// }.start()
// }
}

View File

@ -96,19 +96,11 @@ class RegisterStep3Fragment : Fragment() {
Log.d(TAG, "Auto-filled name: ${it.name}, phone: ${it.phone}")
}
// Set up province and city dropdowns
setupAutoComplete()
setupEdgeToEdge()
// Set up button listeners
binding.btnPrevious.setOnClickListener {
// Go back to the previous step
// parentFragmentManager.popBackStack()
// (activity as? RegisterActivity)?.navigateToStep(2, null)
// (activity as? RegisterActivity)?.goBackToPreviousStep()
// Option 2: Direct navigation to step 1
val step2Fragment = RegisterStep2Fragment()
parentFragmentManager.beginTransaction()
.replace(R.id.fragment_container, step2Fragment)
@ -117,14 +109,8 @@ class RegisterStep3Fragment : Fragment() {
binding.btnRegister.setOnClickListener {
submitAddress()
sessionManager.clearAll()
}
// If user skips address entry
// binding.btnSkip.setOnClickListener {
// showRegistrationSuccess()
// }
// Observe address submission state
observeAddressSubmissionState()
@ -513,6 +499,7 @@ class RegisterStep3Fragment : Fragment() {
private fun showRegistrationSuccess() {
// Now we can show the success message for the overall registration process
Toast.makeText(requireContext(), "Berhasil mendaftarkan akun", Toast.LENGTH_LONG).show()
sessionManager.clearAll()
// Navigate to login screen
startActivity(Intent(requireContext(), LoginActivity::class.java))

View File

@ -261,7 +261,7 @@
android:id="@+id/btn_register"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_margin="16dp"
android:layout_marginHorizontal="16dp"
android:background="@drawable/button_address_background"
android:text="@string/signup"
android:textAllCaps="false"