diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/GetStartedFragment.kt b/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/GetStartedFragment.kt new file mode 100644 index 0000000..167d224 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/GetStartedFragment.kt @@ -0,0 +1,57 @@ +package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1 + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.nivesh.production.niveshfd.R + +private const val ARG_PARAM1 = "param1" +private const val ARG_PARAM2 = "param2" + +class GetStartedFragment : BaseFragment() { + // TODO: Rename and change types of parameters + private var param1: String? = null + private var param2: String? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + arguments?.let { + param1 = it.getString(ARG_PARAM1) + param2 = it.getString(ARG_PARAM2) + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_get_started, container, false) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + } + + companion object { + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment GetStarted. + */ + // TODO: Rename and change types and number of parameters + @JvmStatic + fun newInstance(param1: String, param2: String) = + GetStartedFragment().apply { + arguments = Bundle().apply { + putString(ARG_PARAM1, param1) + putString(ARG_PARAM2, param2) + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/OTPFragment.kt b/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/OTPFragment.kt index 0286ec1..deb6507 100644 --- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/OTPFragment.kt +++ b/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/OTPFragment.kt @@ -2,6 +2,7 @@ package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1 import android.os.Bundle import android.text.Editable +import android.text.InputFilter import android.text.TextWatcher import android.view.KeyEvent import android.view.LayoutInflater @@ -11,10 +12,10 @@ import android.widget.EditText import androidx.fragment.app.Fragment import com.nivesh.production.niveshfd.R import com.nivesh.production.niveshfd.databinding.FragmentOtpBinding -import com.nivesh.production.niveshfd.databinding.FragmentSignupBinding +import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity import com.nivesh.production.niveshfd.fd.util.Common -class OTPFragment : Fragment() { +class OTPFragment : BaseFragment() { private var _binding: FragmentOtpBinding? = null private val binding get() = _binding!! @@ -31,6 +32,14 @@ class OTPFragment : Fragment() { } private fun init() { + + binding.edtOTP1.filters = arrayOf(InputFilter.LengthFilter(1)) + binding.edtOTP2.filters = arrayOf(InputFilter.LengthFilter(1)) + binding.edtOTP3.filters = arrayOf(InputFilter.LengthFilter(1)) + binding.edtOTP4.filters = arrayOf(InputFilter.LengthFilter(1)) + binding.edtOTP5.filters = arrayOf(InputFilter.LengthFilter(1)) + binding.edtOTP6.filters = arrayOf(InputFilter.LengthFilter(1)) + binding.edtOTP1.addTextChangedListener(GenericTextWatcher(binding.edtOTP1, binding.edtOTP2)) binding.edtOTP2.addTextChangedListener(GenericTextWatcher(binding.edtOTP2, binding.edtOTP3)) binding.edtOTP3.addTextChangedListener(GenericTextWatcher(binding.edtOTP3, binding.edtOTP4)) @@ -41,19 +50,72 @@ class OTPFragment : Fragment() { binding.edtOTP1.setOnKeyListener(GenericKeyEvent(binding.edtOTP1, null)) binding.edtOTP2.setOnKeyListener(GenericKeyEvent(binding.edtOTP2, binding.edtOTP1)) binding.edtOTP3.setOnKeyListener(GenericKeyEvent(binding.edtOTP3, binding.edtOTP2)) - binding.edtOTP4.setOnKeyListener(GenericKeyEvent(binding.edtOTP4,binding.edtOTP3)) - binding.edtOTP5.setOnKeyListener(GenericKeyEvent(binding.edtOTP5,binding.edtOTP4)) - binding.edtOTP6.setOnKeyListener(GenericKeyEvent(binding.edtOTP6,binding.edtOTP5)) + binding.edtOTP4.setOnKeyListener(GenericKeyEvent(binding.edtOTP4, binding.edtOTP3)) + binding.edtOTP5.setOnKeyListener(GenericKeyEvent(binding.edtOTP5, binding.edtOTP4)) + binding.edtOTP6.setOnKeyListener(GenericKeyEvent(binding.edtOTP6, binding.edtOTP5)) + + binding.txtDigit.text = getString(R.string.sixDigitOTP).plus(" ").plus("+91.00000.00000") + + binding.txtResendOTP.setOnClickListener{ + + } + + binding.btnSubmit.setOnClickListener { + if (validate()) { + replaceFragment(activity as BaseActivity, R.id.signUpContainer,GetStartedFragment(),"GET STARTED", true) + } + } } private fun validate(): Boolean { - return false; + return if (binding.edtOTP1.text.toString().isEmpty()) { // EditText + Common.commonErrorMethod( + binding.edtOTP1, + binding.tlOTP1, + "" + ) + } else if (binding.edtOTP2.text.toString().isEmpty()) { // EditText + Common.commonErrorMethod( + binding.edtOTP2, + binding.tlOTP2, + "" + ) + } else if (binding.edtOTP3.text.toString().isEmpty()) { // EditText + Common.commonErrorMethod( + binding.edtOTP3, + binding.tlOTP3, + "" + ) + } else if (binding.edtOTP4.text.toString().isEmpty()) { // EditText + Common.commonErrorMethod( + binding.edtOTP4, + binding.tlOTP4, + "" + ) + } else if (binding.edtOTP5.text.toString().isEmpty()) { // EditText + Common.commonErrorMethod( + binding.edtOTP5, + binding.tlOTP5, + "" + ) + } else if (binding.edtOTP6.text.toString().isEmpty()) { // EditText + Common.commonErrorMethod( + binding.edtOTP6, + binding.tlOTP6, + "" + ) + } else { + return true + } } - class GenericKeyEvent internal constructor(private val currentView: EditText, private val previousView: EditText?) : View.OnKeyListener{ + class GenericKeyEvent internal constructor( + private val currentView: EditText, + private val previousView: EditText? + ) : View.OnKeyListener { override fun onKey(p0: View?, keyCode: Int, event: KeyEvent?): Boolean { - if(event!!.action == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_DEL && currentView.id != R.id.edtOTP1 && currentView.text.isEmpty()) { + if (event!!.action == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_DEL && currentView.id != R.id.edtOTP1 && currentView.text.isEmpty()) { //If current is empty then previous EditText's number will also be deleted previousView!!.text = null previousView.requestFocus() @@ -63,7 +125,10 @@ class OTPFragment : Fragment() { } } - class GenericTextWatcher internal constructor(private val currentView: View, private val nextView: View?) : TextWatcher { + class GenericTextWatcher internal constructor( + private val currentView: View, + private val nextView: View? + ) : TextWatcher { override fun afterTextChanged(editable: Editable) { // TODO Auto-generated method stub val text = editable.toString() when (currentView.id) { @@ -95,4 +160,5 @@ class OTPFragment : Fragment() { } + } \ No newline at end of file diff --git a/app/src/main/res/drawable/rounded_view.xml b/app/src/main/res/drawable/rounded_view.xml new file mode 100644 index 0000000..32a1927 --- /dev/null +++ b/app/src/main/res/drawable/rounded_view.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/upload_background.xml b/app/src/main/res/drawable/upload_background.xml new file mode 100644 index 0000000..6a02ce4 --- /dev/null +++ b/app/src/main/res/drawable/upload_background.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_get_started.xml b/app/src/main/res/layout/fragment_get_started.xml new file mode 100644 index 0000000..f9659bc --- /dev/null +++ b/app/src/main/res/layout/fragment_get_started.xml @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +` + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_otp.xml b/app/src/main/res/layout/fragment_otp.xml index c19aa05..b059591 100644 --- a/app/src/main/res/layout/fragment_otp.xml +++ b/app/src/main/res/layout/fragment_otp.xml @@ -4,15 +4,15 @@ xmlns:tool="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:id="@+id/containerOTP" android:orientation="vertical"> @@ -21,7 +21,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="@dimen/margin_5" - android:text="We sent a code to your mobile number" + android:text="@string/mobNoText" android:textColor="@color/black" android:textSize="@dimen/text_size_20" android:textStyle="bold" @@ -33,153 +33,258 @@ android:id="@+id/txtDigit" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginStart="@dimen/margin_10" android:layout_marginTop="@dimen/margin_5" - android:text="Enter the 6-digit verification code sent to +91-00000-00000" android:textColor="@color/black" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/txtSignUp" /> - + + + + + app:layout_constraintTop_toBottomOf="@+id/txtCode"> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> + tool:ignore="TextContrastCheck,SpeakableTextPresentCheck" /> + + app:layout_constraintStart_toEndOf="@+id/tlOTP1" + app:layout_constraintTop_toTopOf="parent"> + tool:ignore="TextContrastCheck,SpeakableTextPresentCheck" /> + + android:gravity="center" + app:layout_constraintStart_toEndOf="@+id/tlOTP2" + app:layout_constraintTop_toTopOf="parent"> + tool:ignore="TextContrastCheck,SpeakableTextPresentCheck" /> + + android:gravity="center" + app:layout_constraintStart_toEndOf="@+id/tlOTP3" + app:layout_constraintTop_toTopOf="parent"> + tool:ignore="TextContrastCheck,SpeakableTextPresentCheck" /> + + app:layout_constraintStart_toEndOf="@+id/tlOTP4" + app:layout_constraintTop_toTopOf="parent"> + tool:ignore="TextContrastCheck,SpeakableTextPresentCheck" /> + + app:layout_constraintStart_toEndOf="@+id/tlOTP5" + app:layout_constraintTop_toTopOf="parent"> + tool:ignore="TextContrastCheck,SpeakableTextPresentCheck,TouchTargetSizeCheck" /> - + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-hi-rIN/strings.xml b/app/src/main/res/values-hi-rIN/strings.xml index 5ad78e7..ba1f748 100644 --- a/app/src/main/res/values-hi-rIN/strings.xml +++ b/app/src/main/res/values-hi-rIN/strings.xml @@ -276,6 +276,39 @@ Mobile Number Sign Up CONTINUE - + Almost There + We need some basic information about you to help you personalize your experience better! + Full Name + Email + Address Line 1 + Address Line 2 (Optional) + DD + MM + YYYY + By clicking on next, you agree to accept our + terms and conditions, + and + privacy policy + 0123456789 + Agreement + Up Next: Home + abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ + Please enter valid OTP + Enter the 6-digit verification code sent to + SUBMIT + This session will end in 30 seconds. + Didn\'t get the OTP + RESEND OTP + We sent a code to your mobile number + Change + Code + Skip + Enter PAN Card Number + Full name as on Pan card + Enter your ARN number + Let’s get started + SAVE DRAFT + Format (.png or .jpg) + Hello blank fragment \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index dfdeb6d..0ba9ee0 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -13,6 +13,10 @@ #1F5ACE #00000000 #5077FF + #006BFF + + + #E92629 #323131 #757575 @@ -20,8 +24,6 @@ #E6EBE0 #303030 - #E92629 - #FF03DAC5 #FF018786 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5801789..3845d2a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -262,8 +262,6 @@ Sorry! We are not serving NRI residents at present. - - enter Mobile or Email enter Password @@ -283,7 +281,41 @@ Mobile Number Sign Up CONTINUE + Almost There + We need some basic information about you to help you personalize your experience better! + Full Name + Email + Address Line 1 + Address Line 2 (Optional) + DD + MM + YYYY + By clicking on next, you agree to accept our + terms and conditions, + and + privacy policy + 0123456789 + Agreement + Up Next: Home + abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ + Please enter valid OTP + Enter the 6-digit verification code sent to + SUBMIT + This session will end in 30 seconds. + Didn\'t get the OTP + RESEND OTP + We sent a code to your mobile number + Change + Code Skip + + Hello blank fragment + Enter PAN Card Number + Full name as on Pan card + Enter your ARN number + Let’s get started + SAVE DRAFT + Format (.png or .jpg) \ No newline at end of file