Browse Source

added almost there screen

PankajBranch^2
Hemant Khadase 2 years ago
parent
commit
c3efb29cdf
5 changed files with 409 additions and 0 deletions
  1. +71
    -0
      app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/AlmostThereFragment.kt
  2. +314
    -0
      app/src/main/res/layout/fragment_almost_there.xml
  3. +9
    -0
      app/src/main/res/values-hi-rIN/strings.xml
  4. +6
    -0
      app/src/main/res/values/dimens.xml
  5. +9
    -0
      app/src/main/res/values/strings.xml

+ 71
- 0
app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/AlmostThereFragment.kt View File

@ -0,0 +1,71 @@
package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1
import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.nivesh.production.niveshfd.R
import com.nivesh.production.niveshfd.databinding.FragmentAlmostThereBinding
import com.nivesh.production.niveshfd.databinding.FragmentSignupBinding
import com.nivesh.production.niveshfd.fd.util.Common
class AlmostThereFragment : Fragment() {
private var _binding: FragmentAlmostThereBinding? = null
private val binding get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View {
_binding = FragmentAlmostThereBinding.inflate(inflater, container, false)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
init()
}
private fun init() {
binding.edtMobileNumber.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
Common.removeError(binding.tlMobileNumber)
}
})
binding.btnSignUp.setOnClickListener {
if (validate()) {
}
}
}
private fun validate(): Boolean {
return if (binding.edtMobileNumber.text.toString().isEmpty()) { // EditText
Common.commonErrorMethod(
binding.edtMobileNumber,
binding.tlMobileNumber,
getString(R.string.emptyMobileNumber)
)
} else if (!Common.isIndianMobileNo(binding.edtMobileNumber.text.toString())) { // EditText
Common.commonErrorMethod(
binding.edtMobileNumber,
binding.tlMobileNumber,
getString(R.string.inValidIndianMobileNumber)
)
} else if (binding.edtMobileNumber.text?.length != 10) { // EditText
Common.commonErrorMethod(
binding.edtMobileNumber,
binding.tlMobileNumber,
getString(R.string.inValidMobileNumber)
)
} else {
return true
}
}
}

+ 314
- 0
app/src/main/res/layout/fragment_almost_there.xml View File

@ -0,0 +1,314 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tool="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/margin_90"
android:fillViewport="true"
android:padding="@dimen/margin_15"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/signUp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/margin_10"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent">
<TextView
android:id="@+id/txtSignUp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
android:padding="@dimen/margin_5"
android:text="@string/almostThere"
android:textColor="@color/black"
android:textSize="@dimen/text_size_20"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/btnReferrer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_15"
android:text="@string/moreInfo"
android:textColor="@color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/txtSignUp" />
<!-- Day -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlDay"
app:layout_constraintStart_toStartOf="parent"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="@dimen/margin_100"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_15"
android:hint="@string/day"
android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/btnReferrer">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtDay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:gravity="center"
android:textColorHint="@color/greyColor2"
android:textSize="@dimen/text_size_14"
tool:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<!-- Month -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlMonth"
app:layout_constraintStart_toEndOf="@+id/tlDay"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="@dimen/margin_100"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_5"
android:layout_marginTop="@dimen/margin_15"
android:hint="@string/month"
android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/btnReferrer">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtMonth"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:gravity="center"
android:textColorHint="@color/greyColor2"
android:textSize="@dimen/text_size_14"
tool:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<!-- Year -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlYear"
app:layout_constraintStart_toEndOf="@+id/tlMonth"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="@dimen/margin_150"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_5"
android:layout_marginTop="@dimen/margin_15"
android:hint="@string/year"
android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/btnReferrer">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtYear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:gravity="center"
android:textColorHint="@color/greyColor2"
android:textSize="@dimen/text_size_14"
tool:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<!--Full Name -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlFullName"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_5"
android:hint="@string/fullName"
android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/tlDay">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtFullName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:textColorHint="@color/greyColor2"
android:textSize="@dimen/text_size_14"
tool:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<!--Email -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlEmail"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_5"
android:hint="@string/Email"
android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/tlFullName">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:textColorHint="@color/greyColor2"
android:textSize="@dimen/text_size_14"
tool:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<!--Address Line 1 -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlAddressLine1"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_5"
android:hint="@string/AddressLine1"
android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/tlEmail">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtAddressLine1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:textColorHint="@color/greyColor2"
android:textSize="@dimen/text_size_14"
tool:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<!--Address Line 2 -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlAddressLine2"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_5"
android:hint="@string/addressLine2"
android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/tlAddressLine1">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtAddressLine2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:textColorHint="@color/greyColor2"
android:textSize="@dimen/text_size_14"
tool:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<!--PinCode -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlPinCode"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_5"
android:hint="@string/pinCode"
android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/tlAddressLine2">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtPinCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:maxLength="6"
android:textColorHint="@color/greyColor2"
android:textSize="@dimen/text_size_14"
tool:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<!--City -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlCity"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_5"
android:hint="@string/city"
android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/tlPinCode">
<com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/spCity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="none"
android:textColorHint="@color/greyColor2"
android:textSize="@dimen/text_size_14"
tool:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<!--State -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlState"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_5"
android:hint="@string/state"
android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/tlCity">
<com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/spState"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:textColorHint="@color/greyColor2"
android:textSize="@dimen/text_size_14"
tool:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.button.MaterialButton
android:id="@+id/btnBack"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="@dimen/margin_120"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_20"
android:layout_marginBottom="@dimen/margin_20"
android:text="@string/back"
android:backgroundTint="@color/white"
android:textColor="@color/red"
app:cornerRadius="@dimen/margin_15"
app:layout_constraintStart_toStartOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btnNext"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="@dimen/margin_200"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_30"
android:layout_marginBottom="@dimen/margin_20"
android:layout_marginEnd="@dimen/margin_20"
android:text="@string/next"
android:textColor="@color/white"
android:backgroundTint="@color/red"
app:cornerRadius="@dimen/margin_15"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/btnBack" />
</androidx.constraintlayout.widget.ConstraintLayout>

+ 9
- 0
app/src/main/res/values-hi-rIN/strings.xml View File

@ -276,6 +276,15 @@
<string name="mobileNumber">Mobile Number</string>
<string name="signUp">Sign Up</string>
<string name="continueText">CONTINUE</string>
<string name="almostThere">Almost There</string>
<string name="moreInfo">We need some basic information about you to help you personalize your experience better!</string>
<string name="fullName">Full Name</string>
<string name="Email">Email</string>
<string name="AddressLine1">Address Line 1</string>
<string name="addressLine2">Address Line 2 (Optional) </string>
<string name="day">DD</string>
<string name="month">MM</string>
<string name="year">YYYY</string>
</resources>

+ 6
- 0
app/src/main/res/values/dimens.xml View File

@ -70,10 +70,16 @@
<dimen name="margin_90">90dp</dimen>
<dimen name="margin_95">95dp</dimen>
<dimen name="margin_100">100dp</dimen>
<dimen name="margin_110">110dp</dimen>
<dimen name="margin_120">120dp</dimen>
<dimen name="margin_130">130dp</dimen>
<dimen name="margin_140">140dp</dimen>
<dimen name="margin_150">150dp</dimen>
<dimen name="margin_160">160dp</dimen>
<dimen name="margin_170">170dp</dimen>
<dimen name="margin_180">180dp</dimen>
<dimen name="margin_190">190dp</dimen>
<dimen name="margin_200">200dp</dimen>
<dimen name="margin_290">290dp</dimen>
<dimen name="margin_300">300dp</dimen>


+ 9
- 0
app/src/main/res/values/strings.xml View File

@ -283,6 +283,15 @@
<string name="mobileNumber">Mobile Number</string>
<string name="signUp">Sign Up</string>
<string name="continueText">CONTINUE</string>
<string name="almostThere">Almost There</string>
<string name="moreInfo">We need some basic information about you to help you personalize your experience better!</string>
<string name="fullName">Full Name</string>
<string name="Email">Email</string>
<string name="AddressLine1">Address Line 1</string>
<string name="addressLine2">Address Line 2 (Optional) </string>
<string name="day">DD</string>
<string name="month">MM</string>
<string name="year">YYYY</string>
</resources>

Loading…
Cancel
Save

Powered by TurnKey Linux.