Browse Source

addded Data

master
Manoj 2 years ago
parent
commit
9044e7bc10
17 changed files with 605 additions and 278 deletions
  1. +2
    -3
      app/src/main/AndroidManifest.xml
  2. +58
    -27
      app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/adapters1/NewDistributorSignStepOneAdapter.kt
  3. +16
    -18
      app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/SignUpActivity.kt
  4. +3
    -3
      app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/AlmostThereFragment.kt
  5. +300
    -96
      app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/GetStartedFragment.kt
  6. +10
    -1
      app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/NewDistributorSignStepOne.kt
  7. +10
    -3
      app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/OTPFragment.kt
  8. +9
    -1
      app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/SignUpFragment.kt
  9. +35
    -0
      app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/util/MaskWatcher.kt
  10. +8
    -0
      app/src/main/res/drawable/round_corner_grey_button_fill.xml
  11. +2
    -2
      app/src/main/res/drawable/svg_tik.xml
  12. +107
    -122
      app/src/main/res/layout/fragment_get_started.xml
  13. +29
    -2
      app/src/main/res/layout/new_distributor_sign_step_one_adapter.xml
  14. +5
    -0
      app/src/main/res/values-hi-rIN/strings.xml
  15. +3
    -0
      app/src/main/res/values/colors.xml
  16. +5
    -0
      app/src/main/res/values/strings.xml
  17. +3
    -0
      app/src/main/res/xml/file_paths.xml

+ 2
- 3
app/src/main/AndroidManifest.xml View File

@ -4,8 +4,6 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<!-- <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="ANDROID.PERMISSION.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="ANDROID.PERMISSION.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
@ -13,7 +11,7 @@
<uses-feature <uses-feature
android:name="android.hardware.camera" android:name="android.hardware.camera"
android:required="false" />
android:required="true" />
<uses-feature <uses-feature
android:name="android.hardware.camera.autofocus" android:name="android.hardware.camera.autofocus"
android:required="false" /> android:required="false" />
@ -29,6 +27,7 @@
android:label="@string/appName" android:label="@string/appName"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:requestLegacyExternalStorage="true"
android:theme="@style/Theme.NiveshFDSDK" android:theme="@style/Theme.NiveshFDSDK"
tools:targetApi="31"> tools:targetApi="31">


+ 58
- 27
app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/adapters1/NewDistributorSignStepOneAdapter.kt View File

@ -5,16 +5,22 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.CheckBox import android.widget.CheckBox
import android.widget.LinearLayout
import android.widget.RadioButton
import android.widget.RadioGroup
import android.widget.RelativeLayout import android.widget.RelativeLayout
import android.widget.TextView import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.textfield.TextInputLayout
import com.nivesh.production.niveshfd.R import com.nivesh.production.niveshfd.R
import com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1.NewDistributorSignStepOne
class NewDistributorSignStepOneAdapter(private var listData: MutableList<String>) : class NewDistributorSignStepOneAdapter(private var listData: MutableList<String>) :
RecyclerView.Adapter<NewDistributorSignStepOneAdapter.ViewHolder>() { RecyclerView.Adapter<NewDistributorSignStepOneAdapter.ViewHolder>() {
private var context: Context? = null private var context: Context? = null
private var isPosBroker: Boolean? = false private var isPosBroker: Boolean? = false
private var isPosInsurer: Boolean? = false
var isPosInsurer: Boolean? = false
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
context = parent.context context = parent.context
@ -30,43 +36,65 @@ class NewDistributorSignStepOneAdapter(private var listData: MutableList<String>
if (isChecked) { if (isChecked) {
if (listData[position] == "Insurance") holder.rlInsurance.visibility = View.VISIBLE if (listData[position] == "Insurance") holder.rlInsurance.visibility = View.VISIBLE
else holder.rlInsurance.visibility = View.GONE else holder.rlInsurance.visibility = View.GONE
if (listData[position] == "Other") holder.tlOtherName.visibility = View.VISIBLE
else holder.tlOtherName.visibility = View.GONE
NewDistributorSignStepOne.listMapData = mutableMapOf(position to listData[position])
} else { } else {
holder.rlInsurance.visibility = View.GONE
if (listData[position] == "Insurance")
holder.rlInsurance.visibility = View.GONE
if (listData[position] == "Other")
holder.tlOtherName.visibility = View.GONE
NewDistributorSignStepOne.listMapData?.remove(position)
} }
} }
holder.tvPosInsurer.setOnClickListener { holder.tvPosInsurer.setOnClickListener {
// isPosInsurer?.let { it1 -> setSelected(holder.tvPosInsurer, it1, 0) }
if (isPosInsurer == true) {
holder.tvPosInsurer.setBackgroundResource(R.drawable.round_corner_grey_button)
holder.tvPosInsurer.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0)
holder.tvPosInsurer.compoundDrawablePadding = 0
isPosInsurer = false
} else {
holder.tvPosInsurer.setBackgroundResource(R.drawable.round_corner_grey_button_fill)
holder.tvPosInsurer.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.svg_tik,
0
)
holder.tvPosInsurer.compoundDrawablePadding = 20
isPosInsurer = true
}
} }
holder.tvPOSBroker.setOnClickListener { holder.tvPOSBroker.setOnClickListener {
// isPosBroker?.let { it1 -> setSelected(holder.tvPOSBroker, it1, 1) }
setSelected(holder.tvPOSBroker,isPosBroker,1)
if (isPosBroker == true) {
holder.tvPOSBroker.setBackgroundResource(R.drawable.round_corner_grey_button)
holder.tvPOSBroker.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0)
holder.tvPOSBroker.compoundDrawablePadding = 0
isPosBroker = false
} else {
holder.tvPOSBroker.setBackgroundResource(R.drawable.round_corner_grey_button_fill)
holder.tvPOSBroker.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.svg_tik,
0
)
holder.tvPOSBroker.compoundDrawablePadding = 20
isPosBroker = true
}
} }
}
private fun setSelected(textView: TextView, check: Boolean?, pos: Int) {
if (check == true) {
textView.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
0,
0
)
textView.compoundDrawablePadding = 0
if(pos==0) isPosBroker = false
else isPosInsurer = false
} else {
textView.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.svg_tik,
0
)
textView.compoundDrawablePadding = 20
if(pos==0) isPosBroker = true
else isPosInsurer = true
holder.radioGroup.setOnCheckedChangeListener { group, checkedId ->
var rb: RadioButton = group.findViewById(checkedId)
if(rb.text.equals("Yes"))
holder.llPOS.visibility = View.VISIBLE
else holder.llPOS.visibility = View.GONE
} }
} }
override fun getItemCount(): Int { override fun getItemCount(): Int {
@ -78,5 +106,8 @@ class NewDistributorSignStepOneAdapter(private var listData: MutableList<String>
val rlInsurance: RelativeLayout = itemView.findViewById(R.id.rlInsurance) val rlInsurance: RelativeLayout = itemView.findViewById(R.id.rlInsurance)
val tvPosInsurer: TextView = itemView.findViewById(R.id.tvPosInsurer) val tvPosInsurer: TextView = itemView.findViewById(R.id.tvPosInsurer)
val tvPOSBroker: TextView = itemView.findViewById(R.id.tvPOSBroker) val tvPOSBroker: TextView = itemView.findViewById(R.id.tvPOSBroker)
val tlOtherName: TextInputLayout = itemView.findViewById(R.id.tlOtherName)
val radioGroup: RadioGroup = itemView.findViewById(R.id.radioGroup)
val llPOS: LinearLayout = itemView.findViewById(R.id.llPOS)
} }
} }

+ 16
- 18
app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/SignUpActivity.kt View File

@ -1,15 +1,13 @@
package com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1 package com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.window.OnBackInvokedDispatcher
import androidx.activity.OnBackPressedCallback
import android.util.Log
import androidx.fragment.app.FragmentManager
import com.nivesh.production.niveshfd.R import com.nivesh.production.niveshfd.R
import com.nivesh.production.niveshfd.databinding.ActivitySignupBinding import com.nivesh.production.niveshfd.databinding.ActivitySignupBinding
import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
import com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1.SignUpFragment import com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1.SignUpFragment
class SignUpActivity : BaseActivity() { class SignUpActivity : BaseActivity() {
lateinit var binding: ActivitySignupBinding lateinit var binding: ActivitySignupBinding
var type : Int? = null var type : Int? = null
@ -20,31 +18,31 @@ class SignUpActivity : BaseActivity() {
} }
private fun init() { private fun init() {
type = intent.getIntExtra("type", 0);
type = intent.getIntExtra("type", 0)
binding = ActivitySignupBinding.inflate(layoutInflater) binding = ActivitySignupBinding.inflate(layoutInflater)
binding.apply { binding.apply {
setContentView(this.root) setContentView(this.root)
} }
val bundle = Bundle()
bundle.putInt("type", type!!)
val fragment = SignUpFragment()
fragment.arguments = bundle
supportFragmentManager.beginTransaction() supportFragmentManager.beginTransaction()
.add(R.id.signUpContainer, SignUpFragment())
.add(R.id.signUpContainer, fragment)
.commit() .commit()
} }
// @Deprecated("Deprecated in Java")
// override fun onBackPressed() { // override fun onBackPressed() {
// if (Build.VERSION.SDK_INT >= 33) {
// onBackInvokedDispatcher.registerOnBackInvokedCallback(
// OnBackInvokedDispatcher.PRIORITY_DEFAULT
// ) {
// exitOnBackPressed()
// }
// val fm: FragmentManager = supportFragmentManager
// if (fm.backStackEntryCount > 0) {
// Log.i("MainActivity", "popping backstack")
// fm.popBackStack()
// } else { // } else {
// onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
// override fun handleOnBackPressed() {
// exitOnBackPressed()
// }
// })
// Log.i("MainActivity", "nothing on backstack, calling super")
// super.onBackPressed()
// } // }
// } // }


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

@ -11,6 +11,7 @@ import com.nivesh.production.niveshfd.R
import com.nivesh.production.niveshfd.databinding.FragmentAlmostThereBinding import com.nivesh.production.niveshfd.databinding.FragmentAlmostThereBinding
import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
import com.nivesh.production.niveshfd.fd.util.Common import com.nivesh.production.niveshfd.fd.util.Common
import com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1.SignUpActivity
class AlmostThereFragment : BaseFragment() { class AlmostThereFragment : BaseFragment() {
private var _binding: FragmentAlmostThereBinding? = null private var _binding: FragmentAlmostThereBinding? = null
@ -105,7 +106,8 @@ class AlmostThereFragment : BaseFragment() {
} }
binding.btnBack.setOnClickListener { binding.btnBack.setOnClickListener {
requireActivity().onBackPressedDispatcher.onBackPressed()
// (activity as SignUpActivity).onBackPressedDispatcher
(activity as SignUpActivity).onBackPressedDispatcher.onBackPressed()
} }
binding.btnNext.setOnClickListener { binding.btnNext.setOnClickListener {
@ -113,8 +115,6 @@ class AlmostThereFragment : BaseFragment() {
// submit // submit
} }
} }
} }
private fun validate(): Boolean { private fun validate(): Boolean {


+ 300
- 96
app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/GetStartedFragment.kt View File

@ -1,19 +1,25 @@
package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1 package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1
import android.Manifest import android.Manifest
import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.content.DialogInterface import android.content.DialogInterface
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.database.Cursor
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.BitmapFactory import android.graphics.BitmapFactory
import android.graphics.Color
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.provider.OpenableColumns
import android.text.Editable
import android.text.TextWatcher
import android.util.Base64
import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.AdapterView
import android.widget.ArrayAdapter import android.widget.ArrayAdapter
import android.widget.Switch
import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
@ -21,24 +27,18 @@ import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider import androidx.core.content.FileProvider
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.google.android.material.button.MaterialButton
import com.nivesh.production.niveshfd.BuildConfig
import com.nivesh.production.niveshfd.R import com.nivesh.production.niveshfd.R
import com.nivesh.production.niveshfd.databinding.FragmentGetStartedBinding import com.nivesh.production.niveshfd.databinding.FragmentGetStartedBinding
import com.nivesh.production.niveshfd.fd.db.PreferenceManager
import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
import com.nivesh.production.niveshfd.fd.util.Common
import com.nivesh.production.niveshfd.fd.util.Common.Companion.getFileExtension
import com.nivesh.production.niveshfd.fd.util.Common.Companion.showDialogWithTwoButtons import com.nivesh.production.niveshfd.fd.util.Common.Companion.showDialogWithTwoButtons
import com.nivesh.production.niveshfd.fd.util.ImageUtil
import com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1.SignUpActivity import com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1.SignUpActivity
import java.io.File
import java.io.FileDescriptor
import java.io.IOException
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"
import java.io.*
class GetStartedFragment : BaseFragment() { class GetStartedFragment : BaseFragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null
private var _binding: FragmentGetStartedBinding? = null private var _binding: FragmentGetStartedBinding? = null
private val binding get() = _binding!! private val binding get() = _binding!!
private var latestTmpUri: Uri? = null private var latestTmpUri: Uri? = null
@ -51,6 +51,19 @@ class GetStartedFragment : BaseFragment() {
private val secondDocUpload: Int = 4 private val secondDocUpload: Int = 4
private var actionType: Int = -1 private var actionType: Int = -1
private var panString: String = ""
private var photoString: String = ""
private var docString: String = ""
private var docString2: String = ""
private var panFileExt: String? = ""
private var photoFileExt: String? = ""
private var doc1FileExt: String? = ""
private var doc2fileExt: String? = ""
private var docValue: String = ""
private var uploadPosition = 0
private var isFront: Boolean = false
private val listArray = ArrayList<String>() private val listArray = ArrayList<String>()
private val permissions = arrayOf( private val permissions = arrayOf(
Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE,
@ -74,28 +87,24 @@ class GetStartedFragment : BaseFragment() {
private val requestGalleryPermission = registerForActivityResult( private val requestGalleryPermission = registerForActivityResult(
ActivityResultContracts.RequestMultiplePermissions() ActivityResultContracts.RequestMultiplePermissions()
) { permission -> ) { permission ->
if (!permission.containsValue(false)) {
selectImageIntent?.launch("image/*")
} else {
showDialogWithTwoButtons(
(activity as SignUpActivity),
getString(R.string.galleryPermission),
getString(
R.string.permissionsRequired
)
)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
// if (!permission.containsValue(false)) {
selectImageIntent?.launch("image/*")
// } else {
// showDialogWithTwoButtons(
// (activity as SignUpActivity),
// getString(R.string.galleryPermission),
// getString(
// R.string.permissionsRequired
// )
// )
// }
} }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
// Inflate the layout for this fragment // Inflate the layout for this fragment
_binding = FragmentGetStartedBinding.inflate(inflater, container, false) _binding = FragmentGetStartedBinding.inflate(inflater, container, false)
return binding.root return binding.root
@ -104,23 +113,6 @@ class GetStartedFragment : BaseFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
init() init()
selectImageIntent = registerForActivityResult(ActivityResultContracts.GetContent())
{ uri: Uri? ->
if (uri != null) {
bitmap = uriToBitmap(uri)
// uploadDocument(uri, "g")
}
}
takeImageResult =
registerForActivityResult(ActivityResultContracts.TakePicture()) { isSuccess ->
if (isSuccess) {
latestTmpUri?.let { uri ->
// uploadDocument(uri, "c")
}
}
}
} }
private fun uriToBitmap(selectedFileUri: Uri): Bitmap? { private fun uriToBitmap(selectedFileUri: Uri): Bitmap? {
@ -137,8 +129,117 @@ class GetStartedFragment : BaseFragment() {
return null return null
} }
private fun isInputCorrect(
s: Editable,
totalSymbols: Int,
dividerModulo: Int,
divider: Char
): Boolean {
var isCorrect = s.length <= totalSymbols // check size of entered string
for (i in 0 until s.length) { // check that every element is right
isCorrect = if (i > 0 && (i + 1) % dividerModulo == 0) {
isCorrect and (divider == s[i])
} else {
isCorrect and Character.isDigit(s[i])
}
}
return isCorrect
}
private fun init() { private fun init() {
var total_SYMBOLS: Int = 14
var TOTAL_DIGITS: Int = 12 // max numbers of digits in pattern: 0000 x 4
var DIVIDER_MODULO: Int = 4 // means divider position is every 5th symbol beginning with 1
var DIVIDER_POSITION: Int = DIVIDER_MODULO - 1; // means divider position is every 4th symbol beginning with 0
var DIVIDER: Char = '-'
binding.edtEuinNumber.addTextChangedListener(object : TextWatcher{
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
override fun afterTextChanged(s: Editable?) {
if (!isInputCorrect(s!!, total_SYMBOLS, DIVIDER_MODULO, DIVIDER)) {
s?.replace(0, s.length, buildCorrectString(getDigitArray(s, TOTAL_DIGITS)!!, DIVIDER_POSITION, DIVIDER))
}
}
private fun isInputCorrect(
s: Editable,
totalSymbols: Int,
dividerModulo: Int,
divider: Char
): Boolean {
var isCorrect = s.length <= totalSymbols // check size of entered string
for (i in s.indices) { // check that every element is right
isCorrect = if (i > 0 && (i + 1) % dividerModulo == 0) {
isCorrect and (divider == s[i])
} else {
isCorrect and Character.isDigit(s[i])
}
}
return isCorrect
}
private fun buildCorrectString(
digits: CharArray,
dividerPosition: Int,
divider: Char
): String? {
val formatted = StringBuilder()
for (i in digits.indices) {
if (digits[i].code != 0) {
formatted.append(digits[i])
if (i > 0 && i < digits.size - 1 && (i + 1) % dividerPosition == 0) {
formatted.append(divider)
}
}
}
return formatted.toString()
}
private fun getDigitArray(s: Editable, size: Int): CharArray? {
val digits = CharArray(size)
var index = 0
var i = 0
while (i < s.length && index < size) {
val current = s[i]
if (Character.isDigit(current)) {
digits[index] = current
index++
}
i++
}
return digits
}
})
// binding.edtEuinNumber.doAfterTextChanged {
// val formattedText = binding.edtEuinNumber.toString().replace(" ", "").chunked(4).joinToString("/")
// if (formattedText != binding.edtEuinNumber.toString()) {
// binding.edtEuinNumber.setText(formattedText)
// binding.edtEuinNumber.setSelection(binding.edtEuinNumber.length())
// }
// }
selectImageIntent = registerForActivityResult(ActivityResultContracts.GetContent())
{ uri: Uri? ->
if (uri != null) {
bitmap = uriToBitmap(uri)
uploadDocument(uri, "g")
}
}
takeImageResult =
registerForActivityResult(ActivityResultContracts.TakePicture()) { isSuccess ->
if (isSuccess) {
latestTmpUri?.let { uri ->
uploadDocument(uri, "c")
}
}
}
binding.btnNext.setOnClickListener { binding.btnNext.setOnClickListener {
replaceFragment( replaceFragment(
activity as BaseActivity, activity as BaseActivity,
@ -154,19 +255,46 @@ class GetStartedFragment : BaseFragment() {
listArray.add("Driving Licenses") listArray.add("Driving Licenses")
listArray.add("Voter Id") listArray.add("Voter Id")
val arrayAdapter = ArrayAdapter(activity as SignUpActivity, androidx.appcompat.R.layout.support_simple_spinner_dropdown_item,listArray)
val arrayAdapter = ArrayAdapter(
activity as SignUpActivity,
androidx.appcompat.R.layout.support_simple_spinner_dropdown_item,
listArray
)
binding.spDocType.setAdapter(arrayAdapter) binding.spDocType.setAdapter(arrayAdapter)
binding.spDocType.setOnItemClickListener{ _, _, position, _ ->
// setVisibility(listArray[position])
binding.spDocType.setOnItemClickListener { _, _, position, _ ->
setVisibility(listArray[position])
} }
binding.uploadFront.setOnClickListener { binding.uploadFront.setOnClickListener {
actionType = mainPANUpload actionType = mainPANUpload
isFront = true
selectImage()
}
binding.mbUploadChangeFront.setOnClickListener {
actionType = mainPANUpload
isFront = true
selectImage()
}
binding.mbUploadChangeBack.setOnClickListener {
actionType = mainPANUpload
isFront = false
selectImage()
}
binding.uploadBack.setOnClickListener {
actionType = mainPANUpload
isFront = false
selectImage() selectImage()
} }
} }
private fun setUploadOption(checked: Boolean) {
isFront = checked
}
private fun selectImage() { private fun selectImage() {
val builder = AlertDialog.Builder( val builder = AlertDialog.Builder(
activity as SignUpActivity activity as SignUpActivity
@ -247,45 +375,116 @@ class GetStartedFragment : BaseFragment() {
return true return true
} }
// private fun setVisibility(s: String) {
// if(s.contains("Aadhaar")){
// binding.txtFront.visibility = View.VISIBLE
// binding.uploadFront.visibility = View.VISIBLE
// binding.txtBack.visibility = View.VISIBLE
// binding.uploadViewBack.visibility = View.VISIBLE
// }else{
// binding.txtFront.visibility = View.VISIBLE
// binding.uploadFront.visibility = View.VISIBLE
// binding.txtBack.visibility = View.GONE
// binding.uploadViewBack.visibility = View.GONE
// }
// }
private fun setVisibility(s: String) {
if (s.contains("Aadhaar")) {
binding.txtFront.visibility = View.VISIBLE
binding.uploadFront.visibility = View.VISIBLE
binding.txtBack.visibility = View.VISIBLE
binding.llBack.visibility = View.VISIBLE
} else {
binding.txtFront.visibility = View.VISIBLE
binding.uploadFront.visibility = View.VISIBLE
binding.txtBack.visibility = View.GONE
binding.llBack.visibility = View.GONE
}
}
private fun getTmpFileUri(): Uri {
val tmpFile =
File.createTempFile("tmp_image_file", ".png", requireActivity().cacheDir).apply {
createNewFile()
deleteOnExit()
}
return FileProvider.getUriForFile(
requireActivity(), BuildConfig.APPLICATION_ID.plus(".provider"), tmpFile
)
}
private fun takeImage() { private fun takeImage() {
lifecycleScope.launchWhenStarted { lifecycleScope.launchWhenStarted {
getTmpFileUri().let { uri ->
latestTmpUri = uri
takeImageResult?.launch(uri)
try {
getTmpFileUri().let { uri ->
latestTmpUri = uri
takeImageResult?.launch(uri)
}
} catch (e: Exception) {
Log.e("check_exception", e.message.toString())
} }
} }
} }
// private fun uploadDocument(uri: Uri, type: String) {
// when (actionType) {
// mainPANUpload -> {
// binding.ivPan.visibility = View.VISIBLE
// val fileDir: File = requireActivity().cacheDir
// val fileExtension = File(fileDir.toString().plus("/").plus(getFileName(uri)))
// panFileExt = getFileExtension(getFileName(uri))
// val size: Double = Common.getFileSizeInMB(fileExtension.length())
// if (size < 5) {
// if (type == "c") encodedPANBase64(fileExtension)
// else panString = bitmap?.let { ImageUtil.convert(it) }.toString()
// } else {
// panString = ""
// panFileExt = ""
// }
// }
@SuppressLint("Range")
fun getFileName(uri: Uri): String {
var result = ""
if (uri.scheme == "content") {
val cursor: Cursor =
requireActivity().contentResolver.query(uri, null, null, null, null)!!
cursor.use { cursor1 ->
if (cursor1.moveToFirst()) {
result = cursor1.getString(cursor1.getColumnIndex(OpenableColumns.DISPLAY_NAME))
}
}
}
if (result.isEmpty()) {
result = uri.path!!
val cut = result.lastIndexOf('/')
if (cut != -1) {
result = result.substring(cut + 1)
}
}
return result
}
@Throws(IOException::class)
private fun loadFile(file: File): ByteArray {
val inputStream: InputStream = FileInputStream(file)
val length = file.length()
val bytes = ByteArray(length.toInt())
var offset = 0
var numRead = 0
while (offset < bytes.size && inputStream.read(bytes, offset, bytes.size - offset).also {
numRead = it
} >= 0) {
offset += numRead
}
if (offset < bytes.size) {
throw IOException("Could not completely read file " + file.name)
}
inputStream.close()
return bytes
}
private fun encodedPANBase64(fileName: File) {
panString = try {
val bytes: ByteArray = loadFile(fileName)
Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "")
.replace("\\s+", "")
} catch (e: Exception) {
e.printStackTrace()
""
}
}
private fun uploadDocument(uri: Uri, type: String) {
when (actionType) {
mainPANUpload -> {
val fileDir: File = (activity as SignUpActivity).cacheDir
val fileExtension = File(fileDir.toString().plus("/").plus(getFileName(uri)))
panFileExt = getFileExtension(getFileName(uri))
val size: Double = Common.getFileSizeInMB(fileExtension.length())
setFrontHideVisible(uri)
if (size < 5) {
if (type == "c") encodedPANBase64(fileExtension)
else panString = bitmap?.let { ImageUtil.convert(it) }.toString()
} else {
panString = ""
panFileExt = ""
}
}
// mainPhotoUpload -> { // mainPhotoUpload -> {
// binding.ivPhotograph.visibility = View.VISIBLE // binding.ivPhotograph.visibility = View.VISIBLE
// val fileDir: File = requireActivity().cacheDir // val fileDir: File = requireActivity().cacheDir
@ -328,17 +527,22 @@ class GetStartedFragment : BaseFragment() {
// doc2fileExt = "" // doc2fileExt = ""
// } // }
// } // }
// }
// }
private fun getTmpFileUri(): Uri {
val tmpFile =
File.createTempFile("tmp_image_file", ".png", requireActivity().cacheDir).apply {
createNewFile()
deleteOnExit()
}
}
}
return FileProvider.getUriForFile(
requireActivity(), PreferenceManager(activity as SignUpActivity).getAppId().plus(".provider"), tmpFile)
private fun setFrontHideVisible(uri: Uri) {
if (isFront) {
binding.uploadFront.visibility = View.GONE
binding.ivFrontLayer.setBackgroundColor(Color.parseColor("#99000000"))
binding.ivFrontTik.setBackgroundResource(R.drawable.svg_tik)
binding.mbUploadChangeFront.visibility = View.VISIBLE
binding.ivFront.setImageURI(uri)
} else {
binding.uploadBack.visibility = View.GONE
binding.ivBackLayer.setBackgroundColor(Color.parseColor("#99000000"))
binding.ivBackTik.setBackgroundResource(R.drawable.svg_tik)
binding.mbUploadChangeBack.visibility = View.VISIBLE
binding.ivBack.setImageURI(uri)
}
} }
} }

+ 10
- 1
app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/NewDistributorSignStepOne.kt View File

@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.nivesh.production.niveshfd.databinding.NewDistributorSignStepOneBinding import com.nivesh.production.niveshfd.databinding.NewDistributorSignStepOneBinding
import com.nivesh.production.niveshfd.partnerOnBoarding.adapters1.NewDistributorSignStepOneAdapter import com.nivesh.production.niveshfd.partnerOnBoarding.adapters1.NewDistributorSignStepOneAdapter
@ -14,6 +15,10 @@ class NewDistributorSignStepOne : BaseFragment(){
private var _binding: NewDistributorSignStepOneBinding? = null private var _binding: NewDistributorSignStepOneBinding? = null
private val binding get() = _binding!! private val binding get() = _binding!!
companion object{
var listMapData: MutableMap<Int, String>? = null
}
override fun onCreateView( override fun onCreateView(
inflater: LayoutInflater, inflater: LayoutInflater,
container: ViewGroup?, container: ViewGroup?,
@ -29,7 +34,7 @@ class NewDistributorSignStepOne : BaseFragment(){
} }
private fun init() { private fun init() {
val listMapData: Map<String,Boolean>
val listData = mutableListOf("Mutual Fund","Insurance","Bond","Capital Gain Bond (CGB)", val listData = mutableListOf("Mutual Fund","Insurance","Bond","Capital Gain Bond (CGB)",
"Non-Convertible Debentures(NCDs)","Fixed Deposit (FD)","National Pension System (NPS)", "Non-Convertible Debentures(NCDs)","Fixed Deposit (FD)","National Pension System (NPS)",
"Secondary Bond","Other") "Secondary Bond","Other")
@ -37,5 +42,9 @@ class NewDistributorSignStepOne : BaseFragment(){
binding.rvList.layoutManager = LinearLayoutManager(activity as SignUpActivity) binding.rvList.layoutManager = LinearLayoutManager(activity as SignUpActivity)
val adapter = NewDistributorSignStepOneAdapter(listData) val adapter = NewDistributorSignStepOneAdapter(listData)
binding.rvList.adapter = adapter binding.rvList.adapter = adapter
binding.btnNext.setOnClickListener {
Toast.makeText((activity as SignUpActivity), listMapData.toString(),Toast.LENGTH_SHORT).show()
}
} }
} }

+ 10
- 3
app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/OTPFragment.kt View File

@ -14,11 +14,11 @@ import com.nivesh.production.niveshfd.R
import com.nivesh.production.niveshfd.databinding.FragmentOtpBinding import com.nivesh.production.niveshfd.databinding.FragmentOtpBinding
import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
import com.nivesh.production.niveshfd.fd.util.Common import com.nivesh.production.niveshfd.fd.util.Common
import com.nivesh.production.niveshfd.partnerOnBoarding.adapters1.NewDistributorSignStepOneAdapter
class OTPFragment : BaseFragment() { class OTPFragment : BaseFragment() {
private var _binding: FragmentOtpBinding? = null private var _binding: FragmentOtpBinding? = null
private val binding get() = _binding!! private val binding get() = _binding!!
private var type: Int? = null
override fun onCreateView( override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
@ -29,6 +29,7 @@ class OTPFragment : BaseFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
type = arguments?.getInt("type")
init() init()
} }
@ -64,11 +65,17 @@ class OTPFragment : BaseFragment() {
binding.btnSubmit.setOnClickListener { binding.btnSubmit.setOnClickListener {
if (validate()) { if (validate()) {
var fragment = Fragment()
if(type == 4) {
fragment = GetStartedFragment()
} else if(type == 3){
fragment = NewDistributorSignStepOne()
}
replaceFragment( replaceFragment(
activity as BaseActivity, activity as BaseActivity,
R.id.signUpContainer, R.id.signUpContainer,
// GetStartedFragment(),
NewDistributorSignStepOne(),
fragment,
"GET STARTED", "GET STARTED",
true true
) )


+ 9
- 1
app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/SignUpFragment.kt View File

@ -7,6 +7,7 @@ import android.text.TextWatcher
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.nivesh.production.niveshfd.databinding.FragmentSignupBinding import com.nivesh.production.niveshfd.databinding.FragmentSignupBinding
import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
import com.nivesh.production.niveshfd.fd.util.Common import com.nivesh.production.niveshfd.fd.util.Common
@ -15,6 +16,7 @@ import com.nivesh.production.niveshfd.fd.util.Common
class SignUpFragment : BaseFragment() { class SignUpFragment : BaseFragment() {
private var _binding: FragmentSignupBinding? = null private var _binding: FragmentSignupBinding? = null
private val binding get() = _binding!! private val binding get() = _binding!!
private var type: Int? = null
override fun onCreateView( override fun onCreateView(
@ -26,6 +28,7 @@ class SignUpFragment : BaseFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
type = arguments?.getInt("type")
init() init()
} }
@ -41,10 +44,15 @@ class SignUpFragment : BaseFragment() {
binding.btnSignUp.setOnClickListener { binding.btnSignUp.setOnClickListener {
if (validate()) { if (validate()) {
val bundle = Bundle()
bundle.putInt("type",type!!)
val fragment = OTPFragment()
fragment.arguments = bundle
replaceFragment( replaceFragment(
activity as BaseActivity, activity as BaseActivity,
com.nivesh.production.niveshfd.R.id.signUpContainer, com.nivesh.production.niveshfd.R.id.signUpContainer,
OTPFragment(),
fragment,
"OTP", "OTP",
true true
) )


+ 35
- 0
app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/util/MaskWatcher.kt View File

@ -0,0 +1,35 @@
package com.nivesh.production.niveshfd.partnerOnBoarding.util
import android.text.Editable
import android.text.TextWatcher
class MaskWatcher(private val mask: String) : TextWatcher {
private var isRunning = false
private var isDeleting = false
override fun beforeTextChanged(charSequence: CharSequence, start: Int, count: Int, after: Int) {
isDeleting = count > after
}
override fun onTextChanged(charSequence: CharSequence, start: Int, before: Int, count: Int) {}
override fun afterTextChanged(editable: Editable) {
if (isRunning || isDeleting) {
return
}
isRunning = true
val editableLength = editable.length
if (editableLength < mask.length) {
if (mask[editableLength] != '#') {
editable.append(mask[editableLength])
} else if (mask[editableLength - 1] != '#') {
editable.insert(editableLength - 1, mask, editableLength - 1, editableLength)
}
}
isRunning = false
}
companion object {
fun buildCpf(): MaskWatcher {
return MaskWatcher("###.###.###-##")
}
}
}

+ 8
- 0
app/src/main/res/drawable/round_corner_grey_button_fill.xml View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="50dp"/>
<solid android:color="@color/greyColor3"></solid>
<stroke
android:width="@dimen/margin_1"
android:color="@color/greyColor3"/>
</shape>

+ 2
- 2
app/src/main/res/drawable/svg_tik.xml View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="10dp"
android:width="24dp"
android:height="20dp"
android:viewportWidth="12" android:viewportWidth="12"
android:viewportHeight="10"> android:viewportHeight="10">


+ 107
- 122
app/src/main/res/layout/fragment_get_started.xml View File

@ -7,6 +7,7 @@
android:orientation="vertical"> android:orientation="vertical">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/nestedScrollView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fillViewport="true" android:fillViewport="true"
@ -24,7 +25,6 @@
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"> app:layout_constraintBottom_toBottomOf="parent">
<ImageView <ImageView
android:id="@+id/ivInfo" android:id="@+id/ivInfo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -62,7 +62,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/txtGetStart" /> app:layout_constraintTop_toBottomOf="@id/txtGetStart" />
<!--Full Name --> <!--Full Name -->
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlArnNumber" android:id="@+id/tlArnNumber"
@ -85,6 +84,26 @@
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlEuinNumber"
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/enter_your_arn_number"
android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/tlArnNumber">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtEuinNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:textColorHint="@color/greyColor2"
android:textSize="@dimen/text_size_14" />
</com.google.android.material.textfield.TextInputLayout>
<!--Email --> <!--Email -->
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlPanNumber" android:id="@+id/tlPanNumber"
@ -94,7 +113,7 @@
android:layout_marginTop="@dimen/margin_5" android:layout_marginTop="@dimen/margin_5"
android:hint="@string/enter_pan_card_number" android:hint="@string/enter_pan_card_number"
android:padding="@dimen/margin_3" android:padding="@dimen/margin_3"
app:layout_constraintTop_toBottomOf="@+id/tlArnNumber">
app:layout_constraintTop_toBottomOf="@+id/tlEuinNumber">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtPanNumber" android:id="@+id/edtPanNumber"
@ -209,12 +228,13 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginStart="@dimen/margin_10" android:layout_marginStart="@dimen/margin_10"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spAddressType"> app:layout_constraintTop_toBottomOf="@+id/spAddressType">
<LinearLayout <LinearLayout
android:id="@+id/llFront"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
@ -237,13 +257,29 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<RelativeLayout <RelativeLayout
android:id="@+id/rvFrontLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/dot_rect"> android:background="@drawable/dot_rect">
<ImageView <ImageView
android:id="@+id/ivFront"
android:layout_width="@dimen/margin_130"
android:layout_height="@dimen/margin_90"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/ivFrontLayer"
android:layout_width="@dimen/margin_130"
android:layout_height="@dimen/margin_90"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/ivFrontTik"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:backgroundTint="@color/greenColor" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/uploadFront" android:id="@+id/uploadFront"
@ -261,10 +297,25 @@
</RelativeLayout> </RelativeLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/mbUploadChangeFront"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_20"
android:layout_marginEnd="@dimen/margin_20"
android:layout_marginBottom="@dimen/margin_20"
android:backgroundTint="@color/white"
android:text="@string/change"
android:textAllCaps="false"
android:textColor="@color/red"
android:textStyle="bold"
android:visibility="gone"
app:cornerRadius="@dimen/margin_15" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/llBack"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
@ -291,14 +342,33 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/dot_rect"> android:background="@drawable/dot_rect">
<ImageView
android:id="@+id/ivBack"
android:layout_width="@dimen/margin_130"
android:layout_height="@dimen/margin_90"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/ivBackLayer"
android:layout_width="@dimen/margin_130"
android:layout_height="@dimen/margin_90"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/ivBackTik"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:backgroundTint="@color/greenColor" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/uploadBack" android:id="@+id/uploadBack"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_20"
android:layout_marginStart="@dimen/margin_15" android:layout_marginStart="@dimen/margin_15"
android:layout_marginEnd="@dimen/margin_5" android:layout_marginEnd="@dimen/margin_5"
android:backgroundTint="@color/white" android:backgroundTint="@color/white"
android:layout_margin="@dimen/margin_20"
android:text="@string/upload" android:text="@string/upload"
android:textAllCaps="false" android:textAllCaps="false"
android:textColor="@color/red" android:textColor="@color/red"
@ -306,131 +376,36 @@
</RelativeLayout> </RelativeLayout>
</LinearLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/mbUploadChangeBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_20"
android:layout_marginEnd="@dimen/margin_20"
android:layout_marginBottom="@dimen/margin_20"
android:backgroundTint="@color/white"
android:text="@string/change"
android:textAllCaps="false"
android:textColor="@color/red"
android:textStyle="bold"
android:visibility="gone"
app:cornerRadius="@dimen/margin_15" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
<!-- android:id="@+id/constraintLayout"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:orientation="vertical"-->
<!-- android:layout_marginTop="@dimen/margin_10"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/spAddressType">-->
<!-- <TextView-->
<!-- android:id="@+id/txtFront"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:padding="@dimen/margin_4"-->
<!-- android:text="Front"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="@dimen/text_size_14"-->
<!-- android:textStyle="bold"-->
<!-- app:layout_constraintBottom_toTopOf="@+id/uploadViewFront"-->
<!-- app:layout_constraintEnd_toStartOf="@+id/txtBack"-->
<!-- app:layout_constraintHorizontal_bias="0.129"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
<!-- android:id="@+id/uploadViewFront"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="@dimen/margin_8"-->
<!-- android:layout_marginTop="@dimen/margin_4"-->
<!-- android:background="@drawable/upload_background"-->
<!-- app:layout_constraintHorizontal_bias="0.5"-->
<!-- app:layout_constraintHorizontal_chainStyle="spread_inside"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/txtFront">-->
<!-- <ImageView-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@mipmap/ic_launcher"-->
<!-- app:cornerRadius="@dimen/margin_15"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent" />-->
<!-- <com.google.android.material.button.MaterialButton-->
<!-- android:id="@+id/uploadFront"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:backgroundTint="@color/white"-->
<!-- android:text="Upload"-->
<!-- android:textColor="@color/red"-->
<!-- app:cornerRadius="@dimen/margin_15"-->
<!-- app:layout_constraintBottom_toBottomOf="@+id/uploadViewFront"-->
<!-- app:layout_constraintEnd_toEndOf="@+id/uploadViewFront"-->
<!-- app:layout_constraintStart_toStartOf="@+id/uploadViewFront"-->
<!-- app:layout_constraintTop_toTopOf="@+id/uploadViewFront" />-->
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
<!-- <TextView-->
<!-- android:id="@+id/txtBack"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:padding="@dimen/margin_4"-->
<!-- android:text="Back"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="@dimen/text_size_14"-->
<!-- android:textStyle="bold"-->
<!-- app:layout_constraintBottom_toTopOf="@+id/uploadViewBack"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintHorizontal_bias="0.028"-->
<!-- app:layout_constraintStart_toStartOf="@+id/uploadViewBack"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
<!-- android:id="@+id/uploadViewBack"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="@dimen/margin_25"-->
<!-- android:layout_marginTop="@dimen/margin_4"-->
<!-- android:background="@drawable/upload_background"-->
<!-- app:layout_constraintHorizontal_bias="0.5"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintStart_toEndOf="@+id/uploadViewFront"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/txtBack">-->
<!-- <com.google.android.material.button.MaterialButton-->
<!-- android:id="@+id/uploadBack"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="@dimen/margin_15"-->
<!-- android:layout_marginEnd="@dimen/margin_5"-->
<!-- android:backgroundTint="@color/white"-->
<!-- android:text="Upload"-->
<!-- android:textColor="@color/red"-->
<!-- app:cornerRadius="@dimen/margin_15"-->
<!-- app:layout_constraintBottom_toBottomOf="@+id/uploadViewBack"-->
<!-- app:layout_constraintEnd_toEndOf="@+id/uploadViewBack"-->
<!-- app:layout_constraintStart_toStartOf="@+id/uploadViewBack"-->
<!-- app:layout_constraintTop_toTopOf="@+id/uploadViewBack" />-->
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/saveDraft" android:id="@+id/saveDraft"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_15" android:layout_marginStart="@dimen/margin_15"
android:layout_marginEnd="@dimen/margin_5" android:layout_marginEnd="@dimen/margin_5"
android:layout_marginBottom="@dimen/margin_20"
android:layout_marginBottom="@dimen/margin_40"
android:backgroundTint="@color/white" android:backgroundTint="@color/white"
android:text="@string/save_draft" android:text="@string/save_draft"
android:textColor="@color/red" android:textColor="@color/red"
@ -441,10 +416,7 @@
app:layout_constraintHorizontal_chainStyle="spread" app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/btnNext" app:layout_constraintRight_toLeftOf="@+id/btnNext"
app:layout_constraintStart_toStartOf="parent"
/>
app:layout_constraintStart_toStartOf="parent"/>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/btnNext" android:id="@+id/btnNext"
@ -452,7 +424,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_5" android:layout_marginStart="@dimen/margin_5"
android:layout_marginEnd="@dimen/margin_15" android:layout_marginEnd="@dimen/margin_15"
android:layout_marginBottom="@dimen/margin_20"
android:layout_marginBottom="@dimen/margin_40"
android:backgroundTint="@color/red" android:backgroundTint="@color/red"
android:text="@string/continueText" android:text="@string/continueText"
android:textColor="@color/white" android:textColor="@color/white"
@ -464,4 +436,17 @@
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toEndOf="@+id/saveDraft" /> app:layout_constraintStart_toEndOf="@+id/saveDraft" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/margin_4"
android:text="@string/up_next_address"
android:textColor="@color/textColor1"
style="@style/regularStyle"
android:textSize="@dimen/text_size_14"
app:layout_constraintEnd_toEndOf="@+id/btnNext"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="@+id/btnNext"
app:layout_constraintTop_toBottomOf="@+id/btnNext" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

+ 29
- 2
app/src/main/res/layout/new_distributor_sign_step_one_adapter.xml View File

@ -40,21 +40,23 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/margin_20"
android:orientation="horizontal"> android:orientation="horizontal">
<RadioButton <RadioButton
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Yes"/>
android:text="@string/yes"/>
<RadioButton <RadioButton
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="No"/>
android:text="@string/no"/>
</RadioGroup> </RadioGroup>
<LinearLayout <LinearLayout
android:id="@+id/llPOS"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/radioGroup" android:layout_below="@+id/radioGroup"
@ -90,4 +92,29 @@
</RelativeLayout> </RelativeLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tlOtherName"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_5"
android:hint="@string/please_name_other"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rlInsurance">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtMobileNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone"
android:maxEms="10"
android:paddingTop="@dimen/margin_15"
android:paddingBottom="@dimen/margin_15"
android:textSize="@dimen/text_size_14" />
</com.google.android.material.textfield.TextInputLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

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

@ -320,5 +320,10 @@
<string name="have_a_pos_anywhere">Have a POS anywhere?</string> <string name="have_a_pos_anywhere">Have a POS anywhere?</string>
<string name="pos_with_an_insurer">POS with an insurer</string> <string name="pos_with_an_insurer">POS with an insurer</string>
<string name="pos_with_broker_corporate_agent">POS with Broker / Corporate Agent</string> <string name="pos_with_broker_corporate_agent">POS with Broker / Corporate Agent</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="please_name_other">Please Name Other</string>
<string name="change">Change</string>
<string name="up_next_address">Up Next: Address</string>
</resources> </resources>

+ 3
- 0
app/src/main/res/values/colors.xml View File

@ -24,6 +24,9 @@
<color name="greyColor4">#E6EBE0</color> <color name="greyColor4">#E6EBE0</color>
<color name="greyColor5">#303030</color> <color name="greyColor5">#303030</color>
<color name="greenColor">#41CA00</color>
<color name="textColor1">#545454</color>
<color name="teal_200">#FF03DAC5</color> <color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color> <color name="teal_700">#FF018786</color>

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

@ -324,6 +324,11 @@
<string name="have_a_pos_anywhere">Have a POS anywhere?</string> <string name="have_a_pos_anywhere">Have a POS anywhere?</string>
<string name="pos_with_an_insurer">POS with an insurer</string> <string name="pos_with_an_insurer">POS with an insurer</string>
<string name="pos_with_broker_corporate_agent">POS with Broker / Corporate Agent</string> <string name="pos_with_broker_corporate_agent">POS with Broker / Corporate Agent</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="please_name_other">Please Name Other</string>
<string name="change">Change</string>
<string name="up_next_address">Up Next: Address</string>
<array name="idProof"> <array name="idProof">
<item>Aadhar Front</item> <item>Aadhar Front</item>


+ 3
- 0
app/src/main/res/xml/file_paths.xml View File

@ -18,6 +18,9 @@
<files-path <files-path
name="files" name="files"
path="." /> path="." />
<external-path
name="external_files"
path="." />
<!-- Android/data/com.nivesh.production.debug/files/Pictures --> <!-- Android/data/com.nivesh.production.debug/files/Pictures -->
<!-- https://stackoverflow.com/questions/42516126/fileprovider-illegalargumentexception-failed-to-find-configured-root --> <!-- https://stackoverflow.com/questions/42516126/fileprovider-illegalargumentexception-failed-to-find-configured-root -->
</paths> </paths>

Loading…
Cancel
Save

Powered by TurnKey Linux.