Skip to content

Commit

Permalink
remove character count validarion
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahimsn98 committed Jun 18, 2021
1 parent c6d7a51 commit a6daa33
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/src/main/java/me/ibrahimsn/lib/PhoneNumberKit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class PhoneNumberKit(private val context: Context) {

private var hasManualCountry = false

private var specialLength = 0

private var rawInput: CharSequence?
get() = input?.editText?.text
set(value) {
Expand Down Expand Up @@ -123,7 +121,6 @@ class PhoneNumberKit(private val context: Context) {

core.formatPhoneNumber(core.getExampleNumber(country.iso2))?.let { number ->
input?.editText?.filters = arrayOf(InputFilter.LengthFilter(number.length))
specialLength = number.length
format = createNumberFormat(number)
applyFormat()
}
Expand Down Expand Up @@ -161,7 +158,6 @@ class PhoneNumberKit(private val context: Context) {
country = getCountry(defaultCountry) ?: Countries.list[0],
prefill = true
)
//rawInput = country?.countryCode?.prependPlus()
}

/**
Expand All @@ -181,7 +177,6 @@ class PhoneNumberKit(private val context: Context) {
country = getCountry(countryIso2.trim().toLowerCase(Locale.ENGLISH)) ?: Countries.list[0],
prefill = true
)
//rawInput = country?.countryCode?.prependPlus()
}

/**
Expand Down Expand Up @@ -292,7 +287,6 @@ class PhoneNumberKit(private val context: Context) {
private fun validate(number: CharSequence?): Boolean {
if (number == null) return false
return !number.isNullOrEmpty()
&& number.length >= specialLength
&& Patterns.PHONE.matcher(number).find()
}
}

0 comments on commit a6daa33

Please sign in to comment.